@@ -53,9 +53,9 @@ endif()
5353
5454
5555# Configuration options
56- set (DEFAULT_RUN_IN_PLACE FALSE )
56+ set (DEFAULT_USE_PORTABLE_CONFIG FALSE )
5757if (WIN32 )
58- set (DEFAULT_RUN_IN_PLACE TRUE )
58+ set (DEFAULT_USE_PORTABLE_CONFIG TRUE )
5959 # For Windows RC file.
6060 add_definitions (-DFLAMESHOT_VERSION_MAJOR=${CMAKE_PROJECT_VERSION_MAJOR} )
6161 add_definitions (-DFLAMESHOT_VERSION_MINOR=${CMAKE_PROJECT_VERSION_MINOR} )
@@ -65,10 +65,12 @@ if(WIN32)
6565elseif (APPLE )
6666 set (Qt6_DIR "$(brew --prefix qt6)/lib/cmake/Qt6/" CACHE PATH "directory where Qt6Config.cmake exists." )
6767endif ()
68- set (RUN_IN_PLACE
69- ${DEFAULT_RUN_IN_PLACE}
70- CACHE BOOL "Run directly in source directory structure" )
71-
68+ set (USE_PORTABLE_CONFIG
69+ ${DEFAULT_USE_PORTABLE_CONFIG}
70+ CACHE BOOL "Store config in application folder" )
71+ if (USE_PORTABLE_CONFIG)
72+ add_compile_definitions (USE_PORTABLE_CONFIG )
73+ endif ()
7274
7375option (FLAMESHOT_DEBUG_CAPTURE "Enable mode to make debugging easier" OFF )
7476option (USE_MONOCHROME_ICON "Build using monochrome icon as default" OFF )
@@ -158,13 +160,8 @@ if(WIN32)
158160 # Include all dynamically linked runtime libraries such as MSVCRxxx.dll
159161 include (InstallRequiredSystemLibraries )
160162
161- if (RUN_IN_PLACE)
162- if (CMAKE_SIZEOF_VOID_P EQUAL 8)
163- set (CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME } -${PROJECT_VERSION } -win64" )
164- else ()
165- set (CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME } -${PROJECT_VERSION } -win32" )
166- endif ()
167-
163+ if (USE_PORTABLE_CONFIG)
164+ set (CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME } -${PROJECT_VERSION } -win64" )
168165 set (CPACK_GENERATOR ZIP)
169166
170167 else ()
@@ -189,13 +186,7 @@ if(WIN32)
189186 set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR } /packaging/win-installer/LICENSE/GPL-3.0.txt" )
190187 set (CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR } /README.md" )
191188
192- # The correct way would be to include both x32 and x64 into one installer and install the appropriate one. CMake
193- # does not support that, so there are two separate GUID's
194- if (CMAKE_SIZEOF_VOID_P EQUAL 8)
195- set (CPACK_WIX_UPGRADE_GUID "26D8062A-66D9-48D9-8924-42090FB9B3F9" )
196- else ()
197- set (CPACK_WIX_UPGRADE_GUID "2C53E1B9-51D9-4429-AAE4-B02221959AA5" )
198- endif ()
189+ set (CPACK_WIX_UPGRADE_GUID "26D8062A-66D9-48D9-8924-42090FB9B3F9" )
199190 endif ()
200191elseif (APPLE )
201192 set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
0 commit comments