Skip to content

Commit

Permalink
ECMGeneratePriFile.cmake - restore "Fix issues with pri file"
Browse files Browse the repository at this point in the history
commit b81c32b
Author: Jacob Young <[email protected]>
Date:   Mon Dec 28 20:46:28 2020 -0500
  • Loading branch information
winterz committed Nov 24, 2021
1 parent fc172b6 commit 07a135a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmake/ECM/modules/ECMGeneratePriFile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,15 @@ function(ECM_GENERATE_PRI_FILE)
else()
set(PRI_TARGET_LIBS "${BASEPATH}/${EGPF_LIB_INSTALL_DIR}")
endif()
set(PRI_TARGET_DEFINES "")

set(PRI_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/qt_${PRI_TARGET_BASENAME}.pri)
if (EGPF_FILENAME_VAR)
set(${EGPF_FILENAME_VAR} ${PRI_FILENAME} PARENT_SCOPE)
endif()

set(PRI_TARGET_MODULE_CONFIG "")
set(PRI_TARGET_DEFINES "")
set(PRI_TARGET_POSTFIX "")
# backward compat: it was not obvious LIB_NAME needs to be a target name,
# and some projects where the target name was not the actual library output name
# passed the output name for LIB_NAME, so .name & .module prperties are correctly set.
Expand All @@ -220,6 +221,10 @@ function(ECM_GENERATE_PRI_FILE)
if (target_type STREQUAL "STATIC_LIBRARY")
set(PRI_TARGET_MODULE_CONFIG "staticlib")
endif()
get_target_property(target_defs ${EGPF_LIB_NAME} INTERFACE_COMPILE_DEFINITIONS)
list(FILTER target_defs EXCLUDE REGEX ^QT_)
string(JOIN " " PRI_TARGET_DEFINES "${target_defs}")
set(PRI_TARGET_POSTFIX "$<TARGET_PROPERTY:${EGPF_LIB_NAME},$<UPPER_CASE:$<CONFIG>$<$<CONFIG:>:Debug>>_POSTFIX>")
endif()

file(GENERATE
Expand All @@ -230,8 +235,8 @@ QT.${PRI_TARGET_BASENAME}.MAJOR_VERSION = ${PRI_VERSION_MAJOR}
QT.${PRI_TARGET_BASENAME}.MINOR_VERSION = ${PRI_VERSION_MINOR}
QT.${PRI_TARGET_BASENAME}.PATCH_VERSION = ${PRI_VERSION_PATCH}
QT.${PRI_TARGET_BASENAME}.name = ${PRI_TARGET_LIBNAME}
QT.${PRI_TARGET_BASENAME}.module = ${PRI_TARGET_LIBNAME}
QT.${PRI_TARGET_BASENAME}.defines = ${PRI_TARGET_DEFINES}
QT.${PRI_TARGET_BASENAME}.module = ${PRI_TARGET_LIBNAME}${PRI_TARGET_POSTFIX}
QT.${PRI_TARGET_BASENAME}.DEFINES = ${PRI_TARGET_DEFINES}
QT.${PRI_TARGET_BASENAME}.includes = ${PRI_TARGET_INCLUDES}
QT.${PRI_TARGET_BASENAME}.private_includes =
QT.${PRI_TARGET_BASENAME}.libs = ${PRI_TARGET_LIBS}
Expand Down

0 comments on commit 07a135a

Please sign in to comment.