Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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
  • Loading branch information
ra1nb0w committed Nov 12, 2019
commit 1ab26c66e22be4a34b619d71611750b2798495d2
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ option(FORCE_SSE "Compile with SSE instruction only" OFF)
option(FORCE_SSSE3 "Compile with SSSE3 instruction only" OFF)
option(FORCE_SSE41 "Compile with SSE4.1 instruction only" OFF)
option(OPTIONAL_TEST "Compile optional test (might be broken)" OFF)
# UNITTEST option must be after CMAKE_BUILT_TYPE

# where cmake find custom modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
Expand Down Expand Up @@ -88,6 +89,13 @@ endif()
message(STATUS "Build type set to: ${CMAKE_BUILD_TYPE}")
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
include(FindCompiler)

Expand Down Expand Up @@ -202,9 +210,12 @@ add_subdirectory(${CUSTOM_MISC_DIR})
add_subdirectory(src)

# ctest
include(CTest)
enable_testing()
add_subdirectory(test)
if(UNITTEST)
message(STATUS "Build unit test binaries")
include(CTest)
enable_testing()
add_subdirectory(test)
endif(UNITTEST)

# manage scripts
add_subdirectory(scripts)
Expand Down