mirror of https://github.com/wb2osz/direwolf.git
cmake: not build ctest binaries as default
unit test binaries are disabled by default now. To enable it use either cmake -DUNITTEST=1 .. or cmake -DCMAKE_BUILD_TYPE=DEBUG where CMAKE_BUILD_TYPE must be different from "RELEASE" see https://cmake.org/cmake/help/v3.0/variable/CMAKE_BUILD_TYPE.html
This commit is contained in:
parent
8fd4bebf45
commit
1ab26c66e2
|
@ -13,6 +13,7 @@ option(FORCE_SSE "Compile with SSE instruction only" OFF)
|
||||||
option(FORCE_SSSE3 "Compile with SSSE3 instruction only" OFF)
|
option(FORCE_SSSE3 "Compile with SSSE3 instruction only" OFF)
|
||||||
option(FORCE_SSE41 "Compile with SSE4.1 instruction only" OFF)
|
option(FORCE_SSE41 "Compile with SSE4.1 instruction only" OFF)
|
||||||
option(OPTIONAL_TEST "Compile optional test (might be broken)" OFF)
|
option(OPTIONAL_TEST "Compile optional test (might be broken)" OFF)
|
||||||
|
# UNITTEST option must be after CMAKE_BUILT_TYPE
|
||||||
|
|
||||||
# where cmake find custom modules
|
# where cmake find custom modules
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
||||||
|
@ -88,6 +89,13 @@ endif()
|
||||||
message(STATUS "Build type set to: ${CMAKE_BUILD_TYPE}")
|
message(STATUS "Build type set to: ${CMAKE_BUILD_TYPE}")
|
||||||
message("CMake system: ${CMAKE_SYSTEM_NAME}")
|
message("CMake system: ${CMAKE_SYSTEM_NAME}")
|
||||||
|
|
||||||
|
# Unittest should be on for dev builds and off for releases.
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||||
|
option(UNITTEST "Build unittest binaries." OFF)
|
||||||
|
else()
|
||||||
|
option(UNITTEST "Build unittest binaries." ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
# set compiler
|
# set compiler
|
||||||
include(FindCompiler)
|
include(FindCompiler)
|
||||||
|
|
||||||
|
@ -202,9 +210,12 @@ add_subdirectory(${CUSTOM_MISC_DIR})
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
# ctest
|
# ctest
|
||||||
|
if(UNITTEST)
|
||||||
|
message(STATUS "Build unit test binaries")
|
||||||
include(CTest)
|
include(CTest)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
|
endif(UNITTEST)
|
||||||
|
|
||||||
# manage scripts
|
# manage scripts
|
||||||
add_subdirectory(scripts)
|
add_subdirectory(scripts)
|
||||||
|
|
Loading…
Reference in New Issue