diff --git a/nel/3rdparty/seven_zip/CMakeLists.txt b/nel/3rdparty/seven_zip/CMakeLists.txt index 495b99a633..b9ad2733f2 100644 --- a/nel/3rdparty/seven_zip/CMakeLists.txt +++ b/nel/3rdparty/seven_zip/CMakeLists.txt @@ -15,7 +15,7 @@ NL_ADD_LIB_SUFFIX(nel_sevenzip) TARGET_COMPILE_DEFINITIONS(nel_sevenzip PUBLIC _7ZIP_ST) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nel_sevenzip LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nel_sevenzip EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() IF(WITH_NEL_TOOLS) diff --git a/nel/CMakeLists.txt b/nel/CMakeLists.txt index 3487cebbc9..9d6bfdeb9a 100644 --- a/nel/CMakeLists.txt +++ b/nel/CMakeLists.txt @@ -6,6 +6,7 @@ ENDIF () project(NeL VERSION ${RyzomCore_VERSION} LANGUAGES CXX C) +set(project_export_name "${PROJECT_NAME}-targets") include(../cmake/add_library_alias.cmake) IF(WITH_STATIC_DRIVERS) @@ -94,15 +95,8 @@ set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake") set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake") set(package_components 3d georges ligo misc net pacs sevenzip sound snd_lowlevel) -set(targets_export_name "${PROJECT_NAME}-targets") -install(TARGETS nel3d nelgeorges nelligo nelmisc nelnet nelpacs nel_sevenzip nelsound nelsnd_lowlevel - COMPONENT libraries - EXPORT "${targets_export_name}" - FILE_SET HEADERS -) - -install(EXPORT "${targets_export_name}" +install(EXPORT "${project_export_name}" COMPONENT libraries NAMESPACE "${project_namespace}::" DESTINATION "${config_install_dir}" diff --git a/nel/src/3d/CMakeLists.txt b/nel/src/3d/CMakeLists.txt index e09db108ee..f82302e324 100644 --- a/nel/src/3d/CMakeLists.txt +++ b/nel/src/3d/CMakeLists.txt @@ -736,7 +736,7 @@ ENDIF() NL_GEN_PC(nel-3d.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nel3d LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nel3d EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() ADD_SUBDIRECTORY(driver) diff --git a/nel/src/3d/driver/direct3d/CMakeLists.txt b/nel/src/3d/driver/direct3d/CMakeLists.txt index f3423f6fbe..175d9addaf 100644 --- a/nel/src/3d/driver/direct3d/CMakeLists.txt +++ b/nel/src/3d/driver/direct3d/CMakeLists.txt @@ -17,7 +17,7 @@ IF(WITH_PCH) ENDIF() IF(WITH_INSTALL_LIBRARIES OR NOT WITH_STATIC_DRIVERS) - INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d) + INSTALL(TARGETS nel_drv_direct3d_win EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_direct3d_win RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF() diff --git a/nel/src/3d/driver/opengl/CMakeLists.txt b/nel/src/3d/driver/opengl/CMakeLists.txt index d9b46e0d9d..d015e2d96a 100644 --- a/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/nel/src/3d/driver/opengl/CMakeLists.txt @@ -96,7 +96,7 @@ IF(WITH_PCH) ENDIF() IF(WITH_INSTALL_LIBRARIES OR NOT WITH_STATIC_DRIVERS) - INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d) + INSTALL(TARGETS ${NLDRV_OGL_LIB} EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF() diff --git a/nel/src/3d/driver/opengles/CMakeLists.txt b/nel/src/3d/driver/opengles/CMakeLists.txt index 2cdeb8e684..560d8b3b58 100644 --- a/nel/src/3d/driver/opengles/CMakeLists.txt +++ b/nel/src/3d/driver/opengles/CMakeLists.txt @@ -75,7 +75,7 @@ IF(WITH_PCH) ENDIF() IF(WITH_INSTALL_LIBRARIES OR NOT WITH_STATIC_DRIVERS) - INSTALL(TARGETS ${NLDRV_OGLES_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d) + INSTALL(TARGETS ${NLDRV_OGLES_LIB} EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS ${NLDRV_OGLES_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF() diff --git a/nel/src/georges/CMakeLists.txt b/nel/src/georges/CMakeLists.txt index b5dfe00e27..8747d8a4ed 100644 --- a/nel/src/georges/CMakeLists.txt +++ b/nel/src/georges/CMakeLists.txt @@ -23,5 +23,5 @@ ENDIF() NL_GEN_PC(nel-georges.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelgeorges LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nelgeorges EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() diff --git a/nel/src/gui/CMakeLists.txt b/nel/src/gui/CMakeLists.txt index ef639688bd..5a961846c5 100644 --- a/nel/src/gui/CMakeLists.txt +++ b/nel/src/gui/CMakeLists.txt @@ -22,5 +22,5 @@ IF(WITH_PCH) ENDIF() IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelgui LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nelgui EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() diff --git a/nel/src/ligo/CMakeLists.txt b/nel/src/ligo/CMakeLists.txt index 3409f4f896..0c10d3c741 100644 --- a/nel/src/ligo/CMakeLists.txt +++ b/nel/src/ligo/CMakeLists.txt @@ -21,5 +21,5 @@ ENDIF() NL_GEN_PC(nel-ligo.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelligo LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nelligo EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() diff --git a/nel/src/logic/CMakeLists.txt b/nel/src/logic/CMakeLists.txt index 76f2b42caf..89adccf798 100644 --- a/nel/src/logic/CMakeLists.txt +++ b/nel/src/logic/CMakeLists.txt @@ -19,5 +19,5 @@ IF(WITH_PCH) ENDIF() IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nellogic LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nellogic EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() diff --git a/nel/src/misc/CMakeLists.txt b/nel/src/misc/CMakeLists.txt index 9fc906f3df..22800e495a 100644 --- a/nel/src/misc/CMakeLists.txt +++ b/nel/src/misc/CMakeLists.txt @@ -259,5 +259,11 @@ ENDIF() NL_GEN_PC(nel-misc.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelmisc LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nelmisc + EXPORT "${project_export_name}" + COMPONENT libraries + LIBRARY DESTINATION ${NL_LIB_PREFIX} + ARCHIVE DESTINATION ${NL_LIB_PREFIX} + FILE_SET HEADERS + ) ENDIF() diff --git a/nel/src/net/CMakeLists.txt b/nel/src/net/CMakeLists.txt index df079fefeb..d0f30b2480 100644 --- a/nel/src/net/CMakeLists.txt +++ b/nel/src/net/CMakeLists.txt @@ -26,5 +26,5 @@ ENDIF() NL_GEN_PC(nel-net.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelnet LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nelnet EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() diff --git a/nel/src/pacs/CMakeLists.txt b/nel/src/pacs/CMakeLists.txt index 8e71b442c3..0656fc443c 100644 --- a/nel/src/pacs/CMakeLists.txt +++ b/nel/src/pacs/CMakeLists.txt @@ -21,5 +21,5 @@ ENDIF() NL_GEN_PC(nel-pacs.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelpacs LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nelpacs EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() diff --git a/nel/src/pipeline/CMakeLists.txt b/nel/src/pipeline/CMakeLists.txt index e4562d76b5..61ab0473d1 100644 --- a/nel/src/pipeline/CMakeLists.txt +++ b/nel/src/pipeline/CMakeLists.txt @@ -15,5 +15,5 @@ NL_ADD_RUNTIME_FLAGS(nelpipeline) NL_ADD_LIB_SUFFIX(nelpipeline) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelpipeline LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nelpipeline EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() diff --git a/nel/src/sound/CMakeLists.txt b/nel/src/sound/CMakeLists.txt index d6fb9d7c9a..398496bb26 100644 --- a/nel/src/sound/CMakeLists.txt +++ b/nel/src/sound/CMakeLists.txt @@ -144,7 +144,7 @@ ENDIF() NL_GEN_PC(nel-sound.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelsound LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nelsound EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() ADD_SUBDIRECTORY(driver) diff --git a/nel/src/sound/driver/CMakeLists.txt b/nel/src/sound/driver/CMakeLists.txt index b1c2050ec9..7afc627ad9 100644 --- a/nel/src/sound/driver/CMakeLists.txt +++ b/nel/src/sound/driver/CMakeLists.txt @@ -16,7 +16,7 @@ IF(WITH_PCH) ENDIF() IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelsnd_lowlevel LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nelsnd_lowlevel EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF() IF(WITH_DRIVER_OPENAL) diff --git a/nel/src/web/CMakeLists.txt b/nel/src/web/CMakeLists.txt index 9190431f06..6c9cd38e76 100644 --- a/nel/src/web/CMakeLists.txt +++ b/nel/src/web/CMakeLists.txt @@ -25,5 +25,5 @@ ENDIF() NL_GEN_PC(nel-web.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelweb LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) + INSTALL(TARGETS nelweb EXPORT "${project_export_name}" LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF()