summaryrefslogtreecommitdiffstats
path: root/Source/cmake/OptionsQt.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmake/OptionsQt.cmake')
-rw-r--r--Source/cmake/OptionsQt.cmake42
1 files changed, 41 insertions, 1 deletions
diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
index 7e1e55340..ec6081de0 100644
--- a/Source/cmake/OptionsQt.cmake
+++ b/Source/cmake/OptionsQt.cmake
@@ -20,7 +20,7 @@ if (QT_CONAN_DIR)
include("${QT_CONAN_DIR}/conanbuildinfo.cmake")
# Remove this workaround when libxslt package is fixed
- string(REPLACE "include/libxslt" "include" replace_CONAN_INCLUDE_DIRS ${CONAN_INCLUDE_DIRS})
+ string(REPLACE "include/libxslt" "include" replace_CONAN_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS}")
set(CONAN_INCLUDE_DIRS ${replace_CONAN_INCLUDE_DIRS})
# Remove this workaround when libxml2 package is fixed
@@ -29,6 +29,15 @@ if (QT_CONAN_DIR)
set(CMAKE_MODULE_PATH ${_BACKUP_CMAKE_MODULE_PATH})
unset(_BACKUP_CMAKE_MODULE_PATH)
+ # Because we've reset CMAKE_MODULE_PATH, FindZLIB from Conan is not used, which causes error with MinGW
+ if (NOT QT_BUNDLED_ZLIB)
+ if (NOT CONAN_ZLIB_ROOT)
+ message(FATAL_ERROR "CONAN_ZLIB_ROOT is not set")
+ endif ()
+ set(ZLIB_ROOT ${CONAN_ZLIB_ROOT})
+ message(STATUS "ZLIB_ROOT: ${ZLIB_ROOT}")
+ endif ()
+
install(CODE "
set(_conan_imports_dest \${CMAKE_INSTALL_PREFIX})
if (DEFINED ENV{DESTDIR})
@@ -147,6 +156,24 @@ macro(QTWEBKIT_GENERATE_MOC_FILES_H _target)
endforeach ()
endmacro()
+macro(QTWEBKIT_SEPARATE_DEBUG_INFO _target _target_debug)
+ if (UNIX AND NOT APPLE)
+ if (NOT CMAKE_OBJCOPY)
+ message(WARNING "CMAKE_OBJCOPY is not defined - debug information will not be split")
+ else ()
+ set(_target_file "$<TARGET_FILE:${_target}>")
+ set(${_target_debug} "${_target_file}.debug")
+ add_custom_command(TARGET ${_target} POST_BUILD
+ COMMAND ${CMAKE_OBJCOPY} --only-keep-debug ${_target_file} ${${_target_debug}}
+ COMMAND ${CMAKE_OBJCOPY} --strip-debug ${_target_file}
+ COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=${${_target_debug}} ${_target_file}
+ VERBATIM
+ )
+ unset(_target_file)
+ endif ()
+ endif ()
+endmacro()
+
set(CMAKE_MACOSX_RPATH ON)
add_definitions(-DBUILDING_QT__=1)
@@ -698,6 +725,19 @@ if (WIN32 AND COMPILER_IS_GCC_OR_CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport")
endif ()
+# See also FORCE_DEBUG_INFO in Source/PlatformQt.cmake
+if (FORCE_DEBUG_INFO)
+ if (COMPILER_IS_GCC_OR_CLANG)
+ # Enable debug info in Release builds
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -g")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g")
+ endif ()
+ if (USE_LD_GOLD)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index")
+ endif ()
+endif ()
+
if (APPLE)
SET_AND_EXPOSE_TO_BUILD(HAVE_QOS_CLASSES 1)
endif ()