11cmake_minimum_required (VERSION 3.22) # minimum version required by Qt
22
33project (Launcher LANGUAGES C CXX)
4- if (APPLE )
4+ if (APPLE )
55 enable_language (OBJC OBJCXX)
6- endif ()
6+ endif ()
77
88string (COMPARE EQUAL "${CMAKE_SOURCE_DIR} " "${CMAKE_BUILD_DIR} " IS_IN_SOURCE_BUILD)
99if (IS_IN_SOURCE_BUILD)
@@ -99,7 +99,7 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS_RELEASE}"
9999
100100# Export compile commands for debug builds if we can (useful in LSPs like clangd)
101101# https://cmake.org/cmake/help/v3.31/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html
102- if (CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR MATCHES "^Ninja" )
102+ if (CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR MATCHES "^Ninja" )
103103 set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
104104endif ()
105105
@@ -294,7 +294,7 @@ set(Launcher_BUILD_TIMESTAMP "${TODAY}")
294294################################ 3rd Party Libs ################################
295295
296296# Find the required Qt parts
297- if (Launcher_QT_VERSION_MAJOR EQUAL 6)
297+ if (Launcher_QT_VERSION_MAJOR EQUAL 6)
298298 set (QT_VERSION_MAJOR 6)
299299 find_package (Qt6 REQUIRED COMPONENTS Core CoreTools Widgets Concurrent Network Test Xml NetworkAuth OpenGL)
300300 find_package (Qt6 COMPONENTS DBus)
@@ -303,42 +303,42 @@ else()
303303 message (FATAL_ERROR "Qt version ${Launcher_QT_VERSION_MAJOR} is not supported" )
304304endif ()
305305
306- if (Launcher_QT_VERSION_MAJOR EQUAL 6)
306+ if (Launcher_QT_VERSION_MAJOR EQUAL 6)
307307 set (QT_PLUGINS_DIR ${QT${QT_VERSION_MAJOR} _INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR} _INSTALL_PLUGINS})
308308 set (QT_LIBS_DIR ${QT${QT_VERSION_MAJOR} _INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR} _INSTALL_LIBS})
309309 set (QT_LIBEXECS_DIR ${QT${QT_VERSION_MAJOR} _INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR} _INSTALL_LIBEXECS})
310310endif ()
311311
312312find_package (cmark REQUIRED)
313313
314- if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
314+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
315315 find_package (PkgConfig REQUIRED)
316316 pkg_check_modules(gamemode REQUIRED IMPORTED_TARGET gamemode)
317317endif ()
318318
319319# Find libqrencode
320320## NOTE(@getchoo): Never use pkg-config with MSVC since the vcpkg port makes our install bundle fail to find the dll
321- if (MSVC )
321+ if (MSVC )
322322 find_path (LIBQRENCODE_INCLUDE_DIR qrencode.h REQUIRED)
323323 find_library (LIBQRENCODE_LIBRARY_RELEASE qrencode REQUIRED)
324324 find_library (LIBQRENCODE_LIBRARY_DEBUG qrencoded)
325325 set (LIBQRENCODE_LIBRARIES optimized ${LIBQRENCODE_LIBRARY_RELEASE} debug ${LIBQRENCODE_LIBRARY_DEBUG} )
326- else ()
326+ else ()
327327 find_package (PkgConfig REQUIRED)
328328 pkg_check_modules(libqrencode REQUIRED IMPORTED_TARGET libqrencode)
329- endif ()
329+ endif ()
330330
331331# Find libarchive through CMake packages, mainly for vcpkg
332332find_package (LibArchive)
333333# CMake packages aren't available in most distributions of libarchive, so fallback to pkg-config
334- if (NOT LibArchive_FOUND)
334+ if (NOT LibArchive_FOUND)
335335 find_package (PkgConfig REQUIRED)
336336 pkg_check_modules(libarchive REQUIRED IMPORTED_TARGET libarchive)
337- endif ()
337+ endif ()
338338
339339find_package (tomlplusplus 3.2.0)
340340# fallback to pkgconfig, important especially as many distros package toml++ built with meson
341- if (NOT tomlplusplus_FOUND)
341+ if (NOT tomlplusplus_FOUND)
342342 find_package (PkgConfig REQUIRED)
343343 pkg_check_modules(tomlplusplus REQUIRED IMPORTED_TARGET tomlplusplus>=3.2.0)
344344endif ()
@@ -399,49 +399,49 @@ if(UNIX AND APPLE)
399399 install (FILES ${Launcher_Branding_ICNS} DESTINATION ${RESOURCES_DEST_DIR} RENAME ${Launcher_Name} .icns)
400400
401401 find_program (ACTOOL_EXE actool DOC "Path to the apple asset catalog compiler" )
402- if (ACTOOL_EXE)
402+ if (ACTOOL_EXE)
403403 execute_process (
404- COMMAND xcodebuild -version
405- OUTPUT_VARIABLE XCODE_VERSION_OUTPUT
406- OUTPUT_STRIP_TRAILING_WHITESPACE
404+ COMMAND xcodebuild -version
405+ OUTPUT_VARIABLE XCODE_VERSION_OUTPUT
406+ OUTPUT_STRIP_TRAILING_WHITESPACE
407407 )
408408
409409 string (REGEX MATCH "Xcode ([0-9]+\. [0-9]+)" XCODE_VERSION_MATCH "${XCODE_VERSION_OUTPUT} " )
410- if (XCODE_VERSION_MATCH)
410+ if (XCODE_VERSION_MATCH)
411411 set (XCODE_VERSION ${CMAKE_MATCH_1} )
412- else ()
412+ else ()
413413 set (XCODE_VERSION 0.0)
414- endif ()
414+ endif ()
415415
416- if (XCODE_VERSION VERSION_GREATER_EQUAL 26.0)
416+ if (XCODE_VERSION VERSION_GREATER_EQUAL 26.0)
417417 set (ASSETS_OUT_DIR "${CMAKE_BINARY_DIR} /program_info" )
418418 set (GENERATED_ASSETS_CAR "${ASSETS_OUT_DIR} /Assets.car" )
419419 set (ICON_SOURCE "${CMAKE_CURRENT_SOURCE_DIR} /${Launcher_Branding_MAC_ICON} " )
420420
421421 add_custom_command (
422- OUTPUT "${GENERATED_ASSETS_CAR} "
423- COMMAND ${ACTOOL_EXE} "${ICON_SOURCE} "
424- --compile "${ASSETS_OUT_DIR} "
425- --output -partial-info-plist /dev/null
426- --app-icon PrismLauncher
427- --enable-on -demand-resources NO
428- --target -device mac
429- --minimum-deployment-target ${CMAKE_OSX_DEPLOYMENT_TARGET}
430- --platform macosx
431- DEPENDS "${ICON_SOURCE} "
432- COMMENT "Compiling asset catalog (${ICON_SOURCE} )"
433- VERBATIM
422+ OUTPUT "${GENERATED_ASSETS_CAR} "
423+ COMMAND ${ACTOOL_EXE} "${ICON_SOURCE} "
424+ --compile "${ASSETS_OUT_DIR} "
425+ --output -partial-info-plist /dev/null
426+ --app-icon PrismLauncher
427+ --enable-on -demand-resources NO
428+ --target -device mac
429+ --minimum-deployment-target ${CMAKE_OSX_DEPLOYMENT_TARGET}
430+ --platform macosx
431+ DEPENDS "${ICON_SOURCE} "
432+ COMMENT "Compiling asset catalog (${ICON_SOURCE} )"
433+ VERBATIM
434434 )
435435 add_custom_target (compile_assets ALL DEPENDS "${GENERATED_ASSETS_CAR} " )
436436 install (FILES "${GENERATED_ASSETS_CAR} " DESTINATION "${RESOURCES_DEST_DIR} " )
437- else ()
437+ else ()
438438 message (WARNING "Xcode ${XCODE_VERSION} is too old. Minimum required version is 26.0. Not compiling liquid glass icons." )
439- endif ()
439+ endif ()
440440
441- else ()
441+ else ()
442442 message (WARNING "actool not found. Cannot compile macOS app icons.\n "
443- "Install Xcode command line tools: 'xcode-select --install'" )
444- endif ()
443+ "Install Xcode command line tools: 'xcode-select --install'" )
444+ endif ()
445445
446446
447447elseif (UNIX )
0 commit comments