default to BUILD_TESTING=ON if the engine is built as a root project

This commit is contained in:
Green Sky 2021-12-01 15:36:08 +01:00
parent ec98df52d7
commit b0e065e2ef
2 changed files with 6 additions and 5 deletions

View File

@ -19,6 +19,12 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# enable test
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)
#enable_testing()
endif()
include("${CMAKE_CURRENT_LIST_DIR}/mm_options_and_defines.cmake")
# external libs
@ -47,10 +53,6 @@ elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
endif()
endif()
if (BUILD_TESTING)
enable_testing()
endif()
# cmake setup end
# MM code

View File

@ -25,4 +25,3 @@ if(BUILD_TESTING)
add_subdirectory(test)
endif()