fix: only build tests if top level #10

Merged
lowearthorbit merged 1 commits from v0-2-0-small-fixes into release/0.2.0 2026-03-15 02:10:07 +01:00

View File

@@ -3,7 +3,6 @@ project(curtle VERSION 0.1.1 LANGUAGES C)
include(GNUInstallDirs) include(GNUInstallDirs)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
include(CTest)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_C_STANDARD_REQUIRED ON)
@@ -54,7 +53,7 @@ install(FILES
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/curtle DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/curtle
) )
if(BUILD_TESTING) if(${PROJECT_IS_TOP_LEVEL})
enable_testing() enable_testing()
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()