diff --git a/CMakeLists.txt b/CMakeLists.txt index 264512dd88d6516399181fca2e826510ea915da1..e2b1e20a79499c933c694fc3a117de9e5cd46092 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,17 @@ endif() #OPTION(BUILD_DOC "Build Documentation" OFF) OPTION(BUILD_TESTS "Build Unit tests" ON) +############# +## Testing ## +############# +# +if(BUILD_TESTS) + # Enables testing for this directory and below. + # Note that ctest expects to find a test file in the build directory root. + # Therefore, this command should be in the source directory root. + #include(CTest) # according to http://public.kitware.com/pipermail/cmake/2012-June/050853.html + enable_testing() +endif() ADD_SUBDIRECTORY(src) @@ -127,13 +138,3 @@ ELSE(UNIX) TARGET uninstall) ENDIF(UNIX) -############# -## Testing ## -############# -# -if(BUILD_TESTS) - # Enables testing for this directory and below. - # Note that ctest expects to find a test file in the build directory root. - # Therefore, this command should be in the source directory root. - enable_testing() -endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2672610786058ed97f513b4a9446a48ed5739432..9261ffff1caad4502bffa38878975c63f74c8086 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,6 +24,8 @@ option(BUILD_EXAMPLES "Build examples" ON) IF(BUILD_EXAMPLES) set(_WOLF_ROOT_DIR ${CMAKE_SOURCE_DIR}) ENDIF(BUILD_EXAMPLES) +# +# yes, for the tests ! IF(BUILD_TESTS) set(_WOLF_ROOT_DIR ${CMAKE_SOURCE_DIR}) ENDIF(BUILD_TESTS)