| 1 |
cmake_minimum_required(VERSION 3.26) |
| 2 |
project(GlobalAutogenSystemUseInclude) |
| 3 |
|
| 4 |
include("../AutogenCoreTest.cmake") |
| 5 |
|
| 6 |
block() |
| 7 |
set(test_autogen_use_system_include ON) |
| 8 |
set(CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE ${test_autogen_use_system_include}) |
| 9 |
|
| 10 |
add_executable(autogen_test_on main.cpp) |
| 11 |
get_target_property(target_autogen_use_system_include autogen_test_on AUTOGEN_USE_SYSTEM_INCLUDE) |
| 12 |
|
| 13 |
if(NOT ${CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE} STREQUAL ${target_autogen_use_system_include}) |
| 14 |
message(FATAL_ERROR "CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE not set") |
| 15 |
endif() |
| 16 |
endblock() |
| 17 |
|
| 18 |
block() |
| 19 |
set(test_autogen_use_system_include OFF) |
| 20 |
set(CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE ${test_autogen_use_system_include}) |
| 21 |
|
| 22 |
add_executable(autogen_test_off main.cpp) |
| 23 |
get_target_property(target_autogen_use_system_include autogen_test_off AUTOGEN_USE_SYSTEM_INCLUDE) |
| 24 |
|
| 25 |
if(NOT ${CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE} STREQUAL ${target_autogen_use_system_include}) |
| 26 |
message(FATAL_ERROR "CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE not set") |
| 27 |
endif() |
| 28 |
endblock() |