From 59ce8deb977225d07539a6c656903650acbd8f3e Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 5 Apr 2024 22:48:13 -0400 Subject: [PATCH] build(cmake): add prep/init.cmake (#2375) Co-authored-by: James Le Cuirot --- CMakeLists.txt | 3 +++ cmake/compile_definitions/linux.cmake | 4 ---- cmake/prep/init.cmake | 9 +++++++++ cmake/prep/special_package_configuration.cmake | 2 -- 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 cmake/prep/init.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d6ac864322..4912f9eb56a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,9 @@ include(${CMAKE_MODULE_PATH}/prep/build_version.cmake) # cmake build flags include(${CMAKE_MODULE_PATH}/prep/options.cmake) +# initial prep +include(${CMAKE_MODULE_PATH}/prep/init.cmake) + # configure special package files, such as sunshine.desktop, Flatpak manifest, Portfile , etc. include(${CMAKE_MODULE_PATH}/prep/special_package_configuration.cmake) diff --git a/cmake/compile_definitions/linux.cmake b/cmake/compile_definitions/linux.cmake index b6d1990a24e..0b545590054 100644 --- a/cmake/compile_definitions/linux.cmake +++ b/cmake/compile_definitions/linux.cmake @@ -8,10 +8,6 @@ if(${SUNSHINE_BUILD_APPIMAGE}) string(REPLACE "${CMAKE_INSTALL_PREFIX}" ".${CMAKE_INSTALL_PREFIX}" SUNSHINE_ASSETS_DIR_DEF ${SUNSHINE_ASSETS_DIR}) endif() -if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH) - set(SUNSHINE_EXECUTABLE_PATH "sunshine") -endif() - # cuda set(CUDA_FOUND OFF) if(${SUNSHINE_ENABLE_CUDA}) diff --git a/cmake/prep/init.cmake b/cmake/prep/init.cmake new file mode 100644 index 00000000000..93e8b597721 --- /dev/null +++ b/cmake/prep/init.cmake @@ -0,0 +1,9 @@ +if (WIN32) +elseif (APPLE) +elseif (UNIX) + include(GNUInstallDirs) + + if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH) + set(SUNSHINE_EXECUTABLE_PATH "sunshine") + endif() +endif () diff --git a/cmake/prep/special_package_configuration.cmake b/cmake/prep/special_package_configuration.cmake index ec0c110b565..17e724c90d0 100644 --- a/cmake/prep/special_package_configuration.cmake +++ b/cmake/prep/special_package_configuration.cmake @@ -6,8 +6,6 @@ if (APPLE) configure_file(packaging/macos/sunshine.rb sunshine.rb @ONLY) endif() elseif (UNIX) - include(GNUInstallDirs) # this needs to be included prior to configuring the desktop files - # configure the .desktop file if(${SUNSHINE_BUILD_APPIMAGE}) configure_file(packaging/linux/AppImage/sunshine.desktop sunshine.desktop @ONLY)