Commit 5410ca5b authored by Martin Heistermann's avatar Martin Heistermann

cmake: enable_testing only if we are main project, include unittests subdir only if option is set

parent 160f6d48
......@@ -17,7 +17,7 @@ else()
endif()
set(OVM_ENABLE_APPLICATIONS ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh applications in 'all' target")
set(OVM_ENABLE_UNITTESTS ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh unit tests in 'all' target")
set(OVM_ENABLE_UNITTESTS ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh unit tests")
set(OVM_ENABLE_EXAMPLES ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh examples in 'all' target")
set(OVM_BUILD_DOCUMENTATION ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh documentation in 'all' target")
......@@ -29,6 +29,7 @@ if (OVM_STANDALONE_BUILD)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/lib")
set(OVM_TARGET_PREFIX "")
enable_testing()
else()
# OVM_TARGET_PREFIX is prepended to targets with generic names,
# i.e., "doc", "unittests"
......@@ -37,7 +38,6 @@ endif()
set (CMAKE_DEBUG_POSTFIX "d")
enable_testing()
add_subdirectory (src)
if (OVM_ENABLE_EXAMPLES)
......
......@@ -162,6 +162,4 @@ endif()
if (OVM_ENABLE_UNITTESTS)
add_subdirectory(Unittests)
else()
add_subdirectory(Unittests EXCLUDE_FROM_ALL)
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment