diff options
| author | Friedrich W. H. Kossebau <kossebau@kde.org> | 2020-02-08 23:19:21 +0100 | 
|---|---|---|
| committer | Friedrich W. H. Kossebau <kossebau@kde.org> | 2020-02-08 23:19:21 +0100 | 
| commit | a8c3ab79912fcb25d7e59a04c08752a9252a5f08 (patch) | |
| tree | 7e42b76ae1c791d27f81661c9dded98607d73df5 | |
| parent | fafbc8cec665edf3b207162ceee87914d2beff0a (diff) | |
| download | extra-cmake-modules-a8c3ab79912fcb25d7e59a04c08752a9252a5f08.tar.gz extra-cmake-modules-a8c3ab79912fcb25d7e59a04c08752a9252a5f08.tar.bz2 | |
ECMGeneratePriFile: unbreak for usages with LIB_NAME not a target name
| -rw-r--r-- | modules/ECMGeneratePriFile.cmake | 12 | 
1 files changed, 9 insertions, 3 deletions
| diff --git a/modules/ECMGeneratePriFile.cmake b/modules/ECMGeneratePriFile.cmake index 71ab9b94..037b78a8 100644 --- a/modules/ECMGeneratePriFile.cmake +++ b/modules/ECMGeneratePriFile.cmake @@ -180,9 +180,15 @@ function(ECM_GENERATE_PRI_FILE)    endif()    set(PRI_TARGET_MODULE_CONFIG "") -  get_target_property(target_type ${EGPF_LIB_NAME} TYPE) -  if (target_type STREQUAL "STATIC_LIBRARY") -      set(PRI_TARGET_MODULE_CONFIG "staticlib") +  # 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. +  # TODO: improve API dox, allow control over module name if target name != output name +  if(TARGET ${EGPF_LIB_NAME}) +    get_target_property(target_type ${EGPF_LIB_NAME} TYPE) +    if (target_type STREQUAL "STATIC_LIBRARY") +        set(PRI_TARGET_MODULE_CONFIG "staticlib") +    endif()    endif()    file(GENERATE | 
