diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-04-01 13:36:38 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-04-01 14:44:21 -0700 |
commit | 297ddf666df490699128b038948177ba4e5444b6 (patch) | |
tree | 488996239830727482f94fb44929ece2730522e6 | |
parent | 70527ac83a04c95f62791d1adf74acd8cb42e65a (diff) | |
download | subsurface-297ddf666df490699128b038948177ba4e5444b6.tar.gz |
cmake: add installer target for creating Windows installer
Silly cmake doesn't allow a target to depend on the install target. This
ugly hack appears to be the recommended workaround :-(
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0814bdbbf..9a0c47be2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -467,6 +467,18 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") install(FILES ${CMAKE_SOURCE_DIR}/gpl-2.0.txt ${CMAKE_SOURCE_DIR}/packaging/windows/subsurface.ico DESTINATION ${WINDOWSSTAGING}) install(TARGETS subsurface DESTINATION ${WINDOWSSTAGING}) install(FILES ${CMAKE_BINARY_DIR}/qt.conf DESTINATION ${WINDOWSSTAGING}) + if(NOT DEFINED MAKENSIS) + set(MAKENSIS makensis) + endif() +# stupid cmake doesn't allow a target to depend on the "install" target. +# How lame is that... + add_custom_target(fake_install + COMMAND "${CMAKE_COMMAND}" --build . --target install + DEPENDS subsurface) + add_custom_target(installer + COMMAND ${MAKENSIS} ${WINDOWSSTAGING}/subsurface.nsi + DEPENDS fake_install + ) ENDIF() if(CMAKE_SYSTEM_NAME STREQUAL "Android") |