From 297ddf666df490699128b038948177ba4e5444b6 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 1 Apr 2015 13:36:38 -0700 Subject: 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 --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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") -- cgit v1.2.3-70-g09d2