diff options
author | Brad King <brad.king@kitware.com> | 2019-09-23 17:51:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-25 16:06:28 (GMT) |
commit | c54448e1855432de95844d4d0546bbe6d7f47c84 (patch) | |
tree | 1261a9650a2193a02473e675c2f457f2f3a9d323 /Tests/ExportImport/Export | |
parent | dcc117b9446cfc3d6c8bf191545aac8d1519abca (diff) | |
download | CMake-c54448e1855432de95844d4d0546bbe6d7f47c84.zip CMake-c54448e1855432de95844d4d0546bbe6d7f47c84.tar.gz CMake-c54448e1855432de95844d4d0546bbe6d7f47c84.tar.bz2 |
PCH: Propagate INTERFACE_PRECOMPILE_HEADERS in install(EXPORT)
This was accidentally left out of commit 0467a2f91b (PCH: add
PRECOMPILE_HEADERS to special properties, 2015-03-12). Also add a test
case for `install(EXPORT)` and `export()` propagation of precompiled
headers.
Fixes: #19741
Diffstat (limited to 'Tests/ExportImport/Export')
-rw-r--r-- | Tests/ExportImport/Export/Interface/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Tests/ExportImport/Export/Interface/pch/pch.h | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt index 22a4ef6..43b7217 100644 --- a/Tests/ExportImport/Export/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt @@ -6,6 +6,12 @@ set_property(TARGET headeronly PROPERTY INTERFACE_INCLUDE_DIRECTORIES ) set_property(TARGET headeronly PROPERTY INTERFACE_COMPILE_DEFINITIONS "HEADERONLY_DEFINE") +add_library(pch_iface INTERFACE) +target_precompile_headers(pch_iface INTERFACE + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pch/pch.h>" + "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/pch/pch.h>" + ) + include(GenerateExportHeader) add_library(sharedlib SHARED sharedlib.cpp) generate_export_header(sharedlib) @@ -45,7 +51,7 @@ set_property(TARGET cmakeonly PROPERTY custom_property CustomPropertyValue) set_property(TARGET cmakeonly PROPERTY EXPORT_PROPERTIES custom_property) install(TARGETS headeronly sharediface use_auto_type use_c_restrict source_target - cmakeonly + pch_iface cmakeonly EXPORT expInterface ) install(TARGETS sharedlib @@ -61,6 +67,10 @@ install(FILES DESTINATION include/headeronly ) install(FILES + pch/pch.h + DESTINATION include/pch +) +install(FILES sharedlib/sharedlib.h "${CMAKE_CURRENT_BINARY_DIR}/sharedlib_export.h" DESTINATION include/sharedlib diff --git a/Tests/ExportImport/Export/Interface/pch/pch.h b/Tests/ExportImport/Export/Interface/pch/pch.h new file mode 100644 index 0000000..bc50727 --- /dev/null +++ b/Tests/ExportImport/Export/Interface/pch/pch.h @@ -0,0 +1 @@ +#define PCH_PCH_H_INCLUDED |