CMake: Qt Creator Static build support

This adds the build system feature that allows Qt Creator's libraries
and plugins to be compiled statically.

Fixes some symbol clashes when all plugins are linked into the same
executable.

Support for actually loading static plugins will be added in a separate
commit.

The feature is controlled by QTC_STATIC_BUILD which by default is OFF.

Change-Id: I1fab7953c43e42dc75619e35660029ee067106df
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Cristian Adam
2022-04-21 14:10:09 +02:00
parent 58b0a5056c
commit 88781a003f
88 changed files with 330 additions and 132 deletions

View File

@@ -61,11 +61,15 @@ set(__additional_imported_components ATSPI2_nolink) # Work around QTBUG-97023
foreach(comp IN LISTS Qt5_FIND_COMPONENTS __additional_imported_components) foreach(comp IN LISTS Qt5_FIND_COMPONENTS __additional_imported_components)
if(TARGET Qt6::${comp}) if(TARGET Qt6::${comp})
if (NOT TARGET Qt5::${comp}) if (NOT TARGET Qt5::${comp})
if (QT_BUILD_SHARED_LIBS)
set_property(TARGET Qt6::${comp} PROPERTY IMPORTED_GLOBAL TRUE) set_property(TARGET Qt6::${comp} PROPERTY IMPORTED_GLOBAL TRUE)
endif()
add_library(Qt5::${comp} ALIAS Qt6::${comp}) add_library(Qt5::${comp} ALIAS Qt6::${comp})
endif() endif()
if (TARGET Qt6::${comp}Private AND NOT TARGET Qt5::${comp}Private) if (TARGET Qt6::${comp}Private AND NOT TARGET Qt5::${comp}Private)
if (QT_BUILD_SHARED_LIBS)
set_property(TARGET Qt6::${comp}Private PROPERTY IMPORTED_GLOBAL TRUE) set_property(TARGET Qt6::${comp}Private PROPERTY IMPORTED_GLOBAL TRUE)
endif()
add_library(Qt5::${comp}Private ALIAS Qt6::${comp}Private) add_library(Qt5::${comp}Private ALIAS Qt6::${comp}Private)
endif() endif()
endif() endif()

View File

@@ -22,9 +22,7 @@ else()
endif() endif()
set(YAML_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../src/libs/3rdparty/yaml-cpp) set(YAML_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../src/libs/3rdparty/yaml-cpp)
add_qtc_library(yaml-cpp add_qtc_library(yaml-cpp
DEFINES YAML_CPP_DLL yaml_cpp_EXPORTS
INCLUDES ${YAML_SOURCE_DIR}/include INCLUDES ${YAML_SOURCE_DIR}/include
PUBLIC_DEFINES YAML_CPP_DLL
PUBLIC_INCLUDES ${YAML_SOURCE_DIR}/include PUBLIC_INCLUDES ${YAML_SOURCE_DIR}/include
PROPERTIES AUTOMOC OFF AUTOUIC OFF PROPERTIES AUTOMOC OFF AUTOUIC OFF
SOURCES SOURCES
@@ -116,6 +114,12 @@ else()
${YAML_SOURCE_DIR}/src/tag.h ${YAML_SOURCE_DIR}/src/tag.h
${YAML_SOURCE_DIR}/src/token.h ${YAML_SOURCE_DIR}/src/token.h
) )
if (NOT QTC_STATIC_BUILD)
extend_qtc_target(yaml-cpp
DEFINES yaml_cpp_EXPORTS
PUBLIC_DEFINES YAML_CPP_DLL)
endif()
if(TARGET yaml-cpp) if(TARGET yaml-cpp)
set(yaml-cpp_FOUND 1) set(yaml-cpp_FOUND 1)
set_package_properties(yaml-cpp PROPERTIES DESCRIPTION "using internal src/libs/3rdparty/yaml-cpp") set_package_properties(yaml-cpp PROPERTIES DESCRIPTION "using internal src/libs/3rdparty/yaml-cpp")

View File

