summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-10-24 15:20:27 +0200
committerTobias Hunger <tobias.hunger@qt.io>2018-11-01 11:48:46 +0000
commite9c45bbdddd4df005bdaa5eea9740d351e6eaea2 (patch)
tree23765d4650f8f349d1f32e0fe4b1bc678cae7568 /src/CMakeLists.txt
parent345e6b0213b1273b698163064f80d33bc7ce64a9 (diff)
Begin port of qtbase to CMake
Done-by: Alexandru Croitor <alexandru.croitor@qt.io> Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-by: Kevin Funk <kevin.funk@kdab.com> Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Done-by: Simon Hausmann <simon.hausmann@qt.io> Done-by: Tobias Hunger <tobias.hunger@qt.io> Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-by: Volker Krause <volker.krause@kdab.com> Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000000..204d7f6797
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,65 @@
+add_subdirectory(3rdparty)
+
+function(find_or_build_bootstrap_names)
+ # Move these into their own folder and move this code in the CMakeLists.txt file there!
+ set01(_build_tools "x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x")
+
+ function(find_or_build_bootstrap_tool name)
+ if (_build_tools)
+ add_subdirectory(tools/${name})
+ else()
+ message("Searching for ${name}.")
+ find_program("_PROG_${name}" "${name}" PATHS "${HOST_QT_TOOLS_DIRECTORY}" NO_DEFAULT_PATH)
+ if (_PROG_${name} STREQUAL "_PROG_${name}-NOTFOUND")
+ message(FATAL_ERROR "The name \"${name}\" was not found in the "
+ "HOST_QT_TOOLS_DIRECTORY (\"${HOST_QT_TOOLS_DIRECTORY}\").")
+ else()
+ message("${name} was found at ${_PROG_${name}}.")
+ add_executable("${name}" IMPORTED GLOBAL)
+ set_target_properties("${name}" PROPERTIES IMPORTED_LOCATION "${_PROG_${name}}")
+
+ add_executable("Qt::${name}" ALIAS "${name}")
+ endif()
+ endif()
+ endfunction()
+
+ find_or_build_bootstrap_tool(qmocscanner)
+ if (_build_tools)
+ add_subdirectory(tools/bootstrap) # bootstrap library
+ endif()
+ find_or_build_bootstrap_tool(moc)
+ find_or_build_bootstrap_tool(rcc)
+ find_or_build_bootstrap_tool(qfloat16-tables)
+ find_or_build_bootstrap_tool(tracegen)
+
+ # $<TARGET_FILE:Qt::qmocscanner> does not work during configure run, so export into a plain variable:
+ get_target_property(_mocscanner "Qt::qmocscanner" IMPORTED_LOCATION)
+ set(QT_MOCSCANNER "${_mocscanner}" CACHE INTERNAL "Qt moc scanner")
+
+ if (_build_tools)
+ install(EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" NAMESPACE "Qt::" DESTINATION "${INSTALL_LIBDIR}/cmake/Qt${PROJECT_VERSION_MAJOR}")
+ endif()
+endfunction()
+
+find_or_build_bootstrap_names()
+
+add_subdirectory(corelib)
+add_subdirectory(tools)
+add_subdirectory(network)
+add_subdirectory(xml)
+add_subdirectory(dbus)
+if(QT_FEATURE_gui)
+ add_subdirectory(gui)
+
+ qt_pull_features_into_current_scope(PUBLIC_FEATURES Qt::Gui)
+ if(QT_FEATURE_widgets)
+ add_subdirectory(widgets)
+ if(QT_FEATURE_opengl)
+ add_subdirectory(opengl)
+ endif()
+ endif()
+ add_subdirectory(platformsupport)
+ add_subdirectory(platformheaders)
+endif()
+add_subdirectory(testlib)
+add_subdirectory(plugins)