mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 20:29:49 -05:00
Autogen: Add AUTOGEN_USE_SYSTEM_INCLUDE target property
`AUTOGEN_USE_SYSTEM_INCLUDE` was added. `AUTOGEN_USE_SYSTEM_INCLUDE` is a boolean property that can be set on a target to indicate that the autogen target include directory should be added as a system include directory or normal include directory to the target.
This commit is contained in:
committed by
Brad King
parent
8ba16db163
commit
033dc7ee2f
@@ -0,0 +1,28 @@
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
project(GlobalAutogenSystemUseInclude)
|
||||
|
||||
include("../AutogenCoreTest.cmake")
|
||||
|
||||
block()
|
||||
set(test_autogen_use_system_include ON)
|
||||
set(CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE ${test_autogen_use_system_include})
|
||||
|
||||
add_executable(autogen_test_on main.cpp)
|
||||
get_target_property(target_autogen_use_system_include autogen_test_on AUTOGEN_USE_SYSTEM_INCLUDE)
|
||||
|
||||
if(NOT ${CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE} STREQUAL ${target_autogen_use_system_include})
|
||||
message(FATAL_ERROR "CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE not set")
|
||||
endif()
|
||||
endblock()
|
||||
|
||||
block()
|
||||
set(test_autogen_use_system_include OFF)
|
||||
set(CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE ${test_autogen_use_system_include})
|
||||
|
||||
add_executable(autogen_test_off main.cpp)
|
||||
get_target_property(target_autogen_use_system_include autogen_test_off AUTOGEN_USE_SYSTEM_INCLUDE)
|
||||
|
||||
if(NOT ${CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE} STREQUAL ${target_autogen_use_system_include})
|
||||
message(FATAL_ERROR "CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE not set")
|
||||
endif()
|
||||
endblock()
|
||||
@@ -0,0 +1,4 @@
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user