Skip to content

Commit

Permalink
Merge pull request #4173 from neobrain/fix_ctest_list
Browse files Browse the repository at this point in the history
CMake: Generate test list even when testing is disabled
  • Loading branch information
Sonicadvance1 authored Nov 27, 2024
2 parents f41b9bc + 56947f3 commit ee592ba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,13 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/Config.h.in
${CMAKE_BINARY_DIR}/generated/ConfigDefines.h)

include(CTest)
if (BUILD_TESTS)
include(CTest)
enable_testing()
message(STATUS "Unit tests are enabled")
if (NOT BUILD_TESTING)
# CMake checks this variable before generating CTestTestfile.cmake
message(SEND_ERROR "Unit tests require BUILD_TESTING to be enabled")
endif()

set (TEST_JOB_COUNT "" CACHE STRING "Override number of parallel jobs to use while running tests")
if (TEST_JOB_COUNT)
Expand Down

0 comments on commit ee592ba

Please sign in to comment.