mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 00:00:39 -05:00
050f891d81
Since it can be set in the environment when running the test suite, guard tests which are sensitive to intermediate directory strategy changes with explicit settings.
26 lines
625 B
CMake
26 lines
625 B
CMake
set(CMAKE_INTERMEDIATE_DIR_STRATEGY FULL CACHE STRING "" FORCE)
|
|
|
|
enable_language(C)
|
|
|
|
add_library(foo foo.c)
|
|
target_include_directories(foo PUBLIC include)
|
|
target_precompile_headers(foo PUBLIC
|
|
include/foo.h
|
|
\"foo2.h\"
|
|
<stdio.h>
|
|
\"string.h\"
|
|
)
|
|
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
|
set_property(SOURCE foo.c APPEND PROPERTY COMPILE_OPTIONS "-WX-")
|
|
endif()
|
|
|
|
add_library(bar INTERFACE)
|
|
target_include_directories(bar INTERFACE include)
|
|
target_precompile_headers(bar INTERFACE include/bar.h)
|
|
|
|
add_executable(foobar foobar.c)
|
|
target_link_libraries(foobar foo bar)
|
|
|
|
enable_testing()
|
|
add_test(NAME foobar COMMAND foobar)
|