mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 12:03:55 -07:00
Fix PR #1600
This commit is contained in:
parent
3ebe42c400
commit
7fe60279de
7 changed files with 56 additions and 38 deletions
|
|
@ -233,27 +233,9 @@ if(WITH_ORACLE)
|
|||
SET(CPACK_INSTALL_CMAKE_PROJECTS "release/oracle.app;oracle;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
|
||||
endif()
|
||||
|
||||
if(test)
|
||||
find_package(Gtest REQUIRED)
|
||||
if(GTEST_FOUND)
|
||||
include_directories(${GTEST_INCLUDE_DIRS})
|
||||
else()
|
||||
message(STATUS "Downloading googletest")
|
||||
configure_file(gtest-CMakeLists.txt gtest-download/CMakeLists.txt)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/gtest-download )
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --build .
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/gtest-download )
|
||||
|
||||
# Add gtest directly to our build
|
||||
add_subdirectory(${CMAKE_BINARY_DIR}/gtest-src
|
||||
${CMAKE_BINARY_DIR}/gtest-build
|
||||
EXCLUDE_FROM_ALL )
|
||||
|
||||
# Add the gtest include directory, since gtest
|
||||
# doesn't add that dependency to its gtest target
|
||||
target_include_directories(gtest INTERFACE
|
||||
"${CMAKE_BINARY_DIR}/gtest-src/include" )
|
||||
endif()
|
||||
enable_testing()
|
||||
# Compile tests (default off)
|
||||
option(WITH_TESTS "build tests" OFF)
|
||||
if(WITH_TESTS)
|
||||
include(CTest)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue