diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2018-01-09 16:34:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-01-23 15:43:40 (GMT) |
commit | b1ae9aaf790757d3fa43cccbb0e935171c191fff (patch) | |
tree | 13f529b6d88beea6b21b2c59f7eee3d9c3e17204 /Tests/RunCMake/GenerateExportHeader/includeguard | |
parent | f4082b0e9b1ce139a29fba5951cec068862fe28b (diff) | |
download | CMake-b1ae9aaf790757d3fa43cccbb0e935171c191fff.zip CMake-b1ae9aaf790757d3fa43cccbb0e935171c191fff.tar.gz CMake-b1ae9aaf790757d3fa43cccbb0e935171c191fff.tar.bz2 |
GenerateExportHeader: add release notes, tests for include guard changes
Diffstat (limited to 'Tests/RunCMake/GenerateExportHeader/includeguard')
3 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenerateExportHeader/includeguard/CMakeLists.txt b/Tests/RunCMake/GenerateExportHeader/includeguard/CMakeLists.txt new file mode 100644 index 0000000..514d27b --- /dev/null +++ b/Tests/RunCMake/GenerateExportHeader/includeguard/CMakeLists.txt @@ -0,0 +1,19 @@ +set(libincludeguard_SRC libincludeguard.cpp) + +add_library(includeguard_macro ${libincludeguard_SRC}) +generate_export_header(includeguard_macro) + +set(EXPORT_HEADER includeguard_macro_export.h) +set(DEF_SYMBOL INCLUDEGUARD_MACRO_EXPORT_H) +set(NDEF_SYMBOL CUSTOM_GUARD) +configure_file(main.cpp.in main_macro.cpp) +add_executable(test_includeguard_macro ${CMAKE_CURRENT_BINARY_DIR}/main_macro.cpp) + +add_library(includeguard_custom ${libincludeguard_SRC}) +generate_export_header(includeguard_custom INCLUDE_GUARD_NAME CUSTOM_GUARD) + +set(EXPORT_HEADER includeguard_custom_export.h) +set(DEF_SYMBOL CUSTOM_GUARD) +set(NDEF_SYMBOL INCLUDEGUARD_CUSTOM_EXPORT_H) +configure_file(main.cpp.in main_custom.cpp) +add_executable(test_includeguard_custom ${CMAKE_CURRENT_BINARY_DIR}/main_custom.cpp) diff --git a/Tests/RunCMake/GenerateExportHeader/includeguard/libincludeguard.cpp b/Tests/RunCMake/GenerateExportHeader/includeguard/libincludeguard.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/GenerateExportHeader/includeguard/libincludeguard.cpp diff --git a/Tests/RunCMake/GenerateExportHeader/includeguard/main.cpp.in b/Tests/RunCMake/GenerateExportHeader/includeguard/main.cpp.in new file mode 100644 index 0000000..51bd5d9 --- /dev/null +++ b/Tests/RunCMake/GenerateExportHeader/includeguard/main.cpp.in @@ -0,0 +1,10 @@ +#include "@EXPORT_HEADER@" + +int main() +{ +#if defined(@DEF_SYMBOL@) && !defined(@NDEF_SYMBOL@) + return 0; +#else + return 1; +#endif +} |