diff --git a/CMakeLists.txt b/CMakeLists.txt index 65a033ad..2c4bd4f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,5 +110,12 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) add_library(monoprop-objs OBJECT "") add_library(monoprop SHARED $) +# must run before add_subdirectory(cpp): CTest's enabled-ness does not propagate +# back up to a parent directory that has already been added as a subdirectory. +if(monoprop_ENABLE_CXX_UNIT_TESTS) + enable_testing() + include(CTest) +endif() + add_subdirectory(cpp) add_subdirectory(src/monoprop/bindings) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index a90e6349..361e4531 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -51,7 +51,5 @@ install( ) if(monoprop_ENABLE_CXX_UNIT_TESTS) - enable_testing() - include(CTest) add_subdirectory(tests) endif()