summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-05-09 10:02:37 +0200
committerTobias Hunger <tobias.hunger@qt.io>2019-05-09 11:29:25 +0000
commit80e0c615a9b8c7498ecdfda1de5b98410ecfd0e7 (patch)
tree3d1b9f95b5924e26fbb752db8d279c8ba4951b10 /cmake/QtBuild.cmake
parentc4dd1a8fe3f412a1045e43d2e507351fc2d18fc4 (diff)
CMake: pro2cmake.py: Separate library extraction logic from writing out data
Separate the logic to find all used libraries from the code that writes out the link_library information into the CMakeLists(.gen)?.txt files. This patch will remove some "PUBLIC_LIBRARIES Qt::Core" from generated files. This is due to us handling some Qt libraries in special ways in some of our add_qt_* helpers. These special libraries were added to the LIBRARIES section, but actually they should be added to the PUBLIC_LIBRARIES section instead. Do so now, so that the newly generated files do not break things again. Change-Id: I588781087a8aecc4d879e949735671d8085f0698 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index dc52c7d72b..d9d01cd648 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -994,7 +994,8 @@ function(add_qt_executable name)
"${CMAKE_CURRENT_BINARY_DIR}"
${arg_INCLUDE_DIRECTORIES}
DEFINES ${arg_DEFINES}
- LIBRARIES ${arg_LIBRARIES} ${extra_libraries}
+ LIBRARIES ${arg_LIBRARIES}
+ PUBLIC_LIBRARIES ${extra_libraries}
DBUS_ADAPTOR_SOURCES "${arg_DBUS_ADAPTOR_SOURCES}"
DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}"
DBUS_INTERFACE_SOURCES "${arg_DBUS_INTERFACE_SOURCES}"
@@ -1038,7 +1039,8 @@ function(add_qt_test name)
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
"${arg_INCLUDE_DIRECTORIES}"
DEFINES "${arg_DEFINES}"
- LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Core ${QT_CMAKE_EXPORT_NAMESPACE}::Test ${arg_LIBRARIES}
+ PUBLIC_LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Core ${QT_CMAKE_EXPORT_NAMESPACE}::Test
+ LIBRARIES ${arg_LIBRARIES}
COMPILE_OPTIONS ${arg_COMPILE_OPTIONS}
LINK_OPTIONS ${arg_LINK_OPTIONS}
MOC_OPTIONS ${arg_MOC_OPTIONS}
@@ -1171,7 +1173,8 @@ function(add_qt_tool name)
INCLUDE_DIRECTORIES
${arg_INCLUDE_DIRECTORIES}
DEFINES ${arg_DEFINES}
- LIBRARIES ${corelib} ${arg_LIBRARIES}
+ PUBLIC_LIBRARIES ${corelib}
+ LIBRARIES ${arg_LIBRARIES}
COMPILE_OPTIONS ${arg_COMPILE_OPTIONS}
LINK_OPTIONS ${arg_LINK_OPTIONS}
MOC_OPTIONS ${arg_MOC_OPTIONS}