diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-05-31 16:40:51 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-05-31 14:50:08 +0000 |
commit | 3966ab8e9f601a9315f19eea1bf24628664d79d9 (patch) | |
tree | 44d54aa28d1a8aaa3d2206d8253e2cf4cbe8c4b8 /cmake | |
parent | d53f22e2fbcd860622d4f51ab46dc821c17766a7 (diff) |
Add build type (debug) and static vs dynamic to CONFIG in qconfig.pri
Also fix the QT_BUILD_SHARED_LIBS usage. While building qtbase, it
is assigned later than the call for
qt_generate_global_config_pri_file(), so it used always choose static.
Make sure to check for BUILD_SHARED_LIBS as well.
Change-Id: I66f03e5adacc89646147fc96154bee8002b2b9cc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ff430dd119..0db99d07f1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -341,12 +341,14 @@ function(qt_generate_global_config_pri_file) get_target_property(disabled_features GlobalConfig INTERFACE_QT_DISABLED_PUBLIC_FEATURES) # configure2cmake skips the "static" feature, so emulate it here for qmake support: - if(${QT_BUILD_SHARED_LIBS}) + if(QT_BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) list(APPEND enabled_features shared) list(APPEND disabled_features static) + set(qt_build_config_type "shared") else() list(APPEND enabled_features static) list(APPEND disabled_features shared) + set(qt_build_config_type "static") endif() # configure2cmake skips the "rpath" feature, so emulate it here for qmake support: @@ -359,6 +361,16 @@ function(qt_generate_global_config_pri_file) string (REPLACE ";" " " enabled_features "${enabled_features}") string (REPLACE ";" " " disabled_features "${disabled_features}") + # Add some required CONFIG entries. + set(config_entries "") + if(CMAKE_BUILD_TYPE STREQUAL Debug) + list(APPEND config_entries "debug") + elseif(CMAKE_BUILD_TYPE STREQUAL Release) + list(APPEND config_entries "release") + endif() + list(APPEND config_entries "${qt_build_config_type}") + string (REPLACE ";" " " config_entries "${config_entries}") + file(GENERATE OUTPUT "${qconfig_pri_target_path}" CONTENT @@ -371,6 +383,7 @@ QT_MAJOR_VERSION = ${PROJECT_VERSION_MAJOR} QT_MINOR_VERSION = ${PROJECT_VERSION_MINOR} QT_PATCH_VERSION = ${PROJECT_VERSION_PATCH} CONFIG -= link_prl # we do not create prl files right now +CONFIG += ${config_entries} " ) qt_install(FILES "${qconfig_pri_target_path}" DESTINATION mkspecs) |