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>
This commit is contained in:
Dirk Hohndel 2015-04-01 13:36:38 -07:00
parent 70527ac83a
commit 297ddf666d

View file

@ -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")