Fix bug with windeployqt

This commit is contained in:
altffour 2019-12-24 19:19:36 +03:00
parent 6da48be8a5
commit ffa88c5db8
No known key found for this signature in database
GPG Key ID: 2E7B9E061AF66FC3
1 changed files with 7 additions and 6 deletions

View File

@ -81,14 +81,13 @@ if (WIN32)
set_target_properties(your_executable PROPERTIES LINK_FLAGS "/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\" /SUBSYSTEM:WINDOWS")
endif(CMAKE_BUILD_TYPE STREQUAL "Release")
target_link_libraries(contractNotifier Qt5::Core Qt5::Widgets Boost::serialization ${CMAKE_THREAD_LIBS_INIT} CURL::libcurl)
add_custom_command(TARGET contractNotifier POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E
env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}"
"$<TARGET_FILE:contractNotifier>"
COMMENT "Running windeployqt...")
endif(WIN32)
add_custom_command(TARGET contractNotifier POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E
env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}"
"$<TARGET_FILE:contractNotifier>"
COMMENT "Running windeployqt...")
# Retrieve the absolute path to qmake and then use that path to find
# the binaries
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
@ -121,6 +120,7 @@ add_custom_command(
${CMAKE_SOURCE_DIR}/vendor/notifu.exe
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/notifu.exe)
if (WIN32)
# Install stuff
install(TARGETS contractNotifier
RUNTIME DESTINATION "."
@ -150,3 +150,4 @@ set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
"CreateShortCut \\\"$DESKTOP\\\\ContractNotifier.lnk\\\" \\\"$INSTDIR\\\\contractNotifier.exe\\\"")
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete \\\"$DESKTOP\\\\ContractNotifier.lnk\\\"")
include(CPack)
endif()