From 4c1ff2d4e6130012416edc5f6c9a677db891f902 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Wed, 8 Jun 2022 18:37:01 +0200 Subject: [PATCH 1/3] iox-#1287 Fix DDS gateway install path Signed-off-by: Simon Hoinkis --- iceoryx_dds/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/iceoryx_dds/CMakeLists.txt b/iceoryx_dds/CMakeLists.txt index 9fd9bfb64f..101269a422 100644 --- a/iceoryx_dds/CMakeLists.txt +++ b/iceoryx_dds/CMakeLists.txt @@ -50,6 +50,7 @@ iox_add_library( NO_FIND_PACKAGE_SUPPORT TARGET iceoryx_dds NAMESPACE iceoryx_dds + PROJECT_PREFIX ${PREFIX} BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/dependencies/install/include INSTALL_INTERFACE include/${PREFIX} From e801e347615e6253958bb7ed9a73df63373d04da Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Wed, 8 Jun 2022 22:12:11 +0200 Subject: [PATCH 2/3] iox-#1287 Do setup and install only via iox_add_library and not directly Signed-off-by: Simon Hoinkis --- iceoryx_posh/CMakeLists.txt | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/iceoryx_posh/CMakeLists.txt b/iceoryx_posh/CMakeLists.txt index 35cf04083d..52737857b2 100644 --- a/iceoryx_posh/CMakeLists.txt +++ b/iceoryx_posh/CMakeLists.txt @@ -51,16 +51,8 @@ include(cmake/iceoryxversions.cmake) # ########## posh core lib ########## # -# TODO: iox-#1287 cleanup this, it sets DESTINATION_INCLUDEDIR and -# DESTINATION_CONFIGDIR which are used later in this scope -setup_package_name_and_create_files( - NAME ${PROJECT_NAME} - NAMESPACE iceoryx_posh - PROJECT_PREFIX ${PREFIX} -) iox_add_library( - NO_EXPORT TARGET iceoryx_posh # @todo iox-#590 Rename this to iceoryx_posh_core NAMESPACE iceoryx_posh # @todo iox-#590 Name of iceoryx_posh should stay to be backwards compatible # and include both iceoryx_posh_core and iceoryx_posh_runtime @@ -149,8 +141,6 @@ iox_add_library( ########## posh lib for gateway support ########## # iox_add_library( - NO_EXPORT - NO_PACKAGE_SETUP NO_FIND_PACKAGE_SUPPORT TARGET iceoryx_posh_gateway NAMESPACE iceoryx_posh @@ -168,8 +158,6 @@ iox_add_library( ########## posh roudi lib ########## # iox_add_library( - NO_EXPORT - NO_PACKAGE_SETUP NO_FIND_PACKAGE_SUPPORT TARGET iceoryx_posh_roudi NAMESPACE iceoryx_posh @@ -181,6 +169,8 @@ iox_add_library( source/capro source/roudi PRIVATE_LIBS_QNX socket + BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include + INSTALL_INTERFACE include/${PREFIX} FILES source/roudi/application/iceoryx_roudi_app.cpp source/roudi/application/roudi_app.cpp @@ -209,8 +199,6 @@ if(TOML_CONFIG) ######### posh config lib ########## # iox_add_library( - NO_EXPORT - NO_PACKAGE_SETUP NO_FIND_PACKAGE_SUPPORT TARGET iceoryx_posh_config NAMESPACE iceoryx_posh @@ -258,11 +246,6 @@ if(TOML_CONFIG) set(ROUDI_EXPORT iceoryx_posh_config iox-roudi) endif() -setup_install_directories_and_export_package( - TARGETS iceoryx_posh iceoryx_posh_roudi iceoryx_posh_gateway ${ROUDI_EXPORT} - INCLUDE_DIRECTORY include/ -) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_posh_deployment.hpp.in" "${CMAKE_BINARY_DIR}/generated/iceoryx/include/iceoryx_posh/iceoryx_posh_deployment.hpp" @ONLY) From 9624b704bf7fbe473f53f84c41d49929df583f29 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Wed, 8 Jun 2022 23:34:38 +0200 Subject: [PATCH 3/3] iox-#1287 Add missing PROJECT_PREFIX Signed-off-by: Simon Hoinkis --- iceoryx_posh/CMakeLists.txt | 42 ++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/iceoryx_posh/CMakeLists.txt b/iceoryx_posh/CMakeLists.txt index 52737857b2..168c2ea1ed 100644 --- a/iceoryx_posh/CMakeLists.txt +++ b/iceoryx_posh/CMakeLists.txt @@ -48,11 +48,33 @@ iox_make_unique_includedir() include(cmake/iceoryxversions.cmake) +########## Multiple libraries are exported, the setup and installation is done +# manually without the iox_* macros # -########## posh core lib ########## +########## set variables for library export ########## # +setup_package_name_and_create_files( + NAME ${PROJECT_NAME} + NAMESPACE iceoryx_posh + PROJECT_PREFIX ${PREFIX} +) +# +########## find_package in source tree ########## +# +set(${PROJECT_NAME}_DIR ${CMAKE_CURRENT_LIST_DIR}/cmake + CACHE FILEPATH + "${PROJECT_NAME}Config.cmake to make find_package(${PROJECT_NAME}) work in source tree!" + FORCE +) + +# +########## posh core lib ########## +# iox_add_library( + NO_EXPORT + NO_PACKAGE_SETUP + NO_FIND_PACKAGE_SUPPORT TARGET iceoryx_posh # @todo iox-#590 Rename this to iceoryx_posh_core NAMESPACE iceoryx_posh # @todo iox-#590 Name of iceoryx_posh should stay to be backwards compatible # and include both iceoryx_posh_core and iceoryx_posh_runtime @@ -141,9 +163,12 @@ iox_add_library( ########## posh lib for gateway support ########## # iox_add_library( + NO_EXPORT + NO_PACKAGE_SETUP NO_FIND_PACKAGE_SUPPORT TARGET iceoryx_posh_gateway NAMESPACE iceoryx_posh + PROJECT_PREFIX ${PREFIX} BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/generated/iceoryx/include ${CMAKE_BINARY_DIR}/dependencies/install/include @@ -158,10 +183,13 @@ iox_add_library( ########## posh roudi lib ########## # iox_add_library( + NO_EXPORT + NO_PACKAGE_SETUP NO_FIND_PACKAGE_SUPPORT TARGET iceoryx_posh_roudi NAMESPACE iceoryx_posh - PUBLIC_LIBS iceoryx_posh::iceoryx_posh + PROJECT_PREFIX ${PREFIX} + PUBLIC_LIBS iceoryx_posh::iceoryx_posh # @todo iox-#590 Only link against iceoryx_posh_core PRIVATE_LIBS iceoryx_hoofs::iceoryx_hoofs PRIVATE_INCLUDES source/runtime source/version @@ -199,9 +227,12 @@ if(TOML_CONFIG) ######### posh config lib ########## # iox_add_library( + NO_EXPORT + NO_PACKAGE_SETUP NO_FIND_PACKAGE_SUPPORT TARGET iceoryx_posh_config NAMESPACE iceoryx_posh + PROJECT_PREFIX ${PREFIX} PRIVATE_LIBS iceoryx_posh::iceoryx_posh iceoryx_hoofs::iceoryx_hoofs iceoryx_posh::iceoryx_posh_roudi @@ -256,13 +287,17 @@ install( ) # install deployment file to make posh config accessible by other packages - install( FILES cmake/IceoryxPoshDeployment.cmake DESTINATION ${DESTINATION_CONFIGDIR} ) +setup_install_directories_and_export_package( + TARGETS iceoryx_posh iceoryx_posh_roudi iceoryx_posh_gateway ${ROUDI_EXPORT} + INCLUDE_DIRECTORY include/ +) + if(ROUDI_ENVIRONMENT OR BUILD_TEST) # ######### posh roudi environment ########## @@ -271,6 +306,7 @@ if(ROUDI_ENVIRONMENT OR BUILD_TEST) STATIC TARGET iceoryx_posh_testing NAMESPACE iceoryx_posh_testing + PROJECT_PREFIX ${PREFIX} BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/testing/include INSTALL_INTERFACE include/${PREFIX} PRIVATE_LIBS iceoryx_posh::iceoryx_posh