mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
cmake: setup .nsi file when cross building for Windows
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1b0d0687f8
commit
70527ac83a
1 changed files with 12 additions and 0 deletions
|
@ -108,6 +108,9 @@ FILE(WRITE ${CMAKE_BINARY_DIR}/version.cmake "
|
|||
ELSE ()
|
||||
SET(VER_OS linux)
|
||||
ENDIF ()
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL \"Windows\")
|
||||
SET(VER_OS win)
|
||||
ENDIF ()
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND sh scripts/get-version \${VER_OS}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
|
@ -127,10 +130,19 @@ FILE(WRITE ${CMAKE_BINARY_DIR}/version.cmake "
|
|||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
CONFIGURE_FILE(\${SRC} \${DST} @ONLY)
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL \"Windows\")
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND cat ${CMAKE_SOURCE_DIR}/packaging/windows/subsurface.nsi.in
|
||||
COMMAND sed -e \"s/VERSIONTOKEN/\${VERSION_STRING}/\"
|
||||
COMMAND sed -e \"s/PRODVTOKEN/\${CANONICAL_VERSION_STRING}/\"
|
||||
OUTPUT_FILE ${CMAKE_BINARY_DIR}/staging/subsurface.nsi
|
||||
)
|
||||
ENDIF()
|
||||
")
|
||||
ADD_CUSTOM_TARGET(version ALL COMMAND
|
||||
${CMAKE_COMMAND} -D SRC=${CMAKE_BINARY_DIR}/version.h.in
|
||||
-D DST=${CMAKE_BINARY_DIR}/ssrf-version.h
|
||||
-D CMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||
-P ${CMAKE_BINARY_DIR}/version.cmake
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue