Skip to content

Commit

Permalink
add cmake post-build windeployqt
Browse files Browse the repository at this point in the history
  • Loading branch information
cboulay committed Aug 11, 2020
1 parent be0e5f8 commit 76c7cf5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ ui_*.h
/build*/
/CMakeLists.txt.user
/CMakeLists.json
/CMakeSettings.json
/.vs/
/out/
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.5)
project(XDFBrowser
LANGUAGES CXX
VERSION 1.12.0)
VERSION 1.13.1)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
Expand All @@ -21,3 +21,14 @@ target_link_libraries(${PROJECT_NAME}
)

target_compile_features(${PROJECT_NAME} PRIVATE cxx_auto_type cxx_noexcept)

if (WIN32)
get_target_property(QT5_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT5_WINDEPLOYQT_EXECUTABLE ${QT5_QMAKE_EXECUTABLE} PATH)
set(QT5_WINDEPLOYQT_EXECUTABLE "${QT5_WINDEPLOYQT_EXECUTABLE}/windeployqt.exe")

add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${QT5_WINDEPLOYQT_EXECUTABLE} --qmldir
${CMAKE_SOURCE_DIR} $<TARGET_FILE_DIR:${PROJECT_NAME}>)
endif(WIN32)

0 comments on commit 76c7cf5

Please sign in to comment.