diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-08-15 13:09:55 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-08-15 16:53:19 +0200 |
commit | c7ec7cd2a1ae9bec31113fae1f1e549b2bf98e0b (patch) | |
tree | fc81fba4e7815ea061da277cf3bcf3102866932f /mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | |
parent | 7947032e2d1d68b2c0f79874db7adcf560851f29 (diff) | |
parent | 6132260da394a9627947f0fe6a279c20863b6ad2 (diff) |
Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
Diffstat (limited to 'mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in')
-rw-r--r-- | mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 59 |
1 files changed, 44 insertions, 15 deletions
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index ba7d9575c0..d4fd057682 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -75,7 +75,7 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura # Handle normal libraries passed as -lfoo set(_lib \"${CMAKE_MATCH_1}\") foreach(_standard_library ${_standard_libraries}) - if(_standard_library MATCHES \"^${_lib}(\\.lib)?$\") + if(_standard_library MATCHES \"^${_lib}(\\\\.lib)?$\") set(_lib_is_default_linked TRUE) break() endif() @@ -119,7 +119,8 @@ endfunction() !!ENDIF !!IF !equals(TEMPLATE, aux) -macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION) +macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION + IsDebugAndRelease) set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) @@ -130,24 +131,48 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location}) set(_deps ${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES} + ) + set(_static_deps !!IF !isEmpty(CMAKE_STATIC_TYPE) ${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES} !!ENDIF ) + set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES - \"INTERFACE_LINK_LIBRARIES\" \"${_deps}\" \"IMPORTED_LOCATION_${Configuration}\" ${imported_location} !!IF !isEmpty(CMAKE_LIB_SONAME) \"IMPORTED_SONAME_${Configuration}\" \"$${CMAKE_LIB_SONAME}\" !!ENDIF # For backward compatibility with CMake < 2.8.12 - \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_deps}\" + \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_deps};${_static_deps}\" + ) + set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES + \"${_deps}\" ) + !!IF !isEmpty(CMAKE_STATIC_TYPE) + if(NOT "${IsDebugAndRelease}") + set(_genex_condition \"1\") + else() + if("${Configuration}" STREQUAL "DEBUG") + set(_genex_condition \"$<CONFIG:Debug>\") + else() + set(_genex_condition \"$<NOT:$<CONFIG:Debug>>\") + endif() + endif() - if(NOT CMAKE_VERSION VERSION_LESS \"3.13\") - set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES - \"INTERFACE_LINK_OPTIONS\" \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LINK_FLAGS}\" + if(_static_deps) + set(_static_deps_genex \"$<${_genex_condition}:${_static_deps}>\") + set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES + \"${_static_deps_genex}\" + ) + endif() + + set(_static_link_flags \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LINK_FLAGS}\") + if(NOT CMAKE_VERSION VERSION_LESS \"3.13\" AND _static_link_flags) + set(_static_link_flags_genex \"$<${_genex_condition}:${_static_link_flags}>\") + set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_OPTIONS + \"${_static_link_flags_genex}\" ) endif() !!ENDIF @@ -382,9 +407,9 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !equals(TEMPLATE, aux) !!IF !isEmpty(CMAKE_RELEASE_TYPE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" $${CMAKE_DEBUG_AND_RELEASE}) !!ELSE - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE}) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) @@ -395,7 +420,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" $${CMAKE_DEBUG_AND_RELEASE}) !!ELSE // CMAKE_STATIC_WINDOWS_BUILD if (EXISTS !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) @@ -409,7 +434,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ELSE \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ENDIF - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE}) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD endif() !!ENDIF // CMAKE_DEBUG_TYPE @@ -419,9 +444,9 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !isEmpty(CMAKE_DEBUG_TYPE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" $${CMAKE_DEBUG_AND_RELEASE}) !!ELSE - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE}) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) @@ -432,7 +457,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" $${CMAKE_DEBUG_AND_RELEASE}) !!ELSE // CMAKE_STATIC_WINDOWS_BUILD if (EXISTS !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) @@ -446,7 +471,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ELSE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ENDIF - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE}) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD endif() !!ENDIF // CMAKE_RELEASE_TYPE @@ -459,6 +484,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) ) !!ENDIF // TEMPLATE != aux +!!IF isEmpty(CMAKE_INTERNAL_MODULE) + file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\") macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION) @@ -481,6 +508,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) endforeach() endif() +!!ENDIF // isEmpty(CMAKE_INTERNAL_MODULE) + !!IF !isEmpty(CMAKE_MODULE_EXTRAS) include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\") |