Debian Codegraph @

CMakeModules/generateInnoSetupConfig.cmake.in

raw
1
2 # okay, take a deep breath :)
3 # This is a template file, processed at CMake *configure* time, to produce a script
4 # in the build tree, which we run at *install* time.
5 # The install time action produces the file "InstallConfig.iss' from the template
6 # in flightgear/package/windows
7 #
8 # We need to generate the install config at *install* time to get the correct date
9 # (for a nightly build) or Git SHA (for a dev build). But we need to populate it with
10 # many values we only know at CMake-configure time. Hence this two-stage generation.
11
12 # iscc.exe only accepts Windows style-paths, so explicitly convert
13 file(TO_NATIVE_PATH "@CMAKE_INSTALL_PREFIX@" FG_WINDOWS_INSTALL_PREFIX)
14 file(TO_NATIVE_PATH "@OSG_BASE_DIR@" INNO_SETUP_OSG_BASE_DIR)
15 file(TO_NATIVE_PATH "@FINAL_MSVC_3RDPARTY_DIR@" INNO_SETUP_3RDPARTY_DIR)
16
17 set(buildType @FG_BUILD_TYPE@)
18 set(revision @GIT_SHA@)
19 set(version @FLIGHTGEAR_VERSION@)
20 set(version_major @FG_VERSION_MAJOR@)
21 set(version_minor @FG_VERSION_MINOR@)
22 set(osg_version @OPENSCENEGRAPH_VERSION@)
23 set(osg_soversion @osg_soversion@)
24 set(openthreads_soversion @openthreads_soversion@)
25
26 # used to set -rc1 or similar suffixes on file name
27 set(release_suffix "@INSTALLER_RELEASE_SUFFIX@")
28
29 if (buildType STREQUAL "Release")
30 set(INNO_SETUP_OUT_NAME "flightgear-${version}${release_suffix}-windows-amd64")
31 elseif(buildType STREQUAL "Nightly")
32 string(TIMESTAMP currentDate "%Y%m%d")
33 set(INNO_SETUP_OUT_NAME "flightgear-${currentDate}-windows-amd64")
34 else()
35 set(INNO_SETUP_OUT_NAME "flightgear-${revision}-windows-amd64")
36 endif()
37
38 string(TIMESTAMP iss_config_timestamp)
39
40 configure_file(@CMAKE_SOURCE_DIR@/package/windows/InstallConfig.iss.in @CMAKE_BINARY_DIR@/InstallConfig.iss)
41