diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2021-06-02 13:46:37 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2021-06-04 14:07:38 (GMT) |
commit | 0c3c6acaff7e59712bdfc6ef66292ccebe8c5bcb (patch) | |
tree | 11b52b405e15ae0b8ab2790a7a255fb8367ba7bc /Tests/ExportImport/Export | |
parent | 4910132d8c94ac2c08fddd3fafc79585e7423362 (diff) | |
download | CMake-0c3c6acaff7e59712bdfc6ef66292ccebe8c5bcb.zip CMake-0c3c6acaff7e59712bdfc6ef66292ccebe8c5bcb.tar.gz CMake-0c3c6acaff7e59712bdfc6ef66292ccebe8c5bcb.tar.bz2 |
Tests: Add tests for new options
Diffstat (limited to 'Tests/ExportImport/Export')
3 files changed, 56 insertions, 0 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index fa0016b..a2968d4 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -690,3 +690,5 @@ if(NOT XCODE) install(TARGETS testLibFromGeneratedSource EXPORT testLibFromGeneratedSource_Export) install(EXPORT testLibFromGeneratedSource_Export DESTINATION lib) endif() + +add_subdirectory(install-RUNTIME_DEPENDENCY_SET) diff --git a/Tests/ExportImport/Export/install-RUNTIME_DEPENDENCY_SET/CMakeLists.txt b/Tests/ExportImport/Export/install-RUNTIME_DEPENDENCY_SET/CMakeLists.txt new file mode 100644 index 0000000..f50cc1d --- /dev/null +++ b/Tests/ExportImport/Export/install-RUNTIME_DEPENDENCY_SET/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.20) + +set(CMAKE_SKIP_RPATH OFF) + +foreach(i 1 2 3 4 5 6 7 8 9 10 11 12) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dep${i}.c" +"#ifdef _WIN32 +__declspec(dllexport) +#endif + void dep${i}(void) +{ +} +") + add_library(dep${i} SHARED "${CMAKE_CURRENT_BINARY_DIR}/dep${i}.c") +endforeach() + +set_target_properties(dep9 PROPERTIES + FRAMEWORK TRUE + ) +set_target_properties(dep2 PROPERTIES + VERSION 1.2.3 + SOVERSION 1 + ) + +add_library(deplib SHARED deplib.c) +target_link_libraries(deplib PRIVATE dep1) +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set_target_properties(deplib PROPERTIES + INSTALL_RPATH "@loader_path/" + ) +endif() + +install(TARGETS dep1 dep2 dep3 dep4 dep5 dep6 dep7 dep8 dep9 dep10 dep11 dep12 deplib EXPORT install-RUNTIME_DEPENDENCY_SET + RUNTIME DESTINATION install-RUNTIME_DEPENDENCY_SET/bin + LIBRARY DESTINATION install-RUNTIME_DEPENDENCY_SET/lib + ARCHIVE DESTINATION install-RUNTIME_DEPENDENCY_SET/lib + FRAMEWORK DESTINATION install-RUNTIME_DEPENDENCY_SET/frameworks + ) +install(EXPORT install-RUNTIME_DEPENDENCY_SET + FILE targets.cmake + DESTINATION install-RUNTIME_DEPENDENCY_SET + ) diff --git a/Tests/ExportImport/Export/install-RUNTIME_DEPENDENCY_SET/deplib.c b/Tests/ExportImport/Export/install-RUNTIME_DEPENDENCY_SET/deplib.c new file mode 100644 index 0000000..e5da196 --- /dev/null +++ b/Tests/ExportImport/Export/install-RUNTIME_DEPENDENCY_SET/deplib.c @@ -0,0 +1,12 @@ +#ifdef _WIN32 +__declspec(dllimport) +#endif + extern void dep1(void); + +#ifdef _WIN32 +__declspec(dllexport) +#endif + void deplib(void) +{ + dep1(); +} |