diff options
author | Felix Lelchuk <felix.lelchuk@gmx.de> | 2021-08-21 11:52:49 (GMT) |
---|---|---|
committer | Felix Lelchuk <felix.lelchuk@gmx.de> | 2021-08-24 17:21:40 (GMT) |
commit | 047d46ebdbb87f0388fa1627a3c39810e0b08c69 (patch) | |
tree | c81e2f73673755c7400cdaf6e70d0d93451d5dcf /Tests/InstallMode/subpro_b_shared_lib/CMakeLists.txt | |
parent | f64e8036aa1498edc34b1624df9dc8633467e7ef (diff) | |
download | CMake-047d46ebdbb87f0388fa1627a3c39810e0b08c69.zip CMake-047d46ebdbb87f0388fa1627a3c39810e0b08c69.tar.gz CMake-047d46ebdbb87f0388fa1627a3c39810e0b08c69.tar.bz2 |
Fix: InstallMode tests fail on some platforms
1) The ExternalProject_Add() command was called with
UPDATE_COMMAND ";" which was not noticable on most platforms
2) On AIX/GCC, the executable did not link because symbols from
imported libraries were assumed extern "C" (see commit 4fc47424)
Diffstat (limited to 'Tests/InstallMode/subpro_b_shared_lib/CMakeLists.txt')
-rw-r--r-- | Tests/InstallMode/subpro_b_shared_lib/CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Tests/InstallMode/subpro_b_shared_lib/CMakeLists.txt b/Tests/InstallMode/subpro_b_shared_lib/CMakeLists.txt index eb118c9..b3d9cb2 100644 --- a/Tests/InstallMode/subpro_b_shared_lib/CMakeLists.txt +++ b/Tests/InstallMode/subpro_b_shared_lib/CMakeLists.txt @@ -4,12 +4,18 @@ cmake_minimum_required(VERSION 3.20) project(shared_lib_project VERSION 2.3.4 LANGUAGES CXX) include(GNUInstallDirs) +include(GenerateExportHeader) add_library(the_shared_lib SHARED "include/shared_lib.h" "src/shared_lib.cpp" ) +generate_export_header(the_shared_lib + BASE_NAME shared_lib + EXPORT_FILE_NAME include/shared_lib_export.h +) + set_target_properties(the_shared_lib PROPERTIES VERSION "${PROJECT_VERSION}" @@ -18,11 +24,14 @@ set_target_properties(the_shared_lib target_include_directories(the_shared_lib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> ) install( - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" + DIRECTORY + "${CMAKE_CURRENT_SOURCE_DIR}/include/" + "${CMAKE_CURRENT_BINARY_DIR}/include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) |