Make CPM default to OFF for linux... for now.

Ensure non-CPM builds still work
This commit is contained in:
cheezwiz7899
2026-05-08 20:23:32 +12:00
committed by Ploo
parent a731faa39d
commit 9d9f0e6a16
3 changed files with 32 additions and 20 deletions
+1 -10
View File
@@ -94,16 +94,7 @@ CMAKE_DEPENDENT_OPTION(CITRON_CRASH_DUMPS "Compile crash dump (Minidump) support
option(CITRON_USE_BUNDLED_VCPKG "Use vcpkg for citron dependencies" "${MSVC}")
option(CITRON_USE_CPM "Use CPM.cmake to fetch dependencies" OFF)
# Auto-enable CPM for Linux/MinGW if not using vcpkg
if (NOT CITRON_USE_BUNDLED_VCPKG AND (UNIX OR MINGW))
set(CITRON_USE_CPM ON CACHE BOOL "" FORCE)
endif()
if (CITRON_USE_CPM)
set(CITRON_CHECK_SUBMODULES OFF CACHE BOOL "" FORCE)
else()
option(CITRON_CHECK_SUBMODULES "Check if submodules are present" ON)
endif()
option(CITRON_CHECK_SUBMODULES "Check if submodules are present" ON)
option(CITRON_ENABLE_LTO "Enable link-time optimization" OFF)
+13 -4
View File
@@ -222,11 +222,20 @@ function(copy_citron_Qt6_deps target_dir)
endif()
endif()
# Create a qt.conf next to the executable.
file(MAKE_DIRECTORY "${DLL_DEST}")
# Create a qt.conf next to the executable at build time.
# This handles generator expressions in DLL_DEST (e.g. on MSVC).
if (USE_LIB_FOLDER)
file(WRITE "${DLL_DEST}qt.conf" "[Paths]\nPlugins = plugins\n")
set(_QT_CONF_CONTENTS "[Paths]\nPlugins = plugins\n")
else()
file(WRITE "${DLL_DEST}qt.conf" "")
set(_QT_CONF_CONTENTS "")
endif()
set(_QT_CONF_TEMP "${CMAKE_CURRENT_BINARY_DIR}/qt.conf.${target_dir}.temp")
file(WRITE "${_QT_CONF_TEMP}" "${_QT_CONF_CONTENTS}")
add_custom_command(TARGET ${target_dir} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${DLL_DEST}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_QT_CONF_TEMP}" "${DLL_DEST}qt.conf"
COMMENT "Creating qt.conf for ${target_dir}"
)
endfunction(copy_citron_Qt6_deps)
+18 -6
View File
@@ -59,12 +59,24 @@ if (WIN32)
set(_QT_DIR_NAME "llvm-mingw_64")
set(_QT_CMAKE_SUB "lib/cmake/Qt6")
else()
# Native Linux (or macOS — extend here if needed)
set(_QT_OS "linux")
set(_QT_TARGET "desktop")
set(_QT_ARCH "linux_gcc_64")
set(_QT_DIR_NAME "gcc_64")
set(_QT_CMAKE_SUB "lib/cmake/Qt6")
if (APPLE)
set(_QT_OS "mac")
set(_QT_TARGET "desktop")
if (ARCHITECTURE_arm64)
set(_QT_ARCH "mac_arm64")
else()
set(_QT_ARCH "mac_x64")
endif()
set(_QT_DIR_NAME "macos")
set(_QT_CMAKE_SUB "lib/cmake/Qt6")
else()
# Native Linux
set(_QT_OS "linux")
set(_QT_TARGET "desktop")
set(_QT_ARCH "linux_gcc_64")
set(_QT_DIR_NAME "gcc_64")
set(_QT_CMAKE_SUB "lib/cmake/Qt6")
endif()
endif()
# ── Download target Qt ────────────────────────────────────────────────────────