FIXed CMake build:generic ALIAS targets were defined incorrectly

This commit is contained in:
jkriege2 2024-01-22 22:09:55 +01:00
parent ab8ab57681
commit 397d2bee9a
6 changed files with 6 additions and 5 deletions

View File

@ -101,6 +101,7 @@ function(jkqtplotter_installlibrary_new lib_name libIncludeSubdir libSrcDir)
)
# generate ...Config.cmake
set(JKQTP_CURRENT_TARGET_FILENAME "${lib_name}Targets.cmake")
set(libBasename "${libIncludeSubdir}")
configure_file(${libSrcDir}/LibTarget.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Config.cmake" @ONLY)
# install export files
install(EXPORT ${lib_name}_TARGETS

View File

@ -13,5 +13,5 @@ find_package(Qt@QT_VERSION_MAJOR@ COMPONENTS Core Gui Widgets Xml REQUIRED)
include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@")
if(NOT TARGET JKQTPlotter::@libBasename@)
add_library(JKQTPlotter::@libBasename@ ALIAS JKQTPlotter@QT_VERSION_MAJOR@@libBasename@
add_library(JKQTPlotter::@libBasename@ ALIAS JKQTPlotter@QT_VERSION_MAJOR@::@lib_name@
endif()

View File

@ -17,5 +17,5 @@ find_package(JKQTCommon@jkqtplotter_LIBNAME_VERSION_PART@ REQUIRED PATHS ${CMAKE
include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@")
if(NOT TARGET JKQTPlotter::@libBasename@)
add_library(JKQTPlotter::@libBasename@ ALIAS JKQTPlotter@QT_VERSION_MAJOR@@libBasename@
add_library(JKQTPlotter::@libBasename@ ALIAS JKQTPlotter@QT_VERSION_MAJOR@::@lib_name@
endif()

View File

@ -15,5 +15,5 @@ include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@")
if(NOT TARGET JKQTPlotter::@libBasename@)
add_library(JKQTPlotter::@libBasename@ ALIAS JKQTPlotter@QT_VERSION_MAJOR@@libBasename@
add_library(JKQTPlotter::@libBasename@ ALIAS JKQTPlotter@QT_VERSION_MAJOR@::@lib_name@
endif()

View File

@ -16,5 +16,5 @@ include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@")
if(NOT TARGET JKQTPlotter::@libBasename@)
add_library(JKQTPlotter::@libBasename@ ALIAS JKQTPlotter@QT_VERSION_MAJOR@@libBasename@
add_library(JKQTPlotter::@libBasename@ ALIAS JKQTPlotter@QT_VERSION_MAJOR@::@lib_name@
endif()

View File

@ -16,5 +16,5 @@ include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@")
if(NOT TARGET JKQTPlotter::@libBasename@)
add_library(JKQTPlotter::@libBasename@ ALIAS JKQTPlotter@QT_VERSION_MAJOR@@libBasename@
add_library(JKQTPlotter::@libBasename@ ALIAS JKQTPlotter@QT_VERSION_MAJOR@::@lib_name@
endif()