2017-10-15 19:22:17 +08:00
|
|
|
function(configure_qt)
|
|
|
|
cmake_parse_arguments(_csc "" "SOURCE_PATH;PLATFORM" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN})
|
|
|
|
|
2018-03-24 01:01:07 +08:00
|
|
|
if(NOT _csc_PLATFORM)
|
|
|
|
message(FATAL_ERROR "configure_qt requires a PLATFORM argument.")
|
2017-10-15 19:22:17 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_find_acquire_program(PERL)
|
|
|
|
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
|
|
|
|
set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}")
|
|
|
|
|
2018-03-24 01:01:07 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
list(APPEND _csc_OPTIONS "-static")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "static")
|
|
|
|
list(APPEND _csc_OPTIONS "-static-runtime")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_HOST_WIN32)
|
|
|
|
set(CONFIGURE_BAT "configure.bat")
|
|
|
|
else()
|
|
|
|
set(CONFIGURE_BAT "configure")
|
2017-10-15 19:22:17 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
|
|
|
|
vcpkg_execute_required_process(
|
2018-03-24 01:01:07 +08:00
|
|
|
COMMAND "${_csc_SOURCE_PATH}/${CONFIGURE_BAT}" ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG}
|
2017-10-15 19:22:17 +08:00
|
|
|
-debug
|
2018-09-21 05:01:15 +08:00
|
|
|
-prefix ${CURRENT_INSTALLED_DIR}/debug
|
|
|
|
-extprefix ${CURRENT_PACKAGES_DIR}/debug
|
2019-03-09 16:27:54 +08:00
|
|
|
-hostbindir ${CURRENT_PACKAGES_DIR}/debug/tools/qt5
|
|
|
|
-archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5/debug
|
|
|
|
-datadir ${CURRENT_PACKAGES_DIR}/share/qt5/debug
|
2019-02-27 01:55:48 +08:00
|
|
|
-plugindir ${CURRENT_INSTALLED_DIR}/debug/plugins
|
|
|
|
-qmldir ${CURRENT_INSTALLED_DIR}/debug/qml
|
2017-11-21 09:07:03 +08:00
|
|
|
-headerdir ${CURRENT_PACKAGES_DIR}/include
|
2017-10-15 19:22:17 +08:00
|
|
|
-I ${CURRENT_INSTALLED_DIR}/include
|
|
|
|
-L ${CURRENT_INSTALLED_DIR}/debug/lib
|
2018-03-24 01:01:07 +08:00
|
|
|
-platform ${_csc_PLATFORM}
|
2017-10-15 19:22:17 +08:00
|
|
|
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
|
|
|
|
LOGNAME config-${TARGET_TRIPLET}-dbg
|
|
|
|
)
|
|
|
|
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done")
|
2018-09-21 05:01:15 +08:00
|
|
|
|
2017-10-15 19:22:17 +08:00
|
|
|
message(STATUS "Configuring ${TARGET_TRIPLET}-rel")
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
|
|
|
|
vcpkg_execute_required_process(
|
2018-03-24 01:01:07 +08:00
|
|
|
COMMAND "${_csc_SOURCE_PATH}/${CONFIGURE_BAT}" ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE}
|
2017-10-15 19:22:17 +08:00
|
|
|
-release
|
2018-09-21 05:01:15 +08:00
|
|
|
-prefix ${CURRENT_INSTALLED_DIR}
|
|
|
|
-extprefix ${CURRENT_PACKAGES_DIR}
|
2019-03-09 16:27:54 +08:00
|
|
|
-hostbindir ${CURRENT_PACKAGES_DIR}/tools/qt5
|
2019-02-27 01:55:48 +08:00
|
|
|
-archdatadir ${CURRENT_INSTALLED_DIR}/share/qt5
|
|
|
|
-datadir ${CURRENT_INSTALLED_DIR}/share/qt5
|
|
|
|
-plugindir ${CURRENT_INSTALLED_DIR}/plugins
|
|
|
|
-qmldir ${CURRENT_INSTALLED_DIR}/qml
|
2017-10-15 19:22:17 +08:00
|
|
|
-I ${CURRENT_INSTALLED_DIR}/include
|
|
|
|
-L ${CURRENT_INSTALLED_DIR}/lib
|
2018-03-24 01:01:07 +08:00
|
|
|
-platform ${_csc_PLATFORM}
|
2017-10-15 19:22:17 +08:00
|
|
|
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
|
|
|
|
LOGNAME config-${TARGET_TRIPLET}-rel
|
|
|
|
)
|
|
|
|
message(STATUS "Configuring ${TARGET_TRIPLET}-rel done")
|
|
|
|
|
2018-09-21 05:01:15 +08:00
|
|
|
endfunction()
|