mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-01 13:13:53 +00:00
Fix for Windows MSVC 2017 and GoogleTest
This commit is contained in:
parent
67c4eb71e5
commit
20b7232c47
@ -80,3 +80,10 @@ BUILD_GTEST
|
||||
|
||||
set_target_properties(gtest gtest_main gmock gmock_main
|
||||
PROPERTIES FOLDER "Extern")
|
||||
|
||||
if(MSVC AND MSVC_VERSION GREATER_EQUAL 1900)
|
||||
target_compile_definitions(gtest PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
target_compile_definitions(gtest_main PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
target_compile_definitions(gmock PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
target_compile_definitions(gmock_main PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
endif()
|
||||
|
@ -55,11 +55,18 @@ target_link_libraries(link_test_2 PUBLIC CLI11 link_test_1)
|
||||
add_gtest(link_test_2)
|
||||
|
||||
# Add informational printout
|
||||
# Force this to be in a standard location so CTest can find it
|
||||
add_executable(informational informational.cpp)
|
||||
target_link_libraries(informational PUBLIC CLI11)
|
||||
set_property(TARGET informational PROPERTY
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set_target_properties(informational PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}"
|
||||
)
|
||||
|
||||
# Adding this printout to CTest
|
||||
file(WRITE "${PROJECT_BINARY_DIR}/CTestCustom.cmake"
|
||||
"set(CTEST_CUSTOM_PRE_TEST \"${CMAKE_BINARY_DIR}/informational\")"
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user