@@ -44,6 +44,7 @@ option(BUILD_TESTS_BY_DEFAULT "Build tests by default. This can be used to build
option(QTC_SEPARATE_DEBUG_INFO "Extract debug information from binary files." OFF) option(QTC_SEPARATE_DEBUG_INFO "Extract debug information from binary files." OFF)
option(WITH_SCCACHE_SUPPORT "Enables support for building with SCCACHE and separate debug info with MSVC, which SCCACHE normally doesn't support." OFF) option(WITH_SCCACHE_SUPPORT "Enables support for building with SCCACHE and separate debug info with MSVC, which SCCACHE normally doesn't support." OFF)
option(WITH_CCACHE_SUPPORT "Enables support for building with CCACHE and separate debug info with MSVC, which CCACHE normally doesn't support." OFF) option(WITH_CCACHE_SUPPORT "Enables support for building with CCACHE and separate debug info with MSVC, which CCACHE normally doesn't support." OFF)
option(QTC_STATIC_BUILD "Builds libraries and plugins as static libraries" OFF)
# If we provide a list of plugins, executables, libraries, then the BUILD_<type>_BY_DEFAULT will be set to OFF # If we provide a list of plugins, executables, libraries, then the BUILD_<type>_BY_DEFAULT will be set to OFF
# and for every element we set BUILD_<type>_<elment> to ON # and for every element we set BUILD_<type>_<elment> to ON
@@ -157,7 +158,7 @@ function(add_qtc_library name)
endif() endif()
set(library_type SHARED) set(library_type SHARED)
if (_arg_STATIC) if (_arg_STATIC OR QTC_STATIC_BUILD)
set(library_type STATIC) set(library_type STATIC)
endif() endif()
if (_arg_OBJECT) if (_arg_OBJECT)
@@ -168,7 +169,12 @@ function(add_qtc_library name)
add_library(QtCreator::${name} ALIAS ${name}) add_library(QtCreator::${name} ALIAS ${name})
if (${name} MATCHES "^[^0-9-]+$") if (${name} MATCHES "^[^0-9-]+$")
string(TOUPPER "${name}_LIBRARY" EXPORT_SYMBOL) if (QTC_STATIC_BUILD)
set(export_symbol_suffix "STATIC_LIBRARY")
else()
set(export_symbol_suffix "LIBRARY")
endif()
string(TOUPPER "${name}_${export_symbol_suffix}" EXPORT_SYMBOL)
endif() endif()
if (WITH_TESTS) if (WITH_TESTS)
@@ -185,7 +191,7 @@ function(add_qtc_library name)
SOURCES ${_arg_SOURCES} SOURCES ${_arg_SOURCES}
INCLUDES ${_arg_INCLUDES} INCLUDES ${_arg_INCLUDES}
PUBLIC_INCLUDES ${_arg_PUBLIC_INCLUDES} PUBLIC_INCLUDES ${_arg_PUBLIC_INCLUDES}
DEFINES ${EXPORT_SYMBOL} ${default_defines_copy} ${_arg_DEFINES} ${TEST_DEFINES} DEFINES ${default_defines_copy} ${_arg_DEFINES} ${TEST_DEFINES}
PUBLIC_DEFINES ${_arg_PUBLIC_DEFINES} PUBLIC_DEFINES ${_arg_PUBLIC_DEFINES}
DEPENDS ${_arg_DEPENDS} ${IMPLICIT_DEPENDS} DEPENDS ${_arg_DEPENDS} ${IMPLICIT_DEPENDS}
PUBLIC_DEPENDS ${_arg_PUBLIC_DEPENDS} PUBLIC_DEPENDS ${_arg_PUBLIC_DEPENDS}
@@ -194,6 +200,12 @@ function(add_qtc_library name)
EXTRA_TRANSLATIONS ${_arg_EXTRA_TRANSLATIONS} EXTRA_TRANSLATIONS ${_arg_EXTRA_TRANSLATIONS}
) )
if (QTC_STATIC_BUILD)
extend_qtc_target(${name} PUBLIC_DEFINES ${EXPORT_SYMBOL})
else()
extend_qtc_target(${name} DEFINES ${EXPORT_SYMBOL})
endif()
# everything is different with SOURCES_PREFIX # everything is different with SOURCES_PREFIX
if (NOT _arg_SOURCES_PREFIX) if (NOT _arg_SOURCES_PREFIX)
get_filename_component(public_build_interface_dir "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE) get_filename_component(public_build_interface_dir "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
@@ -253,6 +265,7 @@ function(add_qtc_library name)
set(COMPONENT_OPTION "COMPONENT" "${_arg_COMPONENT}") set(COMPONENT_OPTION "COMPONENT" "${_arg_COMPONENT}")
endif() endif()
if (NOT QTC_STATIC_BUILD)
install(TARGETS ${name} install(TARGETS ${name}
EXPORT QtCreator EXPORT QtCreator
RUNTIME RUNTIME
@@ -272,6 +285,7 @@ function(add_qtc_library name)
COMPONENT Devel EXCLUDE_FROM_ALL COMPONENT Devel EXCLUDE_FROM_ALL
OPTIONAL OPTIONAL
) )
endif()
qtc_enable_separate_debug_info(${name} "${IDE_LIBRARY_PATH}") qtc_enable_separate_debug_info(${name} "${IDE_LIBRARY_PATH}")
@@ -279,7 +293,7 @@ function(add_qtc_library name)
qtc_enable_sanitize(${SANITIZE_FLAGS}) qtc_enable_sanitize(${SANITIZE_FLAGS})
endif() endif()
if (NAMELINK_OPTION) if (NAMELINK_OPTION AND NOT QTC_STATIC_BUILD)
install(TARGETS ${name} install(TARGETS ${name}
LIBRARY LIBRARY
DESTINATION "${IDE_LIBRARY_PATH}" DESTINATION "${IDE_LIBRARY_PATH}"
@@ -298,7 +312,7 @@ endfunction(add_qtc_library)
function(add_qtc_plugin target_name) function(add_qtc_plugin target_name)
cmake_parse_arguments(_arg cmake_parse_arguments(_arg
"SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT;SKIP_PCH" "SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT;SKIP_PCH"
"VERSION;COMPAT_VERSION;PLUGIN_JSON_IN;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT" "VERSION;COMPAT_VERSION;PLUGIN_JSON_IN;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT;PLUGIN_CLASS"
"CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;PUBLIC_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PLUGIN_TEST_DEPENDS;PROPERTIES" "CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;PUBLIC_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PLUGIN_TEST_DEPENDS;PROPERTIES"
${ARGN} ${ARGN}
) )
@@ -421,13 +435,25 @@ function(add_qtc_plugin target_name)
CONTENT "${plugin_json}") CONTENT "${plugin_json}")
endif() endif()
add_library(${target_name} SHARED ${_arg_SOURCES}) if (QTC_STATIC_BUILD)
set(library_type STATIC)
else()
set(library_type SHARED)
endif()
add_library(${target_name} ${library_type} ${_arg_SOURCES})
add_library(QtCreator::${target_name} ALIAS ${target_name}) add_library(QtCreator::${target_name} ALIAS ${target_name})
set_public_headers(${target_name} "${_arg_SOURCES}") set_public_headers(${target_name} "${_arg_SOURCES}")
update_resource_files_list("${_arg_SOURCES}")
### Generate EXPORT_SYMBOL ### Generate EXPORT_SYMBOL
string(TOUPPER "${name}_LIBRARY" EXPORT_SYMBOL) if (QTC_STATIC_BUILD)
set(export_symbol_suffix "STATIC_LIBRARY")
else()
set(export_symbol_suffix "LIBRARY")
endif()
string(TOUPPER "${name}_${export_symbol_suffix}" EXPORT_SYMBOL)
if (WITH_TESTS) if (WITH_TESTS)
set(TEST_DEFINES WITH_TESTS SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") set(TEST_DEFINES WITH_TESTS SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
@@ -440,7 +466,7 @@ function(add_qtc_plugin target_name)
extend_qtc_target(${target_name} extend_qtc_target(${target_name}
INCLUDES ${_arg_INCLUDES} INCLUDES ${_arg_INCLUDES}
PUBLIC_INCLUDES ${_arg_PUBLIC_INCLUDES} PUBLIC_INCLUDES ${_arg_PUBLIC_INCLUDES}
DEFINES ${EXPORT_SYMBOL} ${DEFAULT_DEFINES} ${_arg_DEFINES} ${TEST_DEFINES} DEFINES ${DEFAULT_DEFINES} ${_arg_DEFINES} ${TEST_DEFINES}
PUBLIC_DEFINES ${_arg_PUBLIC_DEFINES} PUBLIC_DEFINES ${_arg_PUBLIC_DEFINES}
DEPENDS ${_arg_DEPENDS} ${_DEP_PLUGINS} ${IMPLICIT_DEPENDS} DEPENDS ${_arg_DEPENDS} ${_DEP_PLUGINS} ${IMPLICIT_DEPENDS}
PUBLIC_DEPENDS ${_arg_PUBLIC_DEPENDS} PUBLIC_DEPENDS ${_arg_PUBLIC_DEPENDS}
@@ -449,6 +475,13 @@ function(add_qtc_plugin target_name)
EXTRA_TRANSLATIONS ${_arg_EXTRA_TRANSLATIONS} EXTRA_TRANSLATIONS ${_arg_EXTRA_TRANSLATIONS}
) )
if (QTC_STATIC_BUILD)
extend_qtc_target(${target_name} PUBLIC_DEFINES ${EXPORT_SYMBOL}
DEFINES QT_STATICPLUGIN)
else()
extend_qtc_target(${target_name} DEFINES ${EXPORT_SYMBOL})
endif()
get_filename_component(public_build_interface_dir "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE) get_filename_component(public_build_interface_dir "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
file(RELATIVE_PATH include_dir_relative_path ${PROJECT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/..") file(RELATIVE_PATH include_dir_relative_path ${PROJECT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_include_directories(${target_name} target_include_directories(${target_name}
@@ -471,6 +504,10 @@ function(add_qtc_plugin target_name)
set(skip_translation ON) set(skip_translation ON)
endif() endif()
if(NOT _arg_PLUGIN_CLASS)
set(_arg_PLUGIN_CLASS ${target_name}Plugin)
endif()
qtc_output_binary_dir(_output_binary_dir) qtc_output_binary_dir(_output_binary_dir)
set_target_properties(${target_name} PROPERTIES set_target_properties(${target_name} PROPERTIES
LINK_DEPENDS_NO_SHARED ON LINK_DEPENDS_NO_SHARED ON
@@ -490,6 +527,7 @@ function(add_qtc_plugin target_name)
OUTPUT_NAME "${name}" OUTPUT_NAME "${name}"
QT_SKIP_TRANSLATION "${skip_translation}" QT_SKIP_TRANSLATION "${skip_translation}"
QT_COMPILE_OPTIONS_DISABLE_WARNINGS OFF QT_COMPILE_OPTIONS_DISABLE_WARNINGS OFF
QTC_PLUGIN_CLASS_NAME ${_arg_PLUGIN_CLASS}
${_arg_PROPERTIES} ${_arg_PROPERTIES}
) )
@@ -497,7 +535,7 @@ function(add_qtc_plugin target_name)
enable_pch(${target_name}) enable_pch(${target_name})
endif() endif()
if (NOT _arg_SKIP_INSTALL) if (NOT _arg_SKIP_INSTALL AND NOT QTC_STATIC_BUILD)
if (_arg_EXPORT) if (_arg_EXPORT)
set(export QtCreator${target_name}) set(export QtCreator${target_name})
else() else()

View File

@@ -109,6 +109,7 @@ set(__QTC_PLUGINS "" CACHE INTERNAL "*** Internal ***")
set(__QTC_LIBRARIES "" CACHE INTERNAL "*** Internal ***") set(__QTC_LIBRARIES "" CACHE INTERNAL "*** Internal ***")
set(__QTC_EXECUTABLES "" CACHE INTERNAL "*** Internal ***") set(__QTC_EXECUTABLES "" CACHE INTERNAL "*** Internal ***")
set(__QTC_TESTS "" CACHE INTERNAL "*** Internal ***") set(__QTC_TESTS "" CACHE INTERNAL "*** Internal ***")
set(__QTC_RESOURCE_FILES "" CACHE INTERNAL "*** Internal ***")
# handle SCCACHE hack # handle SCCACHE hack
# SCCACHE does not work with the /Zi option, which makes each compilation write debug info # SCCACHE does not work with the /Zi option, which makes each compilation write debug info
@@ -230,6 +231,16 @@ function(set_public_headers target sources)
endforeach() endforeach()
endfunction() endfunction()
function(update_resource_files_list sources)
foreach(source IN LISTS sources)
if (source MATCHES "\.qrc$")
get_filename_component(resource_name ${source} NAME_WE)
string(REPLACE "-" "_" resource_name ${resource_name})
update_cached_list(__QTC_RESOURCE_FILES "${resource_name}")
endif()
endforeach()
endfunction()
function(set_public_includes target includes) function(set_public_includes target includes)
foreach(inc_dir IN LISTS includes) foreach(inc_dir IN LISTS includes)
if (NOT IS_ABSOLUTE ${inc_dir}) if (NOT IS_ABSOLUTE ${inc_dir})
@@ -510,6 +521,7 @@ function(extend_qtc_target target_name)
endif() endif()
set_public_headers(${target_name} "${_arg_SOURCES}") set_public_headers(${target_name} "${_arg_SOURCES}")
update_resource_files_list("${_arg_SOURCES}")
foreach(file IN LISTS _arg_EXPLICIT_MOC) foreach(file IN LISTS _arg_EXPLICIT_MOC)
set_explicit_moc(${target_name} "${file}") set_explicit_moc(${target_name} "${file}")

View File

@@ -7,8 +7,8 @@ install(TARGETS app_version EXPORT QtCreator)
add_subdirectory(libs) add_subdirectory(libs)
add_subdirectory(share) add_subdirectory(share)
add_subdirectory(shared) add_subdirectory(shared)
add_subdirectory(app)
add_subdirectory(plugins) add_subdirectory(plugins)
add_subdirectory(app)
add_subdirectory(tools) add_subdirectory(tools)
install( install(

View File

@@ -35,6 +35,39 @@ if (NOT TARGET qtcreator)
return() return()
endif() endif()
if (QTC_STATIC_BUILD)
set(plugins_to_import "")
set(source_file_content "#include <QtPlugin>\n")
foreach(plugin IN LISTS __QTC_PLUGINS)
if(TARGET ${plugin})
list(APPEND plugins_to_import "${plugin}")
# TODO ${plugin}Plugin is not correct for all plugins as the class name
get_target_property(plugin_class ${plugin} QTC_PLUGIN_CLASS_NAME)
string(APPEND source_file_content "Q_IMPORT_PLUGIN(${plugin_class})\n")
endif()
endforeach()
string(APPEND source_file_content
"struct ResourcesInitializer {\n"
" ResourcesInitializer() {\n")
foreach(resource_file IN LISTS __QTC_RESOURCE_FILES)
string(APPEND source_file_content " Q_INIT_RESOURCE(${resource_file});\n")
endforeach()
string(APPEND source_file_content
" }\n"
"} g_resources_initializer;\n")
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/plugin_imports.cpp"
CONTENT "${source_file_content}"
)
extend_qtc_target(qtcreator
DEPENDS ${plugins_to_import}
SOURCES "${CMAKE_CURRENT_BINARY_DIR}/plugin_imports.cpp"
)
endif()
if (WIN32) if (WIN32)
set(RC_APPLICATION_NAME "${IDE_DISPLAY_NAME}") set(RC_APPLICATION_NAME "${IDE_DISPLAY_NAME}")
set(RC_VERSION "${IDE_VERSION}.0") set(RC_VERSION "${IDE_VERSION}.0")

View File

@@ -1,6 +1,5 @@
add_qtc_library(3rd_cplusplus OBJECT add_qtc_library(3rd_cplusplus OBJECT
PUBLIC_DEPENDS Qt5::Core Utils PUBLIC_DEPENDS Qt5::Core Utils
DEFINES CPLUSPLUS_BUILD_LIB
SOURCES SOURCES
AST.cpp AST.h AST.cpp AST.h
ASTClone.cpp ASTClone.cpp
@@ -45,6 +44,12 @@ add_qtc_library(3rd_cplusplus OBJECT
PROPERTIES POSITION_INDEPENDENT_CODE ON PROPERTIES POSITION_INDEPENDENT_CODE ON
) )
set(export_symbol_declaration DEFINES CPLUSPLUS_BUILD_LIB)
if (QTC_STATIC_BUILD)
set(export_symbol_declaration PUBLIC_DEFINES CPLUSPLUS_BUILD_STATIC_LIB)
endif()
extend_qtc_target(3rd_cplusplus ${export_symbol_declaration})
if(TARGET 3rd_cplusplus) if(TARGET 3rd_cplusplus)
qtc_enable_release_for_debug_configuration() qtc_enable_release_for_debug_configuration()
if (BUILD_WITH_PCH) if (BUILD_WITH_PCH)

View File

@@ -4,13 +4,12 @@ else()
set(HIGHLIGHTING_BUILD_DEFAULT ON) set(HIGHLIGHTING_BUILD_DEFAULT ON)
endif() endif()
add_qtc_library(KSyntaxHighlighting SHARED add_qtc_library(KSyntaxHighlighting
BUILD_DEFAULT ${HIGHLIGHTING_BUILD_DEFAULT} BUILD_DEFAULT ${HIGHLIGHTING_BUILD_DEFAULT}
INCLUDES autogenerated/ INCLUDES autogenerated/
PUBLIC_INCLUDES PUBLIC_INCLUDES
src/lib src/lib
autogenerated/src/lib autogenerated/src/lib
DEFINES KF5SyntaxHighlighting_EXPORTS
DEPENDS Qt5::Network Qt5::Widgets DEPENDS Qt5::Network Qt5::Widgets
SOURCES SOURCES
autogenerated/src/lib/ksyntaxhighlighting_logging.cpp autogenerated/src/lib/ksyntaxhighlighting_logging.h autogenerated/src/lib/ksyntaxhighlighting_logging.cpp autogenerated/src/lib/ksyntaxhighlighting_logging.h
@@ -43,6 +42,13 @@ add_qtc_library(KSyntaxHighlighting SHARED
src/lib/worddelimiters.cpp src/lib/worddelimiters_p.h src/lib/worddelimiters.cpp src/lib/worddelimiters_p.h
src/lib/xml_p.h src/lib/xml_p.h
) )
set(export_symbol_declaration DEFINES KF5SyntaxHighlighting_EXPORTS)
if (QTC_STATIC_BUILD)
set(export_symbol_declaration PUBLIC_DEFINES KSYNTAXHIGHLIGHTING_STATIC_DEFINE)
endif()
extend_qtc_target(KSyntaxHighlighting ${export_symbol_declaration})
qtc_add_public_header(autogenerated/src/lib/State) qtc_add_public_header(autogenerated/src/lib/State)
if(TARGET KSyntaxHighlighting) if(TARGET KSyntaxHighlighting)

View File

@@ -24,13 +24,17 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/qlitehtml/src/CMakeLists.txt)
option(BUILD_LIBRARY_QLITEHTML "Build library qlitehtml." ${BUILD_LIBRARIES_BY_DEFAULT}) option(BUILD_LIBRARY_QLITEHTML "Build library qlitehtml." ${BUILD_LIBRARIES_BY_DEFAULT})
set(QLITEHTML_VERSION_COMPAT ${IDE_VERSION_COMPAT} CACHE STRING "") set(QLITEHTML_VERSION_COMPAT ${IDE_VERSION_COMPAT} CACHE STRING "")
if(BUILD_LIBRARY_QLITEHTML) if(BUILD_LIBRARY_QLITEHTML)
set(QLITEHTML_BIN_PATH ${IDE_BIN_PATH})
set(QLITEHTML_LIBRARY_PATH ${IDE_LIBRARY_PATH})
set(QLITEHTML_LIBRARY_ARCHIVE_PATH ${IDE_LIBRARY_ARCHIVE_PATH}) set(QLITEHTML_LIBRARY_ARCHIVE_PATH ${IDE_LIBRARY_ARCHIVE_PATH})
set(QLITEHTML_EXPORT QtCreator) set(QLITEHTML_EXPORT QtCreator)
set(QLITEHTML_DEVEL_COMPONENT Devel) set(QLITEHTML_DEVEL_COMPONENT Devel)
set(QLITEHTML_DEVEL_EXCLUDE_FROM_ALL ON) set(QLITEHTML_DEVEL_EXCLUDE_FROM_ALL ON)
set(QLITEHTML_HEADER_PATH "${IDE_HEADER_INSTALL_PATH}/src/lib/qlitehtml") set(QLITEHTML_HEADER_PATH "${IDE_HEADER_INSTALL_PATH}/src/lib/qlitehtml")
if (QTC_STATIC_BUILD)
set(QLITEHTML_LIBRARY_TYPE STATIC)
else()
set(QLITEHTML_BIN_PATH ${IDE_BIN_PATH})
set(QLITEHTML_LIBRARY_PATH ${IDE_LIBRARY_PATH})
endif()
set(QT_VERSION_MAJOR ${Qt5_VERSION_MAJOR}) set(QT_VERSION_MAJOR ${Qt5_VERSION_MAJOR})
option(BUILD_TESTING "Build litehtml tests" OFF) # otherwise litehtml downloads googletest option(BUILD_TESTING "Build litehtml tests" OFF) # otherwise litehtml downloads googletest
add_subdirectory(qlitehtml/src) add_subdirectory(qlitehtml/src)

View File

@@ -47,15 +47,13 @@ class QAbstractButton;
class QSplitter; class QSplitter;
QT_END_NAMESPACE QT_END_NAMESPACE
#ifndef ADS_STATIC #if defined(ADVANCEDDOCKINGSYSTEM_LIBRARY)
#ifdef ADVANCEDDOCKINGSYSTEM_LIBRARY
# define ADS_EXPORT Q_DECL_EXPORT # define ADS_EXPORT Q_DECL_EXPORT
#elif defined(ADVANCEDDOCKINGSYSTEM_STATIC_LIBRARY)
# define ADS_EXPORT
#else #else
# define ADS_EXPORT Q_DECL_IMPORT # define ADS_EXPORT Q_DECL_IMPORT
#endif #endif
#else
#define ADS_EXPORT
#endif
//#define ADS_DEBUG_PRINT //#define ADS_DEBUG_PRINT

View File

@@ -29,6 +29,8 @@
#if defined(AGGREGATION_LIBRARY) #if defined(AGGREGATION_LIBRARY)
# define AGGREGATION_EXPORT Q_DECL_EXPORT # define AGGREGATION_EXPORT Q_DECL_EXPORT
#elif defined(AGGREGATION_STATIC_LIBRARY)
# define AGGREGATION_EXPORT
#else #else
# define AGGREGATION_EXPORT Q_DECL_IMPORT # define AGGREGATION_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -7,7 +7,6 @@ add_qtc_library(ClangSupport
CLANG_VERSION="${CLANG_VERSION}" CLANG_VERSION="${CLANG_VERSION}"
CLANG_INCLUDE_DIR="${LLVM_LIBRARY_DIR}/clang/${CLANG_VERSION}/include" CLANG_INCLUDE_DIR="${LLVM_LIBRARY_DIR}/clang/${CLANG_VERSION}/include"
CLANG_BINDIR="${LLVM_TOOLS_BINARY_DIR}" CLANG_BINDIR="${LLVM_TOOLS_BINARY_DIR}"
DEFINES CLANGSUPPORT_BUILD_LIB
PUBLIC_INCLUDES PUBLIC_INCLUDES
"${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_CURRENT_LIST_DIR}"
SOURCES SOURCES

View File

@@ -31,9 +31,9 @@
#include <utils/smallstringfwd.h> #include <utils/smallstringfwd.h>
#if defined(CLANGSUPPORT_BUILD_LIB) #if defined(CLANGSUPPORT_LIBRARY)
# define CLANGSUPPORT_EXPORT Q_DECL_EXPORT # define CLANGSUPPORT_EXPORT Q_DECL_EXPORT
#elif defined(CLANGSUPPORT_BUILD_STATIC_LIB) #elif defined(CLANGSUPPORT_STATIC_LIBRARY)
# define CLANGSUPPORT_EXPORT # define CLANGSUPPORT_EXPORT
#else #else
# define CLANGSUPPORT_EXPORT Q_DECL_IMPORT # define CLANGSUPPORT_EXPORT Q_DECL_IMPORT

View File

@@ -1,10 +1,7 @@
# TODO: Support static build, currently being done with CPLUSPLUS_BUILD_STATIC_LIB
# -- if really needed that is.
# TODO: Make Qt5::Gui optional -- if really needed that is. # TODO: Make Qt5::Gui optional -- if really needed that is.
add_qtc_library(CPlusPlus add_qtc_library(CPlusPlus
DEPENDS Utils Qt5::Concurrent DEPENDS Utils Qt5::Concurrent
DEFINES CPLUSPLUS_BUILD_LIB
PUBLIC_DEPENDS 3rd_cplusplus Qt5::Gui PUBLIC_DEPENDS 3rd_cplusplus Qt5::Gui
SOURCES SOURCES
ASTParent.cpp ASTParent.h ASTParent.cpp ASTParent.h
@@ -43,6 +40,12 @@ add_qtc_library(CPlusPlus
SKIP_PCH SKIP_PCH
) )
set(export_symbol_declaration DEFINES CPLUSPLUS_BUILD_LIB)
if (QTC_STATIC_BUILD)
set(export_symbol_declaration PUBLIC_DEFINES CPLUSPLUS_BUILD_STATIC_LIB)
endif()
extend_qtc_target(CPlusPlus ${export_symbol_declaration})
if(TARGET CPlusPlus) if(TARGET CPlusPlus)
qtc_enable_release_for_debug_configuration() qtc_enable_release_for_debug_configuration()
if (BUILD_WITH_PCH) if (BUILD_WITH_PCH)

View File

@@ -30,6 +30,8 @@
#if defined(EXTENSIONSYSTEM_LIBRARY) #if defined(EXTENSIONSYSTEM_LIBRARY)
# define EXTENSIONSYSTEM_EXPORT Q_DECL_EXPORT # define EXTENSIONSYSTEM_EXPORT Q_DECL_EXPORT
#elif defined(EXTENSIONSYSTEM_STATIC_LIBRARY)
# define EXTENSIONSYSTEM_EXPORT
#else #else
# define EXTENSIONSYSTEM_EXPORT Q_DECL_IMPORT # define EXTENSIONSYSTEM_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -31,7 +31,7 @@
#if defined(GLSL_LIBRARY) #if defined(GLSL_LIBRARY)
# define GLSL_EXPORT Q_DECL_EXPORT # define GLSL_EXPORT Q_DECL_EXPORT
#elif defined(GLSL_BUILD_STATIC_LIB) #elif defined(GLSL_STATIC_LIBRARY)
# define GLSL_EXPORT # define GLSL_EXPORT
#else #else
# define GLSL_EXPORT Q_DECL_IMPORT # define GLSL_EXPORT Q_DECL_IMPORT

View File

@@ -29,6 +29,8 @@
#if defined(LANGUAGESERVERPROTOCOL_LIBRARY) #if defined(LANGUAGESERVERPROTOCOL_LIBRARY)
# define LANGUAGESERVERPROTOCOL_EXPORT Q_DECL_EXPORT # define LANGUAGESERVERPROTOCOL_EXPORT Q_DECL_EXPORT
#elif defined(LANGUAGESERVERPROTOCOL_STATIC_LIBRARY)
# define LANGUAGESERVERPROTOCOL_EXPORT
#else #else
# define LANGUAGESERVERPROTOCOL_EXPORT Q_DECL_IMPORT # define LANGUAGESERVERPROTOCOL_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,7 +29,7 @@
#if defined(LANGUAGEUTILS_LIBRARY) #if defined(LANGUAGEUTILS_LIBRARY)
# define LANGUAGEUTILS_EXPORT Q_DECL_EXPORT # define LANGUAGEUTILS_EXPORT Q_DECL_EXPORT
#elif defined(LANGUAGEUTILS_BUILD_STATIC_LIB) #elif defined(LANGUAGEUTILS_STATIC_LIBRARY)
# define LANGUAGEUTILS_EXPORT # define LANGUAGEUTILS_EXPORT
#else #else
# define LANGUAGEUTILS_EXPORT Q_DECL_IMPORT # define LANGUAGEUTILS_EXPORT Q_DECL_IMPORT

View File

@@ -1,5 +1,4 @@
add_qtc_library(Modeling add_qtc_library(Modeling
DEFINES MODELING_LIBRARY
DEPENDS Qt5::Widgets Utils DEPENDS Qt5::Widgets Utils
PUBLIC_DEPENDS OptionalSvg PUBLIC_DEPENDS OptionalSvg
INCLUDES qtserialization/inc INCLUDES qtserialization/inc

View File

@@ -29,6 +29,8 @@
#if defined(MODELING_LIBRARY) #if defined(MODELING_LIBRARY)
# define QMT_EXPORT Q_DECL_EXPORT # define QMT_EXPORT Q_DECL_EXPORT
#elif defined(MODELING_STATIC_LIBRARY)
# define QMT_EXPORT
#else #else
# define QMT_EXPORT Q_DECL_IMPORT # define QMT_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -27,7 +27,7 @@
#if defined(QMLDEBUG_LIBRARY) #if defined(QMLDEBUG_LIBRARY)
# define QMLDEBUG_EXPORT Q_DECL_EXPORT # define QMLDEBUG_EXPORT Q_DECL_EXPORT
#elif defined(QMLDEBUG_STATIC_LIB) #elif defined(QMLDEBUG_STATIC_LIBRARY)
# define QMLDEBUG_EXPORT # define QMLDEBUG_EXPORT
#else #else
# define QMLDEBUG_EXPORT Q_DECL_IMPORT # define QMLDEBUG_EXPORT Q_DECL_IMPORT

View File

@@ -29,7 +29,7 @@
# if defined(QMLEDITORWIDGETS_LIBRARY) # if defined(QMLEDITORWIDGETS_LIBRARY)
# define QMLEDITORWIDGETS_EXPORT Q_DECL_EXPORT # define QMLEDITORWIDGETS_EXPORT Q_DECL_EXPORT
# elif defined(BUILD_QMLJSDEBUGGER_STATIC_LIB) # elif defined(QMLEDITORWIDGETS_STATIC_LIBRARY)
# define QMLEDITORWIDGETS_EXPORT # define QMLEDITORWIDGETS_EXPORT
# else # else
# define QMLEDITORWIDGETS_EXPORT Q_DECL_IMPORT # define QMLEDITORWIDGETS_EXPORT Q_DECL_IMPORT

View File

@@ -44,7 +44,7 @@
# ifdef QMLJS_LIBRARY # ifdef QMLJS_LIBRARY
# define QML_PARSER_EXPORT Q_DECL_EXPORT # define QML_PARSER_EXPORT Q_DECL_EXPORT
# elif QML_BUILD_STATIC_LIB # elif QMLJS_STATIC_LIBRARY
# define QML_PARSER_EXPORT # define QML_PARSER_EXPORT
# else # else
# define QML_PARSER_EXPORT Q_DECL_IMPORT # define QML_PARSER_EXPORT Q_DECL_IMPORT

View File

@@ -29,7 +29,7 @@
#if defined(QMLJS_LIBRARY) #if defined(QMLJS_LIBRARY)
# define QMLJS_EXPORT Q_DECL_EXPORT # define QMLJS_EXPORT Q_DECL_EXPORT
#elif defined(QML_BUILD_STATIC_LIB) #elif defined(QMLJS_STATIC_LIBRARY)
# define QMLJS_EXPORT # define QMLJS_EXPORT
#else #else
# define QMLJS_EXPORT Q_DECL_IMPORT # define QMLJS_EXPORT Q_DECL_IMPORT

View File

@@ -1,7 +1,6 @@
add_qtc_library(Sqlite add_qtc_library(Sqlite
PROPERTIES AUTOMOC OFF AUTOUIC OFF PROPERTIES AUTOMOC OFF AUTOUIC OFF
PUBLIC_DEFINES PUBLIC_DEFINES
BUILD_SQLITE_LIBRARY
SQLITE_CORE SQLITE_CORE
DEPENDS Qt5::Core Threads::Threads ${CMAKE_DL_LIBS} DEPENDS Qt5::Core Threads::Threads ${CMAKE_DL_LIBS}
PUBLIC_INCLUDES PUBLIC_INCLUDES

View File

@@ -29,9 +29,9 @@
#include <QtGlobal> #include <QtGlobal>
#if defined(BUILD_SQLITE_LIBRARY) #if defined(SQLITE_LIBRARY)
# define SQLITE_EXPORT Q_DECL_EXPORT # define SQLITE_EXPORT Q_DECL_EXPORT
#elif defined(BUILD_SQLITE_STATIC_LIBRARY) #elif defined(SQLITE_STATIC_LIBRARY)
# define SQLITE_EXPORT # define SQLITE_EXPORT
#else #else
# define SQLITE_EXPORT Q_DECL_IMPORT # define SQLITE_EXPORT Q_DECL_IMPORT

View File

@@ -29,6 +29,8 @@
#if defined(QTCSSH_LIBRARY) #if defined(QTCSSH_LIBRARY)
# define QSSH_EXPORT Q_DECL_EXPORT # define QSSH_EXPORT Q_DECL_EXPORT
#elif defined(QTCSSH_STATIC_LIBRARY)
# define QSSH_EXPORT
#else #else
# define QSSH_EXPORT Q_DECL_IMPORT # define QSSH_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(TRACING_LIBRARY) #if defined(TRACING_LIBRARY)
# define TRACING_EXPORT Q_DECL_EXPORT # define TRACING_EXPORT Q_DECL_EXPORT
#elif defined(TRACING_STATIC_LIBRARY)
# define TRACING_EXPORT
#else #else
# define TRACING_EXPORT Q_DECL_IMPORT # define TRACING_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -39,7 +39,7 @@
#include <cctype> #include <cctype>
Q_LOGGING_CATEGORY(log, "qtc.utils.filesearch", QtWarningMsg) Q_LOGGING_CATEGORY(searchLog, "qtc.utils.filesearch", QtWarningMsg)
using namespace Utils; using namespace Utils;
@@ -143,13 +143,13 @@ void FileSearch::operator()(QFutureInterface<FileSearchResultList> &futureInterf
{ {
if (futureInterface.isCanceled()) if (futureInterface.isCanceled())
return; return;
qCDebug(log) << "Searching in" << item.filePath; qCDebug(searchLog) << "Searching in" << item.filePath;
futureInterface.setProgressRange(0, 1); futureInterface.setProgressRange(0, 1);
futureInterface.setProgressValue(0); futureInterface.setProgressValue(0);
FileSearchResultList results; FileSearchResultList results;
QString tempString; QString tempString;
if (!getFileContent(item.filePath, item.encoding, &tempString, fileToContentsMap)) { if (!getFileContent(item.filePath, item.encoding, &tempString, fileToContentsMap)) {
qCDebug(log) << "- failed to get content for" << item.filePath; qCDebug(searchLog) << "- failed to get content for" << item.filePath;
futureInterface.cancel(); // failure futureInterface.cancel(); // failure
return; return;
} }
@@ -227,7 +227,7 @@ void FileSearch::operator()(QFutureInterface<FileSearchResultList> &futureInterf
futureInterface.reportResult(results); futureInterface.reportResult(results);
futureInterface.setProgressValue(1); futureInterface.setProgressValue(1);
} }
qCDebug(log) << "- finished searching in" << item.filePath; qCDebug(searchLog) << "- finished searching in" << item.filePath;
} }
FileSearchRegExp::FileSearchRegExp(const QString &searchTerm, QTextDocument::FindFlags flags, FileSearchRegExp::FileSearchRegExp(const QString &searchTerm, QTextDocument::FindFlags flags,
@@ -263,13 +263,13 @@ void FileSearchRegExp::operator()(QFutureInterface<FileSearchResultList> &future
} }
if (futureInterface.isCanceled()) if (futureInterface.isCanceled())
return; return;
qCDebug(log) << "Searching in" << item.filePath; qCDebug(searchLog) << "Searching in" << item.filePath;
futureInterface.setProgressRange(0, 1); futureInterface.setProgressRange(0, 1);
futureInterface.setProgressValue(0); futureInterface.setProgressValue(0);
FileSearchResultList results; FileSearchResultList results;
QString tempString; QString tempString;
if (!getFileContent(item.filePath, item.encoding, &tempString, fileToContentsMap)) { if (!getFileContent(item.filePath, item.encoding, &tempString, fileToContentsMap)) {
qCDebug(log) << "- failed to get content for" << item.filePath; qCDebug(searchLog) << "- failed to get content for" << item.filePath;
futureInterface.cancel(); // failure futureInterface.cancel(); // failure
return; return;
} }
@@ -304,7 +304,7 @@ void FileSearchRegExp::operator()(QFutureInterface<FileSearchResultList> &future
futureInterface.reportResult(results); futureInterface.reportResult(results);
futureInterface.setProgressValue(1); futureInterface.setProgressValue(1);
} }
qCDebug(log) << "- finished searching in" << item.filePath; qCDebug(searchLog) << "- finished searching in" << item.filePath;
} }
struct SearchState struct SearchState

View File

@@ -29,7 +29,7 @@
#if defined(UTILS_LIBRARY) #if defined(UTILS_LIBRARY)
# define QTCREATOR_UTILS_EXPORT Q_DECL_EXPORT # define QTCREATOR_UTILS_EXPORT Q_DECL_EXPORT
#elif defined(QTCREATOR_UTILS_STATIC_LIB) // Abuse single files for manual tests #elif defined(UTILS_STATIC_LIBRARY) // Abuse single files for manual tests
# define QTCREATOR_UTILS_EXPORT # define QTCREATOR_UTILS_EXPORT
#else #else
# define QTCREATOR_UTILS_EXPORT Q_DECL_IMPORT # define QTCREATOR_UTILS_EXPORT Q_DECL_IMPORT

View File

@@ -29,6 +29,8 @@
#if defined(ANDROID_LIBRARY) #if defined(ANDROID_LIBRARY)
# define ANDROID_EXPORT Q_DECL_EXPORT # define ANDROID_EXPORT Q_DECL_EXPORT
#elif defined(ANDROID_STATIC_LIBRARY)
# define ANDROID_EXPORT
#else #else
# define ANDROID_EXPORT Q_DECL_IMPORT # define ANDROID_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(AutoTest add_qtc_plugin(AutoTest
PLUGIN_CLASS AutotestPlugin
PLUGIN_DEPENDS Core CppEditor Debugger ProjectExplorer QmlJSTools TextEditor PLUGIN_DEPENDS Core CppEditor Debugger ProjectExplorer QmlJSTools TextEditor
PLUGIN_TEST_DEPENDS QmakeProjectManager QtSupport QbsProjectManager PLUGIN_TEST_DEPENDS QmakeProjectManager QtSupport QbsProjectManager
SOURCES SOURCES

View File

@@ -29,6 +29,8 @@
#if defined(AUTOTEST_LIBRARY) #if defined(AUTOTEST_LIBRARY)
# define AUTOTESTSHARED_EXPORT Q_DECL_EXPORT # define AUTOTESTSHARED_EXPORT Q_DECL_EXPORT
#elif defined(AUTOTEST_STATIC_LIBRARY)
# define AUTOTESTSHARED_EXPORT
#else #else
# define AUTOTESTSHARED_EXPORT Q_DECL_IMPORT # define AUTOTESTSHARED_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(AutotoolsProjectManager add_qtc_plugin(AutotoolsProjectManager
PLUGIN_CLASS AutotoolsProjectPlugin
PLUGIN_DEPENDS Core CppEditor ProjectExplorer QtSupport PLUGIN_DEPENDS Core CppEditor ProjectExplorer QtSupport
SOURCES SOURCES
autogenstep.cpp autogenstep.h autogenstep.cpp autogenstep.h

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(Boot2Qt add_qtc_plugin(Boot2Qt
PLUGIN_CLASS QdbPlugin
DEPENDS Qt5::Network QtcSsh DEPENDS Qt5::Network QtcSsh
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport RemoteLinux PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport RemoteLinux
SOURCES SOURCES

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(CMakeProjectManager add_qtc_plugin(CMakeProjectManager
PLUGIN_CLASS CMakeProjectPlugin
DEPENDS QmlJS DEPENDS QmlJS
PLUGIN_DEPENDS Core CppEditor ProjectExplorer TextEditor QtSupport PLUGIN_DEPENDS Core CppEditor ProjectExplorer TextEditor QtSupport
SOURCES SOURCES

View File

@@ -29,6 +29,8 @@
#if defined(CMAKEPROJECTMANAGER_LIBRARY) #if defined(CMAKEPROJECTMANAGER_LIBRARY)
# define CMAKE_EXPORT Q_DECL_EXPORT # define CMAKE_EXPORT Q_DECL_EXPORT
#elif defined(CMAKEPROJECTMANAGER_STATIC_LIBRARY)
# define CMAKE_EXPORT
#else #else
# define CMAKE_EXPORT Q_DECL_IMPORT # define CMAKE_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -1,5 +1,4 @@
add_qtc_plugin(CppEditor add_qtc_plugin(CppEditor
DEFINES CPPEDITOR_LIBRARY
DEPENDS Qt5::Network Qt5::Xml DEPENDS Qt5::Network Qt5::Xml
PUBLIC_DEPENDS CPlusPlus ClangSupport Qt5::Widgets PUBLIC_DEPENDS CPlusPlus ClangSupport Qt5::Widgets
PLUGIN_DEPENDS Core ProjectExplorer TextEditor PLUGIN_DEPENDS Core ProjectExplorer TextEditor

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(CVS add_qtc_plugin(CVS
PLUGIN_CLASS CvsPlugin
PLUGIN_DEPENDS Core TextEditor VcsBase PLUGIN_DEPENDS Core TextEditor VcsBase
SOURCES SOURCES
annotationhighlighter.cpp annotationhighlighter.h annotationhighlighter.cpp annotationhighlighter.h

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(Designer add_qtc_plugin(Designer
PLUGIN_CLASS FormEditorPlugin
CONDITION TARGET Qt5::DesignerComponents AND TARGET Qt5::Designer CONDITION TARGET Qt5::DesignerComponents AND TARGET Qt5::Designer
DEPENDS designerintegrationv2 DEPENDS designerintegrationv2
Qt5::Designer Qt5::PrintSupport Qt5::DesignerComponents Qt5::Designer Qt5::PrintSupport Qt5::DesignerComponents
@@ -35,3 +36,10 @@ extend_qtc_plugin(Designer
CONDITION WITH_TESTS AND TARGET Qt5::DesignerComponents AND TARGET Qt5::Designer CONDITION WITH_TESTS AND TARGET Qt5::DesignerComponents AND TARGET Qt5::Designer
SOURCES gotoslot_test.cpp SOURCES gotoslot_test.cpp
) )
if (QTC_STATIC_BUILD)
get_target_property(_designerType Qt5::Designer TYPE)
if (${_designerType} STREQUAL "STATIC_LIBRARY")
extend_qtc_target(Designer PUBLIC_DEFINES QT_DESIGNER_STATIC)
endif()
endif()

View File

@@ -29,6 +29,8 @@
#if defined(DESIGNER_LIBRARY) #if defined(DESIGNER_LIBRARY)
# define DESIGNER_EXPORT Q_DECL_EXPORT # define DESIGNER_EXPORT Q_DECL_EXPORT
#elif defined(DESIGNER_STATIC_LIBRARY)
# define DESIGNER_EXPORT
#else #else
# define DESIGNER_EXPORT Q_DECL_IMPORT # define DESIGNER_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -1,6 +1,5 @@
add_qtc_plugin(DiffEditor add_qtc_plugin(DiffEditor
PLUGIN_DEPENDS Core TextEditor PLUGIN_DEPENDS Core TextEditor
DEFINES DIFFEDITOR_LIBRARY
SOURCES SOURCES
descriptionwidgetwatcher.cpp descriptionwidgetwatcher.h descriptionwidgetwatcher.cpp descriptionwidgetwatcher.h
diffeditor.cpp diffeditor.h diffeditor.cpp diffeditor.h

View File

@@ -29,6 +29,8 @@
#if defined(DIFFEDITOR_LIBRARY) #if defined(DIFFEDITOR_LIBRARY)
# define DIFFEDITOR_EXPORT Q_DECL_EXPORT # define DIFFEDITOR_EXPORT Q_DECL_EXPORT
#elif defined(DIFFEDITOR_STATIC_LIBRARY)
# define DIFFEDITOR_EXPORT
#else #else
# define DIFFEDITOR_EXPORT Q_DECL_IMPORT # define DIFFEDITOR_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(GenericProjectManager add_qtc_plugin(GenericProjectManager
PLUGIN_CLASS GenericProjectPlugin
PLUGIN_DEPENDS Core ProjectExplorer QtSupport TextEditor PLUGIN_DEPENDS Core ProjectExplorer QtSupport TextEditor
PLUGIN_TEST_DEPENDS CppEditor PLUGIN_TEST_DEPENDS CppEditor
PLUGIN_RECOMMENDS CppEditor PLUGIN_RECOMMENDS CppEditor

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(GLSLEditor add_qtc_plugin(GLSLEditor
PLUGIN_CLASS GlslEditorPlugin
DEPENDS GLSL DEPENDS GLSL
PLUGIN_DEPENDS Core CppEditor TextEditor PLUGIN_DEPENDS Core CppEditor TextEditor
SOURCES SOURCES

View File

@@ -29,6 +29,8 @@
#if defined(LANGUAGECLIENT_LIBRARY) #if defined(LANGUAGECLIENT_LIBRARY)
# define LANGUAGECLIENT_EXPORT Q_DECL_EXPORT # define LANGUAGECLIENT_EXPORT Q_DECL_EXPORT
#elif defined(LANGUAGECLIENT_STATIC_LIBRARY)
# define LANGUAGECLIENT_EXPORT
#else #else
# define LANGUAGECLIENT_EXPORT Q_DECL_IMPORT # define LANGUAGECLIENT_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(MesonProjectManager add_qtc_plugin(MesonProjectManager
PLUGIN_CLASS MesonProjectPlugin
DEPENDS QmlJS DEPENDS QmlJS
PLUGIN_DEPENDS Core CppEditor ProjectExplorer TextEditor QtSupport PLUGIN_DEPENDS Core CppEditor ProjectExplorer TextEditor QtSupport
SOURCES SOURCES

View File

@@ -1,5 +1,4 @@
add_qtc_plugin(ModelEditor add_qtc_plugin(ModelEditor
DEFINES MODELEDITOR_LIBRARY
DEPENDS Modeling Qt5::Core Qt5::Gui Qt5::Widgets DEPENDS Modeling Qt5::Core Qt5::Gui Qt5::Widgets
PLUGIN_DEPENDS Core CppEditor ProjectExplorer PLUGIN_DEPENDS Core CppEditor ProjectExplorer
SOURCES SOURCES

View File

@@ -29,6 +29,8 @@
#if defined(MODELEDITOR_LIBRARY) #if defined(MODELEDITOR_LIBRARY)
# define MODELEDITOR_EXPORT Q_DECL_EXPORT # define MODELEDITOR_EXPORT Q_DECL_EXPORT
#elif defined(MODELEDITOR_STATIC_LIBRARY)
# define MODELEDITOR_EXPORT
#else #else
# define MODELEDITOR_EXPORT Q_DECL_IMPORT # define MODELEDITOR_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(PERFPROFILER_LIBRARY) #if defined(PERFPROFILER_LIBRARY)
# define PERFPROFILER_EXPORT Q_DECL_EXPORT # define PERFPROFILER_EXPORT Q_DECL_EXPORT
#elif defined(PERFPROFILER_STATIC_LIBRARY)
# define PERFPROFILER_EXPORT
#else #else
# define PERFPROFILER_EXPORT Q_DECL_IMPORT # define PERFPROFILER_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -60,7 +60,7 @@ protected:
void setDisplayName(const QString &displayName); void setDisplayName(const QString &displayName);
void setIcon(const QIcon &icon); void setIcon(const QIcon &icon);
void setCombinedIcon(const Utils::FilePath &small, const Utils::FilePath &large); void setCombinedIcon(const Utils::FilePath &smallIcon, const Utils::FilePath &largeIcon);
void setConstructionFunction(const std::function<IDevicePtr ()> &constructor); void setConstructionFunction(const std::function<IDevicePtr ()> &constructor);
void setCreator(const std::function<IDevicePtr()> &creator); void setCreator(const std::function<IDevicePtr()> &creator);

View File

@@ -29,6 +29,8 @@
#if defined(QBSPROJECTMANAGER_LIBRARY) #if defined(QBSPROJECTMANAGER_LIBRARY)
# define QBSPROJECTMANAGER_EXPORT Q_DECL_EXPORT # define QBSPROJECTMANAGER_EXPORT Q_DECL_EXPORT
#elif defined(QBSPROJECTMANAGER_STATIC_LIBRARY)
# define QBSPROJECTMANAGER_EXPORT
#else #else
# define QBSPROJECTMANAGER_EXPORT Q_DECL_IMPORT # define QBSPROJECTMANAGER_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(QMAKEPROJECTMANAGER_LIBRARY) #if defined(QMAKEPROJECTMANAGER_LIBRARY)
# define QMAKEPROJECTMANAGER_EXPORT Q_DECL_EXPORT # define QMAKEPROJECTMANAGER_EXPORT Q_DECL_EXPORT
#elif defined(QMAKEPROJECTMANAGER_STATIC_LIBRARY)
# define QMAKEPROJECTMANAGER_EXPORT
#else #else
# define QMAKEPROJECTMANAGER_EXPORT Q_DECL_IMPORT # define QMAKEPROJECTMANAGER_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -9,7 +9,6 @@ add_qtc_plugin(QmlDesigner
QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem
Qt5::QuickWidgets Qt5::CorePrivate Sqlite Qt5::Xml Qt5::Svg Qt5::QuickWidgets Qt5::CorePrivate Sqlite Qt5::Xml Qt5::Svg
DEFINES DEFINES
DESIGNER_CORE_LIBRARY
IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\" IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\"
SHARE_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../../../share/qtcreator/qmldesigner" SHARE_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../../../share/qtcreator/qmldesigner"
PUBLIC_INCLUDES PUBLIC_INCLUDES
@@ -59,7 +58,16 @@ add_qtc_plugin(QmlDesigner
include(qmldesignercore.cmake) include(qmldesignercore.cmake)
extend_with_qmldesigner_core(QmlDesigner) extend_with_qmldesigner_core(QmlDesigner)
if (QTC_STATIC_BUILD)
get_target_property(_designerType Qt5::Designer TYPE)
if (${_designerType} STREQUAL "STATIC_LIBRARY")
extend_qtc_target(QmlDesigner PUBLIC_DEFINES QT_DESIGNER_STATIC)
endif()
extend_qtc_target(QmlDesigner PUBLIC_DEPENDS TextEditor)
endif()
add_qtc_plugin(assetexporterplugin add_qtc_plugin(assetexporterplugin
PLUGIN_CLASS AssetExporterPlugin
CONDITION TARGET QmlDesigner CONDITION TARGET QmlDesigner
DEPENDS Core ProjectExplorer QmlDesigner Utils Qt5::Qml Qt5::QuickPrivate DEPENDS Core ProjectExplorer QmlDesigner Utils Qt5::Qml Qt5::QuickPrivate
PUBLIC_INCLUDES assetexporterplugin PUBLIC_INCLUDES assetexporterplugin
@@ -81,6 +89,7 @@ add_qtc_plugin(assetexporterplugin
) )
add_qtc_plugin(componentsplugin add_qtc_plugin(componentsplugin
PLUGIN_CLASS ComponentsPlugin
CONDITION TARGET QmlDesigner CONDITION TARGET QmlDesigner
DEPENDS Core QmlDesigner Utils Qt5::Qml DEPENDS Core QmlDesigner Utils Qt5::Qml
DEFINES COMPONENTS_LIBRARY DEFINES COMPONENTS_LIBRARY
@@ -96,6 +105,7 @@ add_qtc_plugin(componentsplugin
) )
add_qtc_plugin(qmlpreviewplugin add_qtc_plugin(qmlpreviewplugin
PLUGIN_CLASS QmlPreviewWidgetPlugin
CONDITION TARGET QmlDesigner CONDITION TARGET QmlDesigner
DEPENDS Core ProjectExplorer QmlDesigner Utils Qt5::Qml DEPENDS Core ProjectExplorer QmlDesigner Utils Qt5::Qml
SOURCES SOURCES
@@ -106,6 +116,7 @@ add_qtc_plugin(qmlpreviewplugin
) )
add_qtc_plugin(qtquickplugin add_qtc_plugin(qtquickplugin
PLUGIN_CLASS QtQuickPlugin
CONDITION TARGET QmlDesigner CONDITION TARGET QmlDesigner
DEPENDS Core QmlDesigner Utils Qt5::Qml DEPENDS Core QmlDesigner Utils Qt5::Qml
DEFINES QTQUICK_LIBRARY DEFINES QTQUICK_LIBRARY

View File

@@ -30,9 +30,9 @@
// Unnecessary since core isn't a dll any more. // Unnecessary since core isn't a dll any more.
#if defined(DESIGNER_CORE_LIBRARY) #if defined(QMLDESIGNER_LIBRARY)
#define QMLDESIGNERCORE_EXPORT Q_DECL_EXPORT #define QMLDESIGNERCORE_EXPORT Q_DECL_EXPORT
#elif defined(DESIGNER_STATIC_CORE_LIBRARY) #elif defined(QMLDESIGNER_STATIC_LIBRARY)
#define QMLDESIGNERCORE_EXPORT #define QMLDESIGNERCORE_EXPORT
#else #else
#define QMLDESIGNERCORE_EXPORT Q_DECL_IMPORT #define QMLDESIGNERCORE_EXPORT Q_DECL_IMPORT

View File

@@ -43,7 +43,7 @@ enum FoundLicense {
}; };
namespace Internal { namespace Internal {
ExtensionSystem::IPlugin *licenseCheckerPlugin() inline ExtensionSystem::IPlugin *licenseCheckerPlugin()
{ {
const ExtensionSystem::PluginSpec *pluginSpec = Utils::findOrDefault( const ExtensionSystem::PluginSpec *pluginSpec = Utils::findOrDefault(
ExtensionSystem::PluginManager::plugins(), ExtensionSystem::PluginManager::plugins(),
@@ -55,8 +55,7 @@ ExtensionSystem::IPlugin *licenseCheckerPlugin()
} }
} // namespace Internal } // namespace Internal
inline FoundLicense checkLicense()
FoundLicense checkLicense()
{ {
if (auto plugin = Internal::licenseCheckerPlugin()) { if (auto plugin = Internal::licenseCheckerPlugin()) {
bool retVal = false; bool retVal = false;
@@ -72,7 +71,7 @@ FoundLicense checkLicense()
return community; return community;
} }
QString licensee() inline QString licensee()
{ {
if (auto plugin = Internal::licenseCheckerPlugin()) { if (auto plugin = Internal::licenseCheckerPlugin()) {
QString retVal; QString retVal;

View File

@@ -28,7 +28,6 @@ function(extend_with_qmldesigner_core target_name)
QtSupport QtSupport
TextEditor TextEditor
DEFINES DEFINES
DESIGNER_CORE_LIBRARY
TEST_EXPORTS TEST_EXPORTS
INCLUDES INCLUDES
${CMAKE_CURRENT_FUNCTION_LIST_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}
@@ -420,4 +419,11 @@ function(extend_with_qmldesigner_core target_name)
SOURCES_PREFIX ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet/container SOURCES_PREFIX ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet/container
SOURCES sharedmemory_qt.cpp SOURCES sharedmemory_qt.cpp
) )
set(export_symbol_declaration DEFINES QMLDESIGNER_LIBRARY)
if (QTC_STATIC_BUILD)
set(export_symbol_declaration PUBLIC_DEFINES QMLDESIGNER_STATIC_LIBRARY)
endif()
extend_qtc_target(${target_name} ${export_symbol_declaration})
endfunction() endfunction()

View File

@@ -73,7 +73,7 @@ static void handleAction(const SelectionContext &context)
} }
ProjectExplorerPlugin::runStartupProject(Constants::QML_PREVIEW_RUN_MODE, skipDeploy); ProjectExplorerPlugin::runStartupProject(Constants::QML_PREVIEW_RUN_MODE, skipDeploy);
} else { } else {
QmlPreviewPlugin::stopAllRunControls(); QmlPreviewWidgetPlugin::stopAllRunControls();
} }
} }
} }
@@ -81,14 +81,14 @@ static void handleAction(const SelectionContext &context)
QmlPreviewAction::QmlPreviewAction() : ModelNodeAction(livePreviewId, QmlPreviewAction::QmlPreviewAction() : ModelNodeAction(livePreviewId,
"Live Preview", "Live Preview",
previewIcon.icon(), previewIcon.icon(),
QmlPreviewPlugin::tr("Show Live Preview"), QmlPreviewWidgetPlugin::tr("Show Live Preview"),
ComponentCoreConstants::qmlPreviewCategory, ComponentCoreConstants::qmlPreviewCategory,
QKeySequence("Alt+p"), QKeySequence("Alt+p"),
20, 20,
&handleAction, &handleAction,
&SelectionContextFunctors::always) &SelectionContextFunctors::always)
{ {
if (!QmlPreviewPlugin::getPreviewPlugin()) if (!QmlPreviewWidgetPlugin::getPreviewPlugin())
defaultAction()->setVisible(false); defaultAction()->setVisible(false);
defaultAction()->setCheckable(true); defaultAction()->setCheckable(true);
@@ -97,7 +97,7 @@ QmlPreviewAction::QmlPreviewAction() : ModelNodeAction(livePreviewId,
void QmlPreviewAction::updateContext() void QmlPreviewAction::updateContext()
{ {
if (selectionContext().view()->isAttached()) if (selectionContext().view()->isAttached())
QmlPreviewPlugin::setQmlFile(); QmlPreviewWidgetPlugin::setQmlFile();
defaultAction()->setSelectionContext(selectionContext()); defaultAction()->setSelectionContext(selectionContext());
} }
@@ -111,9 +111,9 @@ ZoomPreviewAction::ZoomPreviewAction()
: m_zoomAction(new ZoomAction(nullptr)) : m_zoomAction(new ZoomAction(nullptr))
{ {
QObject::connect(m_zoomAction.get(), &ZoomAction::zoomLevelChanged, [=](float d) { QObject::connect(m_zoomAction.get(), &ZoomAction::zoomLevelChanged, [=](float d) {
QmlPreviewPlugin::setZoomFactor(d); QmlPreviewWidgetPlugin::setZoomFactor(d);
}); });
if (!QmlPreviewPlugin::getPreviewPlugin()) if (!QmlPreviewWidgetPlugin::getPreviewPlugin())
m_zoomAction->setVisible(false); m_zoomAction->setVisible(false);
} }
@@ -281,7 +281,7 @@ SwitchLanguageAction::SwitchLanguageAction()
: m_switchLanguageAction(new SwitchLanguageComboboxAction(nullptr)) : m_switchLanguageAction(new SwitchLanguageComboboxAction(nullptr))
{ {
QObject::connect(m_switchLanguageAction.get(), &SwitchLanguageComboboxAction::currentLocaleChanged, QObject::connect(m_switchLanguageAction.get(), &SwitchLanguageComboboxAction::currentLocaleChanged,
&QmlPreviewPlugin::setLanguageLocale); &QmlPreviewWidgetPlugin::setLanguageLocale);
} }
QAction *SwitchLanguageAction::action() const QAction *SwitchLanguageAction::action() const

View File

@@ -53,7 +53,7 @@ Q_DECLARE_METATYPE(QmlPreview::QmlPreviewRunControlList)
namespace QmlDesigner { namespace QmlDesigner {
static QObject *s_previewPlugin = nullptr; static QObject *s_previewPlugin = nullptr;
QmlPreviewPlugin::QmlPreviewPlugin() QmlPreviewWidgetPlugin::QmlPreviewWidgetPlugin()
{ {
DesignerActionManager &designerActionManager = DesignerActionManager &designerActionManager =
QmlDesignerPlugin::instance()->designerActionManager(); QmlDesignerPlugin::instance()->designerActionManager();
@@ -92,12 +92,12 @@ QmlPreviewPlugin::QmlPreviewPlugin()
} }
} }
QString QmlPreviewPlugin::pluginName() const QString QmlPreviewWidgetPlugin::pluginName() const
{ {
return QLatin1String("QmlPreviewPlugin"); return QLatin1String("QmlPreviewPlugin");
} }
void QmlPreviewPlugin::stopAllRunControls() void QmlPreviewWidgetPlugin::stopAllRunControls()
{ {
QTC_ASSERT(s_previewPlugin, return); QTC_ASSERT(s_previewPlugin, return);
@@ -109,7 +109,7 @@ void QmlPreviewPlugin::stopAllRunControls()
} }
void QmlPreviewPlugin::handleRunningPreviews() void QmlPreviewWidgetPlugin::handleRunningPreviews()
{ {
QTC_ASSERT(s_previewPlugin, return); QTC_ASSERT(s_previewPlugin, return);
@@ -124,12 +124,12 @@ void QmlPreviewPlugin::handleRunningPreviews()
} }
} }
QString QmlPreviewPlugin::metaInfo() const QString QmlPreviewWidgetPlugin::metaInfo() const
{ {
return QLatin1String(":/qmlpreviewplugin/qmlpreview.metainfo"); return QLatin1String(":/qmlpreviewplugin/qmlpreview.metainfo");
} }
void QmlPreviewPlugin::setQmlFile() void QmlPreviewWidgetPlugin::setQmlFile()
{ {
if (s_previewPlugin) { if (s_previewPlugin) {
const Utils::FilePath qmlFileName = const Utils::FilePath qmlFileName =
@@ -140,7 +140,7 @@ void QmlPreviewPlugin::setQmlFile()
} }
} }
float QmlPreviewPlugin::zoomFactor() float QmlPreviewWidgetPlugin::zoomFactor()
{ {
QVariant zoomFactorVariant = 1.0; QVariant zoomFactorVariant = 1.0;
if (s_previewPlugin && !s_previewPlugin->property("zoomFactor").isNull()) if (s_previewPlugin && !s_previewPlugin->property("zoomFactor").isNull())
@@ -148,7 +148,7 @@ float QmlPreviewPlugin::zoomFactor()
return zoomFactorVariant.toFloat(); return zoomFactorVariant.toFloat();
} }
void QmlPreviewPlugin::setZoomFactor(float zoomFactor) void QmlPreviewWidgetPlugin::setZoomFactor(float zoomFactor)
{ {
if (auto s_previewPlugin = getPreviewPlugin()) { if (auto s_previewPlugin = getPreviewPlugin()) {
bool hasZoomFactor = s_previewPlugin->setProperty("zoomFactor", zoomFactor); bool hasZoomFactor = s_previewPlugin->setProperty("zoomFactor", zoomFactor);
@@ -156,7 +156,7 @@ void QmlPreviewPlugin::setZoomFactor(float zoomFactor)
} }
} }
void QmlPreviewPlugin::setLanguageLocale(const QString &locale) void QmlPreviewWidgetPlugin::setLanguageLocale(const QString &locale)
{ {
if (auto s_previewPlugin = getPreviewPlugin()) { if (auto s_previewPlugin = getPreviewPlugin()) {
bool hasLocaleIsoCode = s_previewPlugin->setProperty("localeIsoCode", locale); bool hasLocaleIsoCode = s_previewPlugin->setProperty("localeIsoCode", locale);
@@ -164,7 +164,7 @@ void QmlPreviewPlugin::setLanguageLocale(const QString &locale)
} }
} }
QObject *QmlPreviewPlugin::getPreviewPlugin() QObject *QmlPreviewWidgetPlugin::getPreviewPlugin()
{ {
const QVector<ExtensionSystem::PluginSpec *> &specs = ExtensionSystem::PluginManager::plugins(); const QVector<ExtensionSystem::PluginSpec *> &specs = ExtensionSystem::PluginManager::plugins();
const auto pluginIt = std::find_if(specs.cbegin(), specs.cend(), const auto pluginIt = std::find_if(specs.cbegin(), specs.cend(),

View File

@@ -33,18 +33,18 @@ QT_FORWARD_DECLARE_CLASS(QAction)
namespace QmlDesigner { namespace QmlDesigner {
class QmlPreviewPlugin : public QObject, QmlDesigner::IWidgetPlugin class QmlPreviewWidgetPlugin : public QObject, QmlDesigner::IWidgetPlugin
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QmlDesignerPlugin" FILE "qmlpreviewplugin.json") Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QmlDesignerPlugin" FILE "qmlpreviewplugin.json")
Q_DISABLE_COPY(QmlPreviewPlugin) Q_DISABLE_COPY(QmlPreviewWidgetPlugin)
Q_INTERFACES(QmlDesigner::IWidgetPlugin) Q_INTERFACES(QmlDesigner::IWidgetPlugin)
public: public:
QmlPreviewPlugin(); QmlPreviewWidgetPlugin();
~QmlPreviewPlugin() override = default; ~QmlPreviewWidgetPlugin() override = default;
QString metaInfo() const override; QString metaInfo() const override;
QString pluginName() const override; QString pluginName() const override;

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(StudioPlugin add_qtc_plugin(StudioPlugin
PLUGIN_CLASS StudioPlugin
CONDITION TARGET QmlDesigner CONDITION TARGET QmlDesigner
DEPENDS Core QmlDesigner Utils ProjectExplorer DEPENDS Core QmlDesigner Utils ProjectExplorer
SOURCES SOURCES

View File

@@ -29,6 +29,8 @@
#if defined(QMLJSEDITOR_LIBRARY) #if defined(QMLJSEDITOR_LIBRARY)
# define QMLJSEDITOR_EXPORT Q_DECL_EXPORT # define QMLJSEDITOR_EXPORT Q_DECL_EXPORT
#elif defined(QMLJSEDITOR_STATIC_LIBRARY)
# define QMLJSEDITOR_EXPORT
#else #else
# define QMLJSEDITOR_EXPORT Q_DECL_IMPORT # define QMLJSEDITOR_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,7 +29,7 @@
#if defined(QMLJSTOOLS_LIBRARY) #if defined(QMLJSTOOLS_LIBRARY)
# define QMLJSTOOLS_EXPORT Q_DECL_EXPORT # define QMLJSTOOLS_EXPORT Q_DECL_EXPORT
#elif defined(QMLJSTOOLS_STATIC) #elif defined(QMLJSTOOLS_STATIC_LIBRARY)
# define QMLJSTOOLS_EXPORT # define QMLJSTOOLS_EXPORT
#else #else
# define QMLJSTOOLS_EXPORT Q_DECL_IMPORT # define QMLJSTOOLS_EXPORT Q_DECL_IMPORT

View File

@@ -29,6 +29,8 @@
#if defined(QMLPREVIEW_LIBRARY) #if defined(QMLPREVIEW_LIBRARY)
# define QMLPREVIEW_EXPORT Q_DECL_EXPORT # define QMLPREVIEW_EXPORT Q_DECL_EXPORT
#elif defined(QMLPREVIEW_STATIC_LIBRARY)
# define QMLPREVIEW_EXPORT
#else #else
# define QMLPREVIEW_EXPORT Q_DECL_IMPORT # define QMLPREVIEW_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(QMLPROFILER_LIBRARY) #if defined(QMLPROFILER_LIBRARY)
# define QMLPROFILER_EXPORT Q_DECL_EXPORT # define QMLPROFILER_EXPORT Q_DECL_EXPORT
#elif defined(QMLPROFILER_STATIC_LIBRARY)
# define QMLPROFILER_EXPORT
#else #else
# define QMLPROFILER_EXPORT Q_DECL_IMPORT # define QMLPROFILER_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(QmlProjectManager add_qtc_plugin(QmlProjectManager
PLUGIN_CLASS QmlProjectPlugin
DEPENDS QmlJS DEPENDS QmlJS
PLUGIN_DEPENDS Core ProjectExplorer QtSupport PLUGIN_DEPENDS Core ProjectExplorer QtSupport
SOURCES SOURCES

View File

@@ -29,6 +29,8 @@
#if defined(QMLPROJECTMANAGER_LIBRARY) #if defined(QMLPROJECTMANAGER_LIBRARY)
# define QMLPROJECTMANAGER_EXPORT Q_DECL_EXPORT # define QMLPROJECTMANAGER_EXPORT Q_DECL_EXPORT
#elif defined(QMLPROJECTMANAGER_STATIC_LIBRARY)
# define QMLPROJECTMANAGER_EXPORT
#else #else
# define QMLPROJECTMANAGER_EXPORT Q_DECL_IMPORT # define QMLPROJECTMANAGER_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(QTSUPPORT_LIBRARY) #if defined(QTSUPPORT_LIBRARY)
# define QTSUPPORT_EXPORT Q_DECL_EXPORT # define QTSUPPORT_EXPORT Q_DECL_EXPORT
#elif defined(QTSUPPORT_STATIC_LIBRARY)
# define QTSUPPORT_EXPORT
#else #else
# define QTSUPPORT_EXPORT Q_DECL_IMPORT # define QTSUPPORT_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(REMOTELINUX_LIBRARY) #if defined(REMOTELINUX_LIBRARY)
# define REMOTELINUX_EXPORT Q_DECL_EXPORT # define REMOTELINUX_EXPORT Q_DECL_EXPORT
#elif defined(REMOTELINUX_STATIC_LIBRARY)
# define REMOTELINUX_EXPORT
#else #else
# define REMOTELINUX_EXPORT Q_DECL_IMPORT # define REMOTELINUX_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -1,6 +1,5 @@
add_qtc_plugin(ResourceEditor add_qtc_plugin(ResourceEditor
DEPENDS Qt5::Xml DEPENDS Qt5::Xml
DEFINES RESOURCE_LIBRARY
PLUGIN_DEPENDS Core ProjectExplorer PLUGIN_DEPENDS Core ProjectExplorer
SOURCES SOURCES
qrceditor/qrceditor.cpp qrceditor/qrceditor.h qrceditor/qrceditor.ui qrceditor/qrceditor.cpp qrceditor/qrceditor.h qrceditor/qrceditor.ui

View File

@@ -27,8 +27,10 @@
#include <qglobal.h> #include <qglobal.h>
#if defined(RESOURCE_LIBRARY) #if defined(RESOURCEEDITOR_LIBRARY)
# define RESOURCE_EXPORT Q_DECL_EXPORT # define RESOURCE_EXPORT Q_DECL_EXPORT
#elif defined(RESOURCEEDITOR_STATIC_LIBRARY)
# define RESOURCE_EXPORT
#else #else
# define RESOURCE_EXPORT Q_DECL_IMPORT # define RESOURCE_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(TEXTEDITOR_LIBRARY) #if defined(TEXTEDITOR_LIBRARY)
# define TEXTEDITOR_EXPORT Q_DECL_EXPORT # define TEXTEDITOR_EXPORT Q_DECL_EXPORT
#elif defined(TEXTEDITOR_STATIC_LIBRARY)
# define TEXTEDITOR_EXPORT
#else #else
# define TEXTEDITOR_EXPORT Q_DECL_IMPORT # define TEXTEDITOR_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -56,7 +56,7 @@
#include <memory> #include <memory>
Q_LOGGING_CATEGORY(log, "qtc.updateinfo", QtWarningMsg) Q_LOGGING_CATEGORY(updateLog, "qtc.updateinfo", QtWarningMsg)
const char UpdaterGroup[] = "Updater"; const char UpdaterGroup[] = "Updater";
const char MaintenanceToolKey[] = "MaintenanceTool"; const char MaintenanceToolKey[] = "MaintenanceTool";
@@ -274,22 +274,22 @@ void UpdateInfoPlugin::checkForUpdatesFinished()
{ {
setLastCheckDate(QDate::currentDate()); setLastCheckDate(QDate::currentDate());
qCDebug(log) << "--- MaintenanceTool output (updates):"; qCDebug(updateLog) << "--- MaintenanceTool output (updates):";
qCDebug(log) << qPrintable(d->m_updateOutput); qCDebug(updateLog) << qPrintable(d->m_updateOutput);
qCDebug(log) << "--- MaintenanceTool output (packages):"; qCDebug(updateLog) << "--- MaintenanceTool output (packages):";
qCDebug(log) << qPrintable(d->m_packagesOutput); qCDebug(updateLog) << qPrintable(d->m_packagesOutput);
stopCheckForUpdates(); stopCheckForUpdates();
const QList<Update> updates = availableUpdates(d->m_updateOutput); const QList<Update> updates = availableUpdates(d->m_updateOutput);
const QList<QtPackage> qtPackages = availableQtPackages(d->m_packagesOutput); const QList<QtPackage> qtPackages = availableQtPackages(d->m_packagesOutput);
if (log().isDebugEnabled()) { if (updateLog().isDebugEnabled()) {
qCDebug(log) << "--- Available updates:"; qCDebug(updateLog) << "--- Available updates:";
for (const Update &u : updates) for (const Update &u : updates)
qCDebug(log) << u.name << u.version; qCDebug(updateLog) << u.name << u.version;
qCDebug(log) << "--- Available Qt packages:"; qCDebug(updateLog) << "--- Available Qt packages:";
for (const QtPackage &p : qtPackages) { for (const QtPackage &p : qtPackages) {
qCDebug(log) << p.displayName << p.version << "installed:" << p.installed qCDebug(updateLog) << p.displayName << p.version << "installed:" << p.installed
<< "prerelease:" << p.isPrerelease; << "prerelease:" << p.isPrerelease;
} }
} }

View File

@@ -34,7 +34,7 @@
#include <QRegularExpression> #include <QRegularExpression>
#include <QVersionNumber> #include <QVersionNumber>
Q_DECLARE_LOGGING_CATEGORY(log) Q_DECLARE_LOGGING_CATEGORY(updateLog)
struct Update struct Update
{ {
@@ -133,8 +133,8 @@ Utils::optional<QtPackage> qtToNagAbout(const QList<QtPackage> &allPackages,
if (packages.isEmpty()) if (packages.isEmpty())
return {}; return {};
const QtPackage highest = packages.constFirst(); const QtPackage highest = packages.constFirst();
qCDebug(log) << "Highest available (non-prerelease) Qt:" << highest.version; qCDebug(updateLog) << "Highest available (non-prerelease) Qt:" << highest.version;
qCDebug(log) << "Highest previously seen (non-prerelease) Qt:" << *highestSeen; qCDebug(updateLog) << "Highest previously seen (non-prerelease) Qt:" << *highestSeen;
// if the highestSeen version is null, we don't know if the Qt version is new, and better don't nag // if the highestSeen version is null, we don't know if the Qt version is new, and better don't nag
const bool isNew = !highestSeen->isNull() && highest.version > *highestSeen; const bool isNew = !highestSeen->isNull() && highest.version > *highestSeen;
if (highestSeen->isNull() || isNew) if (highestSeen->isNull() || isNew)
@@ -142,7 +142,7 @@ Utils::optional<QtPackage> qtToNagAbout(const QList<QtPackage> &allPackages,
if (!isNew) if (!isNew)
return {}; return {};
const Utils::optional<QtPackage> highestInstalled = highestInstalledQt(packages); const Utils::optional<QtPackage> highestInstalled = highestInstalledQt(packages);
qCDebug(log) << "Highest installed Qt:" qCDebug(updateLog) << "Highest installed Qt:"
<< qPrintable(highestInstalled ? highestInstalled->version.toString() << qPrintable(highestInstalled ? highestInstalled->version.toString()
: QString("none")); : QString("none"));
if (!highestInstalled) // don't nag if no Qt is installed at all if (!highestInstalled) // don't nag if no Qt is installed at all

View File

@@ -1,4 +1,5 @@
add_qtc_plugin(VcsBase add_qtc_plugin(VcsBase
PLUGIN_CLASS VcsPlugin
PLUGIN_DEPENDS Core DiffEditor ProjectExplorer TextEditor PLUGIN_DEPENDS Core DiffEditor ProjectExplorer TextEditor
PLUGIN_RECOMMENDS CodePaster CppEditor PLUGIN_RECOMMENDS CodePaster CppEditor
SOURCES SOURCES

View File

@@ -29,6 +29,8 @@
#if defined(VCSBASE_LIBRARY) #if defined(VCSBASE_LIBRARY)
# define VCSBASE_EXPORT Q_DECL_EXPORT # define VCSBASE_EXPORT Q_DECL_EXPORT
#elif defined(VCSBASE_STATIC_LIBRARY)
# define VCSBASE_EXPORT
#else #else
# define VCSBASE_EXPORT Q_DECL_IMPORT # define VCSBASE_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -12,7 +12,7 @@ if (isMultiConfig)
endif() endif()
add_qtc_library(shared_help STATIC add_qtc_library(shared_help STATIC
DEPENDS Utils PUBLIC Qt5::Help Qt5::PrintSupport Qt5::Widgets DEPENDS Utils Core PUBLIC Qt5::Help Qt5::PrintSupport Qt5::Widgets
PUBLIC_INCLUDES PUBLIC_INCLUDES
"${PLUGIN_SOURCE_DIR}/help" "${PLUGIN_SOURCE_DIR}/help"
"${PLUGIN_SOURCE_DIR}" "${PLUGIN_SOURCE_DIR}"

View File

@@ -2,7 +2,8 @@ add_qtc_library(clangbackend_lib STATIC
DEPENDS libclang DEPENDS libclang
PUBLIC_DEPENDS PUBLIC_DEPENDS
Qt5::Widgets # FIXME: change the way to get the gui pch to linkto Qt5::Widgets # FIXME: change the way to get the gui pch to linkto
DEFINES PUBLIC_DEFINES
$<TARGET_PROPERTY:ClangSupport,INTERFACE_COMPILE_DEFINITIONS>
$<TARGET_PROPERTY:Sqlite,INTERFACE_COMPILE_DEFINITIONS> $<TARGET_PROPERTY:Sqlite,INTERFACE_COMPILE_DEFINITIONS>
INCLUDES INCLUDES
$<TARGET_PROPERTY:ClangSupport,INTERFACE_INCLUDE_DIRECTORIES> $<TARGET_PROPERTY:ClangSupport,INTERFACE_INCLUDE_DIRECTORIES>

View File

@@ -3,7 +3,7 @@ set(UTILSDIR "${PROJECT_SOURCE_DIR}/src/libs/utils")
add_qtc_executable(qtcreator_processlauncher add_qtc_executable(qtcreator_processlauncher
INCLUDES "${UTILSDIR}" INCLUDES "${UTILSDIR}"
DEPENDS Qt5::Core Qt5::Network DEPENDS Qt5::Core Qt5::Network
DEFINES QTCREATOR_UTILS_STATIC_LIB DEFINES UTILS_STATIC_LIBRARY
SOURCES SOURCES
launcherlogging.cpp launcherlogging.cpp
launcherlogging.h launcherlogging.h

View File

@@ -66,7 +66,7 @@ add_qtc_library(sdktoolLib
extend_qtc_library(sdktoolLib extend_qtc_library(sdktoolLib
SOURCES_PREFIX "${UtilsSourcesDir}" SOURCES_PREFIX "${UtilsSourcesDir}"
PUBLIC_DEFINES QTCREATOR_UTILS_STATIC_LIB PUBLIC_DEFINES UTILS_STATIC_LIBRARY
SOURCES SOURCES
commandline.cpp commandline.h commandline.cpp commandline.h
environment.cpp environment.h environment.cpp environment.h
@@ -109,7 +109,7 @@ add_qtc_executable(sdktool
main.cpp main.cpp
) )
if (MSVC AND TARGET sdktool) if (MSVC AND TARGET sdktool AND Qt5_VERSION VERSION_LESS 6.0.0)
# find out if Qt is static and set /MT if so # find out if Qt is static and set /MT if so
get_target_property(_input_type Qt5::Core TYPE) get_target_property(_input_type Qt5::Core TYPE)
if (${_input_type} STREQUAL "STATIC_LIBRARY") if (${_input_type} STREQUAL "STATIC_LIBRARY")

View File

@@ -29,6 +29,8 @@
#if defined(PLUGIN1_LIBRARY) #if defined(PLUGIN1_LIBRARY)
# define PLUGIN1_EXPORT Q_DECL_EXPORT # define PLUGIN1_EXPORT Q_DECL_EXPORT
#elif defined(PLUGIN1_STATIC_LIBRARY)
# define PLUGIN1_EXPORT
#else #else
# define PLUGIN1_EXPORT Q_DECL_IMPORT # define PLUGIN1_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(PLUGIN2_LIBRARY) #if defined(PLUGIN2_LIBRARY)
# define PLUGIN2_EXPORT Q_DECL_EXPORT # define PLUGIN2_EXPORT Q_DECL_EXPORT
#elif defined(PLUGIN2_STATIC_LIBRARY)
# define PLUGIN2_EXPORT
#else #else
# define PLUGIN2_EXPORT Q_DECL_IMPORT # define PLUGIN2_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -32,6 +32,8 @@
#if defined(PLUGIN3_LIBRARY) #if defined(PLUGIN3_LIBRARY)
# define PLUGIN3_EXPORT Q_DECL_EXPORT # define PLUGIN3_EXPORT Q_DECL_EXPORT
#elif defined(PLUGIN3_STATIC_LIBRARY)
# define PLUGIN3_EXPORT
#else #else
# define PLUGIN3_EXPORT Q_DECL_IMPORT # define PLUGIN3_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(PLUGIN1_LIBRARY) #if defined(PLUGIN1_LIBRARY)
# define PLUGIN1_EXPORT Q_DECL_EXPORT # define PLUGIN1_EXPORT Q_DECL_EXPORT
#elif defined(PLUGIN1_STATIC_LIBRARY)
# define PLUGIN1_EXPORT
#else #else
# define PLUGIN1_EXPORT Q_DECL_IMPORT # define PLUGIN1_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(PLUGIN2_LIBRARY) #if defined(PLUGIN2_LIBRARY)
# define PLUGIN2_EXPORT Q_DECL_EXPORT # define PLUGIN2_EXPORT Q_DECL_EXPORT
#elif defined(PLUGIN2_STATIC_LIBRARY)
# define PLUGIN2_EXPORT
#else #else
# define PLUGIN2_EXPORT Q_DECL_IMPORT # define PLUGIN2_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -29,6 +29,8 @@
#if defined(PLUGIN3_LIBRARY) #if defined(PLUGIN3_LIBRARY)
# define PLUGIN3_EXPORT Q_DECL_EXPORT # define PLUGIN3_EXPORT Q_DECL_EXPORT
#elif defined(PLUGIN3_STATIC_LIBRARY)
# define PLUGIN3_EXPORT
#else #else
# define PLUGIN3_EXPORT Q_DECL_IMPORT # define PLUGIN3_EXPORT Q_DECL_IMPORT
#endif #endif

View File

@@ -27,7 +27,7 @@
#include <updateinfo/updateinfotools.h> #include <updateinfo/updateinfotools.h>
Q_LOGGING_CATEGORY(log, "qtc.updateinfo", QtWarningMsg) Q_LOGGING_CATEGORY(updateLog, "qtc.updateinfo", QtWarningMsg)
class tst_UpdateInfo : public QObject class tst_UpdateInfo : public QObject
{ {

View File

@@ -152,7 +152,7 @@ if (NOT TARGET Sqlite)
add_subdirectory(../../../src/libs/sqlite ${CMAKE_CURRENT_BINARY_DIR}/sqlite) add_subdirectory(../../../src/libs/sqlite ${CMAKE_CURRENT_BINARY_DIR}/sqlite)
endif() endif()
extend_qtc_test_with_target_sources(Sqlite extend_qtc_test_with_target_sources(Sqlite
DEFINES SQLITE_CUSTOM_INCLUDE=config.h DEFINES SQLITE_CUSTOM_INCLUDE=config.h SQLITE_STATIC_LIBRARY
) )
if (APPLE) if (APPLE)
@@ -258,7 +258,7 @@ extend_qtc_test(unittest
"${QmlDesignerDir}/../../../share/qtcreator/qml/qmlpuppet/interfaces" "${QmlDesignerDir}/../../../share/qtcreator/qml/qmlpuppet/interfaces"
"${QmlDesignerDir}/../../../share/qtcreator/qml/qmlpuppet/types" "${QmlDesignerDir}/../../../share/qtcreator/qml/qmlpuppet/types"
DEFINES DEFINES
QMLDESIGNER_TEST DESIGNER_STATIC_CORE_LIBRARY QMLDESIGNER_TEST QMLDESIGNER_STATIC_LIBRARY
SOURCES_PREFIX SOURCES_PREFIX
"${QmlDesignerDir}" "${QmlDesignerDir}"
SOURCES SOURCES