Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/cmake/modules/psi-cmake-functions.cmake b/cmake/modules/psi-cmake-functions.cmake
- new file mode 100644
- index 00000000..b8fb3836
- --- /dev/null
- +++ b/cmake/modules/psi-cmake-functions.cmake
- @@ -0,0 +1,123 @@
- +cmake_minimum_required(VERSION 3.10.0)
- +
- +#detect MXE ervironment
- +macro(check_MXE RESULT)
- + set(_USE_MXE OFF)
- + if(EXISTS "${CMAKE_TOOLCHAIN_FILE}")
- + string(TOLOWER ${CMAKE_TOOLCHAIN_FILE} TOOLCHAIN_FILE)
- + string(REGEX MATCH "mxe-conf" MXE_DETECTED "${TOOLCHAIN_FILE}")
- + if(MXE_DETECTED)
- + message(STATUS "MXE environment detected")
- + set(_USE_MXE ON)
- + message(STATUS "MXE toolchain: ${CMAKE_TOOLCHAIN_FILE}")
- + message(STATUS "MXE root path: ${CMAKE_PREFIX_PATH}")
- + if(IS_WEBENGINE)
- + message(FATAL_ERROR "Webengine is not available in MXE. Please set the CHAT_TYPE variable to Webkit or Basic")
- + endif()
- + endif()
- + endif()
- + set(${RESULT} ${_USE_MXE})
- +endmacro()
- +
- +
- +# Copy a list of files from one directory to another. Only full paths.
- +function(copy SOURCE DEST TARGET)
- + if(EXISTS ${SOURCE})
- + set(OUT_TARGET_FILE "${CMAKE_BINARY_DIR}/${TARGET}.cmake")
- +
- + string(REGEX REPLACE "\\\\+" "/" DEST "${DEST}")
- + string(REGEX REPLACE "\\\\+" "/" SOURCE "${SOURCE}")
- +
- + if(NOT TARGET ${TARGET})
- + file(REMOVE "${OUT_TARGET_FILE}")
- + add_custom_target(${TARGET} COMMAND ${CMAKE_COMMAND} -P "${OUT_TARGET_FILE}")
- + endif()
- +
- + if(IS_DIRECTORY ${SOURCE})
- + # copy directory
- + file(GLOB_RECURSE FILES "${SOURCE}/*")
- + get_filename_component(SOURCE_DIR_NAME ${SOURCE} NAME)
- +
- + foreach(FILE ${FILES})
- + file(RELATIVE_PATH REL_PATH ${SOURCE} ${FILE})
- + set(REL_PATH "${SOURCE_DIR_NAME}/${REL_PATH}")
- + get_filename_component(REL_PATH ${REL_PATH} DIRECTORY)
- + set(DESTIN "${DEST}/${REL_PATH}")
- +
- + string(REGEX REPLACE "/+" "/" DESTIN ${DESTIN})
- + string(REGEX REPLACE "/+" "/" FILE ${FILE})
- +
- + file(APPEND
- + "${OUT_TARGET_FILE}"
- + "file(INSTALL \"${FILE}\" DESTINATION \"${DESTIN}\" USE_SOURCE_PERMISSIONS)\n")
- + endforeach()
- + else()
- + string(REPLACE "//" "/" DEST ${DEST})
- + if(DEST MATCHES "/$")
- + set(DIR "${DEST}")
- + string(REGEX REPLACE "^(.+)/$" "\\1" DIR ${DIR})
- + else()
- + # need to copy and rename
- + get_filename_component(DIR ${DEST} DIRECTORY)
- + get_filename_component(FILENAME ${DEST} NAME)
- + get_filename_component(SOURCE_FILENAME ${SOURCE} NAME)
- + endif()
- + file(APPEND
- + "${OUT_TARGET_FILE}"
- + "file(INSTALL \"${SOURCE}\" DESTINATION \"${DIR}\" USE_SOURCE_PERMISSIONS)\n")
- + if(DEFINED FILENAME)
- + file(APPEND
- + "${OUT_TARGET_FILE}"
- + "file(RENAME \"${DIR}/${SOURCE_FILENAME}\" \"${DIR}/${FILENAME}\")\n")
- + endif()
- + endif()
- + endif()
- +endfunction()
- +
- +#Copy default iconsets to build directory and add jisp files to prepare-bin target
- +function(prepare_iconsets ACTION)
- + file(GLOB_RECURSE all_iconsets "${PROJECT_SOURCE_DIR}/iconsets/*")
- + message(STATUS "Processing iconsets for ${ACTION}")
- + foreach(_ITEM ${all_iconsets})
- + get_filename_component(FNAME ${_ITEM} NAME)
- + file(RELATIVE_PATH FREL ${PROJECT_SOURCE_DIR} ${_ITEM})
- + get_filename_component(FDIR ${FREL} DIRECTORY)
- + if(NOT ${ACTION} STREQUAL "prepare-bin")
- + if("${_ITEM}" MATCHES ".*/default/.*" AND (NOT "${_ITEM}" MATCHES ".*/system/default/icondef.xml"))
- + configure_file(${_ITEM} "${CMAKE_CURRENT_BINARY_DIR}/${FDIR}/${FNAME}" COPYONLY)
- + endif()
- + else()
- + if(NOT "${_ITEM}" MATCHES ".*/default/.*|.*README")
- + copy(${_ITEM} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${FDIR}/${FNAME}" ${ACTION})
- + endif()
- + endif()
- + unset(_ITEM)
- + unset(FNAME)
- + unset(FREL)
- + unset(FDIR)
- + endforeach()
- +endfunction()
- +
- +if(WIN32)
- + function(compile_rc_file RC_FILE_NAME RC_OUTPUT_NAME)
- + if(NOT MSVC)
- + set(CMD_ARG
- + --include=${CMAKE_CURRENT_SOURCE_DIR}
- + --input=${RC_FILE_NAME}
- + --output=${RC_OUTPUT_NAME}
- + )
- + else()
- + set(CMD_ARG
- + /fo
- + ${RC_OUTPUT_NAME}
- + ${RC_FILE_NAME}
- + )
- + endif()
- + add_custom_command(OUTPUT ${RC_OUTPUT_NAME}
- + COMMAND ${CMAKE_RC_COMPILER}
- + ARGS ${CMD_ARG}
- + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/win32
- + VERBATIM
- + )
- + endfunction()
- +endif()
- diff --git a/CMakeLists.txt b/CMakeLists.txt
- index e96f3bb0..10850866 100644
- --- a/CMakeLists.txt
- +++ b/CMakeLists.txt
- @@ -19,6 +19,11 @@ else()
- message(STATUS "===Building Psi===")
- endif()
- +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" )
- +
- +include(psi-cmake-functions)
- +include(policyRules)
- +
- # Define LINUX on Linux like as WIN32 on Windows and APPLE on macOS
- if(UNIX AND NOT (APPLE OR HAIKU))
- set(LINUX ON)
- @@ -37,13 +42,16 @@ foreach(submodule ${SBM_LIST})
- endif()
- endforeach()
- +# Detect MXE cross-compilation
- +check_MXE(DEFAULT_USE_MXE)
- +
- set( DEFAULT_BUNDLED_QCA OFF )
- -if (APPLE OR ((MSVC OR USE_MXE) OR BUNDLED_IRIS_ALL))
- +if (APPLE OR ((MSVC OR DEFAULT_USE_MXE) OR BUNDLED_IRIS_ALL))
- set( DEFAULT_BUNDLED_QCA ON )
- endif()
- set( DEFAULT_BUNDLED_USRSCTP OFF )
- -if (APPLE OR ((MSVC OR USE_MXE) OR BUNDLED_IRIS_ALL))
- +if (APPLE OR ((MSVC OR DEFAULT_USE_MXE) OR BUNDLED_IRIS_ALL))
- set( DEFAULT_BUNDLED_USRSCTP ON )
- endif()
- @@ -79,7 +87,7 @@ endif()
- # Cross-compilation and native builds for MS Windows
- option( ENABLE_PORTABLE "Create portable version of Psi+ for MS Windows" OFF )
- -option( USE_MXE "Use MXE (cross-compilation build environment for MS Windows)" OFF )
- +option( USE_MXE "Use MXE (cross-compilation build environment for MS Windows)" ${DEFAULT_USE_MXE} )
- # Other systems
- if(LINUX)
- @@ -112,10 +120,6 @@ endif()
- set( GLOBAL_DEPENDS_DEBUG_MODE ON )
- -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" )
- -
- -include(policyRules)
- -
- set(IS_WEBKIT OFF CACHE INTERNAL "Use webkit. Internal variable")
- set(IS_WEBENGINE OFF CACHE INTERNAL "Use webengine. Internal variable")
- string(TOLOWER "${CHAT_TYPE}" LCHAT_TYPE)
- @@ -176,20 +180,8 @@ if(USE_CRASH)
- add_definitions(-DUSE_CRASH)
- endif()
- -# Detect MXE cross-compilation
- -if(EXISTS "${CMAKE_TOOLCHAIN_FILE}")
- - string(TOLOWER ${CMAKE_TOOLCHAIN_FILE} TOOLCHAIN_FILE)
- - string(REGEX MATCH "mxe-conf" MXE_DETECTED "${TOOLCHAIN_FILE}")
- - if(MXE_DETECTED)
- - message(STATUS "MXE environment detected")
- - set(USE_MXE ON)
- - message(STATUS "MXE toolchain: ${CMAKE_TOOLCHAIN_FILE}")
- - message(STATUS "MXE root path: ${CMAKE_PREFIX_PATH}")
- - if(IS_WEBENGINE)
- - message(FATAL_ERROR "Webengine is not available in MXE. Please set the CHAT_TYPE variable to Webkit or Basic")
- - endif()
- - set(BUNDLED_IRIS_ALL ON)
- - endif()
- +if(USE_MXE)
- + set(BUNDLED_IRIS_ALL ON)
- endif()
- # For GNU/Linux and *BSD systems:
- @@ -289,60 +281,6 @@ if(IRIS_BUNDLED_QCA)
- add_definitions(-DQCA_STATIC)
- endif()
- -# Copy a list of files from one directory to another. Only full paths.
- -function(copy SOURCE DEST TARGET)
- - if(EXISTS ${SOURCE})
- - set(OUT_TARGET_FILE "${CMAKE_BINARY_DIR}/${TARGET}.cmake")
- -
- - string(REGEX REPLACE "\\\\+" "/" DEST "${DEST}")
- - string(REGEX REPLACE "\\\\+" "/" SOURCE "${SOURCE}")
- -
- - if(NOT TARGET ${TARGET})
- - file(REMOVE "${OUT_TARGET_FILE}")
- - add_custom_target(${TARGET} COMMAND ${CMAKE_COMMAND} -P "${OUT_TARGET_FILE}")
- - endif()
- -
- - if(IS_DIRECTORY ${SOURCE})
- - # copy directory
- - file(GLOB_RECURSE FILES "${SOURCE}/*")
- - get_filename_component(SOURCE_DIR_NAME ${SOURCE} NAME)
- -
- - foreach(FILE ${FILES})
- - file(RELATIVE_PATH REL_PATH ${SOURCE} ${FILE})
- - set(REL_PATH "${SOURCE_DIR_NAME}/${REL_PATH}")
- - get_filename_component(REL_PATH ${REL_PATH} DIRECTORY)
- - set(DESTIN "${DEST}/${REL_PATH}")
- -
- - string(REGEX REPLACE "/+" "/" DESTIN ${DESTIN})
- - string(REGEX REPLACE "/+" "/" FILE ${FILE})
- -
- - file(APPEND
- - "${OUT_TARGET_FILE}"
- - "file(INSTALL \"${FILE}\" DESTINATION \"${DESTIN}\" USE_SOURCE_PERMISSIONS)\n")
- - endforeach()
- - else()
- - string(REPLACE "//" "/" DEST ${DEST})
- - if(DEST MATCHES "/$")
- - set(DIR "${DEST}")
- - string(REGEX REPLACE "^(.+)/$" "\\1" DIR ${DIR})
- - else()
- - # need to copy and rename
- - get_filename_component(DIR ${DEST} DIRECTORY)
- - get_filename_component(FILENAME ${DEST} NAME)
- - get_filename_component(SOURCE_FILENAME ${SOURCE} NAME)
- - endif()
- - file(APPEND
- - "${OUT_TARGET_FILE}"
- - "file(INSTALL \"${SOURCE}\" DESTINATION \"${DIR}\" USE_SOURCE_PERMISSIONS)\n")
- - if(DEFINED FILENAME)
- - file(APPEND
- - "${OUT_TARGET_FILE}"
- - "file(RENAME \"${DIR}/${SOURCE_FILENAME}\" \"${DIR}/${FILENAME}\")\n")
- - endif()
- - endif()
- - endif()
- -endfunction()
- -
- if(USE_CCACHE)
- # Configure CCache if available
- find_program(CCACHE_PATH ccache DOC "Path to ccache")
- diff --git a/cmake/modules/FindEnchant.cmake b/cmake/modules/FindEnchant.cmake
- index ae13f34a..99bc91b8 100644
- --- a/cmake/modules/FindEnchant.cmake
- +++ b/cmake/modules/FindEnchant.cmake
- @@ -73,6 +73,8 @@ find_library(
- ${PC_Enchant_LIBRARY_DIRS}
- ${Enchant_ROOT}/lib
- ${Enchant_ROOT}/bin
- + ${Enchant_DIR}/lib
- + ${Enchant_DIR}/bin
- )
- include(FindPackageHandleStandardArgs)
- diff --git a/cmake/modules/FindHttpParser.cmake b/cmake/modules/FindHttpParser.cmake
- index edd14bb1..06bec283 100644
- --- a/cmake/modules/FindHttpParser.cmake
- +++ b/cmake/modules/FindHttpParser.cmake
- @@ -43,6 +43,8 @@ find_library(
- HINTS
- ${HTTP_PARSER_ROOT}/lib
- ${HTTP_PARSER_ROOT}/bin
- + ${HTTP_PARSER_DIR}/lib
- + ${HTTP_PARSER_DIR}/bin
- )
- #Obtain library version
- diff --git a/cmake/modules/FindHunspell.cmake b/cmake/modules/FindHunspell.cmake
- index 6eea5622..9f88862d 100644
- --- a/cmake/modules/FindHunspell.cmake
- +++ b/cmake/modules/FindHunspell.cmake
- @@ -50,11 +50,12 @@ find_path(
- HUNSPELL_INCLUDE_DIR ${LIBINCS}
- HINTS
- ${HUNSPELL_ROOT}/include
- + ${HUNSPELL_DIR}/include
- ${PC_HUNSPELL_INCLUDEDIR}
- ${PC_HUNSPELL_INCLUDE_DIRS}
- PATH_SUFFIXES
- ""
- - if ( NOT ${WIN32} )
- + if ( NOT WIN32 )
- hunspell
- endif()
- )
- @@ -75,6 +76,8 @@ find_library(
- ${PC_HUNSPELL_LIBRARY_DIRS}
- ${HUNSPELL_ROOT}/lib
- ${HUNSPELL_ROOT}/bin
- + ${HUNSPELL_DIR}/lib
- + ${HUNSPELL_DIR}/bin
- )
- include(FindPackageHandleStandardArgs)
- find_package_handle_standard_args(
- diff --git a/cmake/modules/FindMINIZIP.cmake b/cmake/modules/FindMINIZIP.cmake
- index 5e6f77fb..d84fc1dd 100644
- --- a/cmake/modules/FindMINIZIP.cmake
- +++ b/cmake/modules/FindMINIZIP.cmake
- @@ -51,7 +51,7 @@ find_path(
- ${PC_MINIZIP_INCLUDE_DIRS}
- PATH_SUFFIXES
- ""
- - if ( NOT ${WIN32} )
- + if ( NOT WIN32 )
- minizip
- endif()
- )
- @@ -64,6 +64,8 @@ find_library(
- ${PC_MINIZIP_LIBRARY_DIRS}
- ${MINIZIP_ROOT}/lib
- ${MINIZIP_ROOT}/bin
- + ${MINIZIP_DIR}/lib
- + ${MINIZIP_DIR}/bin
- )
- include(FindPackageHandleStandardArgs)
- find_package_handle_standard_args(
- diff --git a/cmake/modules/FindQca.cmake b/cmake/modules/FindQca.cmake
- index 8dcb760e..f2a5f03b 100644
- --- a/cmake/modules/FindQca.cmake
- +++ b/cmake/modules/FindQca.cmake
- @@ -54,8 +54,10 @@ find_library(
- Qca_LIBRARY
- NAMES qca-qt${QT_DEFAULT_MAJOR_VERSION}${D}
- HINTS
- - ${QCA_DIR}/lib
- - ${QCA_DIR}/bin
- + ${Qca_ROOT}/lib
- + ${Qca_ROOT}/bin
- + ${Qca_DIR}/lib
- + ${Qca_DIR}/bin
- )
- include(FindPackageHandleStandardArgs)
- diff --git a/cmake/modules/fix-codestyle.cmake b/cmake/modules/fix-codestyle.cmake
- index 8c0cae45..0e59456a 100644
- --- a/cmake/modules/fix-codestyle.cmake
- +++ b/cmake/modules/fix-codestyle.cmake
- @@ -16,8 +16,8 @@ if(CLF_BIN)
- ../plugins/*.h
- )
- foreach(src_file ${SRC_LIST})
- - #Exclude libpsi
- - if("${src_file}" MATCHES ".*/libpsi/.*")
- + #Exclude iris
- + if("${src_file}" MATCHES ".*/iris/.*")
- list(REMOVE_ITEM SRC_LIST ${src_file})
- endif()
- #Exclude plugins if no ENABLE_PLUGINS flag enabled
- diff --git a/cmake/modules/policyRules.cmake b/cmake/modules/policyRules.cmake
- index d0c39894..b5bcf879 100644
- --- a/cmake/modules/policyRules.cmake
- +++ b/cmake/modules/policyRules.cmake
- @@ -1,13 +1,15 @@
- cmake_minimum_required( VERSION 3.10.0 )
- #Set automoc and autouic policy
- -if(NOT POLICY_SET)
- - if(POLICY CMP0071)
- - cmake_policy(SET CMP0071 NEW)
- +if(POLICY CMP0071)
- + cmake_policy(SET CMP0071 NEW)
- + if(NOT POLICY_SET) #less messages
- message(STATUS "CMP0071 policy set to NEW")
- endif()
- - if(POLICY CMP0074)
- - cmake_policy(SET CMP0074 NEW)
- +endif()
- +if(POLICY CMP0074)
- + cmake_policy(SET CMP0074 NEW)
- + if(NOT POLICY_SET) #less messages
- message(STATUS "CMP0074 policy set to NEW")
- endif()
- - set(POLICY_SET ON)
- endif()
- +set(POLICY_SET ON)
- diff --git a/cmake/modules/win32-prepare-deps.cmake b/cmake/modules/win32-prepare-deps.cmake
- index 9623fada..a6e1595f 100644
- --- a/cmake/modules/win32-prepare-deps.cmake
- +++ b/cmake/modules/win32-prepare-deps.cmake
- @@ -49,15 +49,22 @@ if(WIN32)
- message(STATUS "Qt${QT_DEFAULT_MAJOR_VERSION} directory found at ${QT_DIR}")
- set(QT_PLUGINS_DIR ${QT_DIR}/plugins)
- set(QT_TRANSLATIONS_DIR ${QT_DIR}/translations)
- + #Output pathes
- + set(QT_PLUGINS_OUTPUT "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins")
- + set(QT_LIBS_OUTPUT "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- + if(BUILD_PSIMEDIA)
- + set(PSIMEDIA_LIBS_OUTPUT "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- + endif()
- + set(PSI_LIBS_OUTPUT "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- set(PSIMEDIA_FOUND OFF)
- #Set paths
- list(APPEND PATHES
- ${QT_BIN_DIR}
- - ${QCA_DIR}bin
- - ${QCA_DIR}/bin
- + ${Qca_DIR}bin
- + ${Qca_DIR}/bin
- ${QT_PLUGINS_DIR}/crypto
- - ${QCA_DIR}lib/qca-qt${QT_DEFAULT_MAJOR_VERSION}/crypto
- - ${QCA_DIR}lib/Qca-qt${QT_DEFAULT_MAJOR_VERSION}/crypto
- + ${Qca_DIR}lib/qca-qt${QT_DEFAULT_MAJOR_VERSION}/crypto
- + ${Qca_DIR}lib/Qca-qt${QT_DEFAULT_MAJOR_VERSION}/crypto
- )
- if(USE_MXE)
- list(APPEND PATHES
- @@ -100,7 +107,8 @@ if(WIN32)
- else()
- list(APPEND WDARGS --release)
- endif()
- - list(APPEND WDARGS --plugindir "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins")
- + list(APPEND WDARGS --libdir "${QT_LIBS_OUTPUT}")
- + list(APPEND WDARGS --plugindir "${QT_PLUGINS_OUTPUT}")
- add_custom_target(windeploy
- COMMAND ${WINDEPLOYQTBIN}
- ${WDARGS}
- @@ -133,7 +141,7 @@ if(WIN32)
- )
- endforeach()
- endforeach()
- - find_psi_lib("${ICU_LIBS}" "${PATHES}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- + find_psi_lib("${ICU_LIBS}" "${PATHES}" "${QT_LIBS_OUTPUT}/")
- unset(ICU_LIBS)
- # Qt5 / Qt6 libraries
- set(QT_LIBAS
- @@ -166,42 +174,42 @@ if(WIN32)
- Qt5WinExtras${D}.dll
- )
- endif()
- - find_psi_lib("${QT_LIBAS}" "${QT_BIN_DIR}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- + find_psi_lib("${QT_LIBAS}" "${QT_BIN_DIR}" "${QT_LIBS_OUTPUT}/")
- #
- - find_psi_lib(qtaudio_windows${D}.dll "${QT_PLUGINS_DIR}/audio/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/audio/")
- + find_psi_lib(qtaudio_windows${D}.dll "${QT_PLUGINS_DIR}/audio/" "${QT_PLUGINS_OUTPUT}/audio/")
- set(PLATFORMS_PLUGS
- qdirect2d${D}.dll
- qminimal${D}.dll
- qoffscreen${D}.dll
- qwindows${D}.dll
- )
- - find_psi_lib("${PLATFORMS_PLUGS}" "${QT_PLUGINS_DIR}/platforms/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/platforms/")
- + find_psi_lib("${PLATFORMS_PLUGS}" "${QT_PLUGINS_DIR}/platforms/" "${QT_PLUGINS_OUTPUT}/platforms/")
- #
- set(PLATFORMTHEMES_PLUGS
- qxdgdesktopportal${D}.dll
- )
- - find_psi_lib("${PLATFORMTHEMES_PLUGS}" "${QT_PLUGINS_DIR}/platformthemes/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/platformthemes/")
- + find_psi_lib("${PLATFORMTHEMES_PLUGS}" "${QT_PLUGINS_DIR}/platformthemes/" "${QT_PLUGINS_OUTPUT}/platformthemes/")
- #
- set(STYLES_PLUGS
- qwindowsvistastyle${D}.dll
- )
- - find_psi_lib("${STYLES_PLUGS}" "${QT_PLUGINS_DIR}/styles/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/styles/")
- + find_psi_lib("${STYLES_PLUGS}" "${QT_PLUGINS_DIR}/styles/" "${QT_PLUGINS_OUTPUT}/styles/")
- #
- set(BEARER_PLUGS
- qgenericbearer${D}.dll
- qnativewifibearer${D}.dll
- )
- - find_psi_lib("${BEARER_PLUGS}" "${QT_PLUGINS_DIR}/bearer/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/bearer/")
- + find_psi_lib("${BEARER_PLUGS}" "${QT_PLUGINS_DIR}/bearer/" "${QT_PLUGINS_OUTPUT}/bearer/")
- #
- set(GENERIC_PLUGS
- qtuiotouchplugin${D}.dll
- )
- - find_psi_lib("${GENERIC_PLUGS}" "${QT_PLUGINS_DIR}/generic/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/generic/")
- + find_psi_lib("${GENERIC_PLUGS}" "${QT_PLUGINS_DIR}/generic/" "${QT_PLUGINS_OUTPUT}/generic/")
- #
- set(ICONENGINES_PLUGS
- qsvgicon${D}.dll
- )
- - find_psi_lib("${ICONENGINES_PLUGS}" "${QT_PLUGINS_DIR}/iconengines/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/iconengines/")
- + find_psi_lib("${ICONENGINES_PLUGS}" "${QT_PLUGINS_DIR}/iconengines/" "${QT_PLUGINS_OUTPUT}/iconengines/")
- #
- set(IMAGEFORMATS_PLUGS
- qdds${D}.dll
- @@ -217,42 +225,42 @@ if(WIN32)
- qwbmp${D}.dll
- qwebp${D}.dll
- )
- - find_psi_lib("${IMAGEFORMATS_PLUGS}" "${QT_PLUGINS_DIR}/imageformats/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/imageformats/")
- + find_psi_lib("${IMAGEFORMATS_PLUGS}" "${QT_PLUGINS_DIR}/imageformats/" "${QT_PLUGINS_OUTPUT}/imageformats/")
- #
- set(MEDIASERVICE_PLUGS
- dsengine${D}.dll
- qtmedia_audioengine${D}.dll
- wmfengine${D}.dll
- )
- - find_psi_lib("${MEDIASERVICE_PLUGS}" "${QT_PLUGINS_DIR}/mediaservice/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/mediaservice/")
- + find_psi_lib("${MEDIASERVICE_PLUGS}" "${QT_PLUGINS_DIR}/mediaservice/" "${QT_PLUGINS_OUTPUT}/mediaservice/")
- #
- set(MULTIMEDIA_PLUGS
- ffmpegmediaplugin${D}.dll
- windowsmediaplugin${D}.dll
- )
- - find_psi_lib("${MULTIMEDIA_PLUGS}" "${QT_PLUGINS_DIR}/multimedia/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/multimedia/")
- + find_psi_lib("${MULTIMEDIA_PLUGS}" "${QT_PLUGINS_DIR}/multimedia/" "${QT_PLUGINS_OUTPUT}/multimedia/")
- #
- set(NETWORKINFORMATION_PLUGS
- qnetworklistmanager${D}.dll
- )
- - find_psi_lib("${NETWORKINFORMATION_PLUGS}" "${QT_PLUGINS_DIR}/networkinformation/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/networkinformation/")
- + find_psi_lib("${NETWORKINFORMATION_PLUGS}" "${QT_PLUGINS_DIR}/networkinformation/" "${QT_PLUGINS_OUTPUT}/networkinformation/")
- #
- set(POSITION_PLUGS
- qtposition_nmea${D}.dll
- qtposition_positionpoll${D}.dll
- qtposition_winrt${D}.dll
- )
- - find_psi_lib("${POSITION_PLUGS}" "${QT_PLUGINS_DIR}/position/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/position/")
- + find_psi_lib("${POSITION_PLUGS}" "${QT_PLUGINS_DIR}/position/" "${QT_PLUGINS_OUTPUT}/position/")
- #
- set(PLAYLISTFORMATS_PLUGS
- qtmultimedia_m3u${D}.dll
- )
- - find_psi_lib("${PLAYLISTFORMATS_PLUGS}" "${QT_PLUGINS_DIR}/playlistformats/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/playlistformats/")
- + find_psi_lib("${PLAYLISTFORMATS_PLUGS}" "${QT_PLUGINS_DIR}/playlistformats/" "${QT_PLUGINS_OUTPUT}/playlistformats/")
- #
- set(PRINTSUPPORT_PLUGS
- windowsprintersupport${D}.dll
- )
- - find_psi_lib("${PRINTSUPPORT_PLUGS}" "${QT_PLUGINS_DIR}/printsupport/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/printsupport/")
- + find_psi_lib("${PRINTSUPPORT_PLUGS}" "${QT_PLUGINS_DIR}/printsupport/" "${QT_PLUGINS_OUTPUT}/printsupport/")
- #
- set(SQLDRIVERS_PLUGS
- qsqlite${D}.dll
- @@ -260,21 +268,21 @@ if(WIN32)
- qsqlodbc${D}.dll
- qsqlpsql${D}.dll
- )
- - find_psi_lib("${SQLDRIVERS_PLUGS}" "${QT_PLUGINS_DIR}/sqldrivers/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/sqldrivers/")
- + find_psi_lib("${SQLDRIVERS_PLUGS}" "${QT_PLUGINS_DIR}/sqldrivers/" "${QT_PLUGINS_OUTPUT}/sqldrivers/")
- #
- set(TLS_PLUGS
- qcertonlybackend${D}.dll
- qopensslbackend${D}.dll
- qschannelbackend${D}.dll
- )
- - find_psi_lib("${TLS_PLUGS}" "${QT_PLUGINS_DIR}/tls/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/tls/")
- + find_psi_lib("${TLS_PLUGS}" "${QT_PLUGINS_DIR}/tls/" "${QT_PLUGINS_OUTPUT}/tls/")
- #
- if(KEYCHAIN_LIBS)
- set(KEYCHAIN_LIBS
- qt${QT_DEFAULT_MAJOR_VERSION}keychain${D}.dll
- libqt${QT_DEFAULT_MAJOR_VERSION}keychain${D}.dll
- )
- - find_psi_lib("${KEYCHAIN_LIBS}" "${PATHES}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- + find_psi_lib("${KEYCHAIN_LIBS}" "${PATHES}" "${QT_LIBS_OUTPUT}/")
- endif()
- endif()
- # psimedia deps
- @@ -346,7 +354,7 @@ if(WIN32)
- )
- set(PSIMEDIA_DEPS_DIR "${GST_SDK}/bin")
- set(GSTREAMER_PLUGINS_DIR "${GST_SDK}/lib/gstreamer-1.0")
- - set(GST_PLUGINS_OUTPUT "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gstreamer-1.0/")
- + set(GST_PLUGINS_OUTPUT "${PSIMEDIA_LIBS_OUTPUT}/gstreamer-1.0/")
- endif()
- if(USE_MXE)
- set(PSIMEDIA_DEPS
- @@ -404,9 +412,9 @@ if(WIN32)
- )
- set(PSIMEDIA_DEPS_DIR "${CMAKE_PREFIX_PATH}/bin")
- set(GSTREAMER_PLUGINS_DIR "${CMAKE_PREFIX_PATH}/bin/gstreamer-1.0")
- - set(GST_PLUGINS_OUTPUT "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gstreamer-1.0/")
- + set(GST_PLUGINS_OUTPUT "${PSIMEDIA_LIBS_OUTPUT}/gstreamer-1.0/")
- endif()
- - find_psi_lib("${PSIMEDIA_DEPS}" "${PSIMEDIA_DEPS_DIR}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- + find_psi_lib("${PSIMEDIA_DEPS}" "${PSIMEDIA_DEPS_DIR}" "${PSIMEDIA_LIBS_OUTPUT}/")
- # streamer plugins
- find_psi_lib("${GSTREAMER_PLUGINS}" "${GSTREAMER_PLUGINS_DIR}/" "${GST_PLUGINS_OUTPUT}")
- endif()
- @@ -417,7 +425,7 @@ if(WIN32)
- "hunspell-1.${hunsp_counter}-0.dll"
- )
- endforeach()
- - find_psi_lib("${HUNSPELL_LIBS}" "${PATHES}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- + find_psi_lib("${HUNSPELL_LIBS}" "${PATHES}" "${PSI_LIBS_OUTPUT}")
- unset(HUNSPELL_LIBS)
- # other libs and executables
- set( LIBRARIES_LIST
- @@ -447,6 +455,7 @@ if(WIN32)
- libxslt-1.dll
- libzlib.dll
- libzstd.dll
- + legacy.dll
- ssleay32.dll
- zlib1.dll
- )
- @@ -507,7 +516,7 @@ if(WIN32)
- libqjdns.dll
- )
- endif()
- - find_psi_lib("${LIBRARIES_LIST}" "${PATHES}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- + find_psi_lib("${LIBRARIES_LIST}" "${PATHES}" "${PSI_LIBS_OUTPUT}/")
- if(NOT BUNDLED_QCA)
- set(QCA_LIB
- libqca-qt${QT_DEFAULT_MAJOR_VERSION}${D}.dll
- @@ -526,15 +535,15 @@ if(WIN32)
- qca-ossl${D}.dll
- )
- endif()
- - find_psi_lib("${QCA_LIB}" "${PATHES}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- - find_psi_lib("${QCA_PLUGINS}" "${PATHES}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtplugins/crypto/")
- + find_psi_lib("${QCA_LIB}" "${PATHES}" "${PSI_LIBS_OUTPUT}/")
- + find_psi_lib("${QCA_PLUGINS}" "${PATHES}" "${QT_PLUGINS_OUTPUT}/crypto/")
- endif()
- if (NOT BUNDLED_USRSCTP)
- set(USRSCTP_LIB libusrsctp${D}.dll)
- if(MSVC)
- set(USRSCTP_LIB usrsctp${D}.dll)
- endif()
- - find_psi_lib("${USRSCTP_LIB}" "${PATHES}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
- + find_psi_lib("${USRSCTP_LIB}" "${PATHES}" "${PSI_LIBS_OUTPUT}/")
- endif()
- copy("${PROJECT_SOURCE_DIR}/win32/qt.conf" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" "${LIBS_TARGET}")
- endif()
- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
- index 7d613e4e..208ebf9e 100644
- --- a/src/CMakeLists.txt
- +++ b/src/CMakeLists.txt
- @@ -198,7 +198,7 @@ else()
- set(MAIN_ICON "psiplus_icon.png")
- endif()
- -include(${PROJECT_SOURCE_DIR}/cmake/modules/get-version.cmake)
- +include(get-version)
- if(LINUX)
- if(PSI_PLUS)
- @@ -224,30 +224,6 @@ endif()
- set(CONFIG_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/config.h")
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CONFIG_OUTPUT_FILE} @ONLY)
- -#Copy default iconsets to build directory and add jisp files to prepare-bin target
- -function(prepare_iconsets ACTION)
- - file(GLOB_RECURSE all_iconsets "${PROJECT_SOURCE_DIR}/iconsets/*")
- - message(STATUS "Processing iconsets for ${ACTION}")
- - foreach(_ITEM ${all_iconsets})
- - get_filename_component(FNAME ${_ITEM} NAME)
- - file(RELATIVE_PATH FREL ${PROJECT_SOURCE_DIR} ${_ITEM})
- - get_filename_component(FDIR ${FREL} DIRECTORY)
- - if(NOT ${ACTION} STREQUAL "prepare-bin")
- - if("${_ITEM}" MATCHES ".*/default/.*" AND (NOT "${_ITEM}" MATCHES ".*/system/default/icondef.xml"))
- - configure_file(${_ITEM} "${CMAKE_CURRENT_BINARY_DIR}/${FDIR}/${FNAME}" COPYONLY)
- - endif()
- - else()
- - if(NOT "${_ITEM}" MATCHES ".*/default/.*|.*README")
- - copy(${_ITEM} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${FDIR}/${FNAME}" ${ACTION})
- - endif()
- - endif()
- - unset(_ITEM)
- - unset(FNAME)
- - unset(FREL)
- - unset(FDIR)
- - endforeach()
- -endfunction()
- -
- prepare_iconsets(prepare-src)
- #Generate iconsets.qrc and icondef.xml
- set(ICONDEFXML_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/iconsets/system/default/icondef.xml")
- @@ -390,28 +366,6 @@ if(WIN32)
- configure_file(${PROJECT_SOURCE_DIR}/win32/psi_win.rc.in ${CMAKE_CURRENT_BINARY_DIR}/psi_win.rc @ONLY)
- #configure_file(${PROJECT_SOURCE_DIR}/win32/psi.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/psi.manifest @ONLY)
- # win resource compilation
- - function(compile_rc_file RC_FILE_NAME RC_OUTPUT_NAME)
- - if(NOT MSVC)
- - set(CMD_ARG
- - --include=${CMAKE_CURRENT_SOURCE_DIR}
- - --input=${RC_FILE_NAME}
- - --output=${RC_OUTPUT_NAME}
- - )
- - else()
- - set(CMD_ARG
- - /fo
- - ${RC_OUTPUT_NAME}
- - ${RC_FILE_NAME}
- - )
- - endif()
- - add_custom_command(OUTPUT ${RC_OUTPUT_NAME}
- - COMMAND ${CMAKE_RC_COMPILER}
- - ARGS ${CMD_ARG}
- - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/win32
- - VERBATIM
- - )
- - endfunction()
- -
- set(DECS_RC_NAME ${CMAKE_CURRENT_BINARY_DIR}/psi_win.rc)
- set(RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/psi_win.o)
- compile_rc_file(${DECS_RC_NAME} ${RC_FILE})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement