Skip to content
Snippets Groups Projects
Commit 5c94d449 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

[Fix] Put enable_testing() before add_subdirectory(src) fixes the ctest

parent 61a11e23
No related branches found
No related tags found
1 merge request!104Ctest configuration
This commit is part of merge request !104. Comments created here will be created in the context of that merge request.
......@@ -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()
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment