mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Qt5 : Install dependencies on Windows
This commit is contained in:
parent
d855c19414
commit
32e611f710
@ -446,7 +446,6 @@ if (MSVC)
|
||||
add_custom_command(TARGET ResInsight POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${qtlib}> $<TARGET_FILE_DIR:ResInsight>
|
||||
)
|
||||
list(APPEND RI_DLL_FILENAMES $<TARGET_FILE:${qtlib}>)
|
||||
endforeach(qtlib)
|
||||
else()
|
||||
set (QTLIBLIST QtCore4 QtCored4 QtGui4 QtGuid4 QtOpenGl4 QtOpenGld4 QtNetwork4 QtNetworkd4 QtScript4 QtScriptd4 QtScriptTools4 QtScriptToolsd4)
|
||||
@ -535,6 +534,51 @@ if (RESINSIGHT_PRIVATE_INSTALL)
|
||||
|
||||
set (RESINSIGHT_FILES ${RI_DLL_FILENAMES})
|
||||
|
||||
if(Qt5_FOUND AND WIN32 AND TARGET Qt5::qmake AND NOT TARGET Qt5::windeployqt)
|
||||
get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION)
|
||||
|
||||
execute_process(
|
||||
COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX
|
||||
RESULT_VARIABLE return_code
|
||||
OUTPUT_VARIABLE qt5_install_prefix
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
set(imported_location "${qt5_install_prefix}/bin/windeployqt.exe")
|
||||
|
||||
if(EXISTS ${imported_location})
|
||||
add_executable(Qt5::windeployqt IMPORTED)
|
||||
|
||||
set_target_properties(Qt5::windeployqt PROPERTIES
|
||||
IMPORTED_LOCATION ${imported_location}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# TODO(wjwwood): find a way to make this optional or to run without "deploying" the
|
||||
# necessary dlls and stuff to the bin folder.
|
||||
# see:
|
||||
# https://stackoverflow.com/questions/41193584/deploy-all-qt-dependencies-when-building#41199492
|
||||
if(TARGET Qt5::windeployqt)
|
||||
# execute windeployqt in a tmp directory after build
|
||||
add_custom_command(TARGET ResInsight
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/windeployqt"
|
||||
COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
|
||||
COMMAND
|
||||
Qt5::windeployqt
|
||||
--dir "${CMAKE_CURRENT_BINARY_DIR}/windeployqt"
|
||||
"$<TARGET_FILE_DIR:ResInsight>/$<TARGET_FILE_NAME:ResInsight>"
|
||||
)
|
||||
|
||||
# copy deployment directory during installation
|
||||
install(
|
||||
DIRECTORY
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/windeployqt/"
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
||||
)
|
||||
endif()
|
||||
|
||||
# CRT
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON)
|
||||
set(CMAKE_INSTALL_OPENMP_LIBRARIES ON)
|
||||
|
Loading…
Reference in New Issue
Block a user