mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-13 17:39:02 +08:00
Fix building with cmake 4.x on Arch (#9644)
* Fix CMAKE version check to only apply to Windows * Treat arch-based distros as arch when building * Fix cmake policy version issue on Arch * Remove duplicate cmake minimum version check * Move cmake 4.x compatibility fix to BuildLinux.sh
This commit is contained in:
parent
778deab033
commit
c6b8664c8e
@ -84,6 +84,10 @@ then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# cmake 4.x compatibility workaround
|
||||||
|
export CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||||
|
|
||||||
DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release | tr -d '"')
|
DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release | tr -d '"')
|
||||||
DISTRIBUTION_LIKE=$(awk -F= '/^ID_LIKE=/ {print $2}' /etc/os-release | tr -d '"')
|
DISTRIBUTION_LIKE=$(awk -F= '/^ID_LIKE=/ {print $2}' /etc/os-release | tr -d '"')
|
||||||
# Check for direct distribution match to Ubuntu/Debian
|
# Check for direct distribution match to Ubuntu/Debian
|
||||||
@ -92,6 +96,8 @@ if [ "${DISTRIBUTION}" == "ubuntu" ] || [ "${DISTRIBUTION}" == "linuxmint" ]; th
|
|||||||
# Check if distribution is Debian/Ubuntu-like based on ID_LIKE
|
# Check if distribution is Debian/Ubuntu-like based on ID_LIKE
|
||||||
elif [[ "${DISTRIBUTION_LIKE}" == *"debian"* ]] || [[ "${DISTRIBUTION_LIKE}" == *"ubuntu"* ]]; then
|
elif [[ "${DISTRIBUTION_LIKE}" == *"debian"* ]] || [[ "${DISTRIBUTION_LIKE}" == *"ubuntu"* ]]; then
|
||||||
DISTRIBUTION="debian"
|
DISTRIBUTION="debian"
|
||||||
|
elif [[ "${DISTRIBUTION_LIKE}" == *"arch"* ]]; then
|
||||||
|
DISTRIBUTION="arch"
|
||||||
fi
|
fi
|
||||||
if [ ! -f ./linux.d/${DISTRIBUTION} ]
|
if [ ! -f ./linux.d/${DISTRIBUTION} ]
|
||||||
then
|
then
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
# Verify that your CMake version is exactly 3.31.x series or lower on windows
|
# Verify that your CMake version is exactly 3.31.x series or lower on windows
|
||||||
if(${CMAKE_VERSION} VERSION_LESS "3.13" OR ${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0")
|
if ( ((MSVC) OR (WIN32)) AND (${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0") )
|
||||||
message(FATAL_ERROR "Only CMake versions between 3.13.x and 3.31.x is supported. Detected version: ${CMAKE_VERSION}")
|
message(FATAL_ERROR "Only cmake versions between 3.13.x and 3.31.x is supported on windows. Detected version: ${CMAKE_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
@ -44,7 +44,7 @@ You can do this in Environment Variables settings.
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# if CMAKE_OSX_DEPLOYMENT_TARGET is not set, set it to 11.3
|
# if CMAKE_OSX_DEPLOYMENT_TARGET is not set, set it to 11.3
|
||||||
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||||
@ -354,7 +354,7 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
|
|||||||
add_compile_options(-Wno-unknown-pragmas)
|
add_compile_options(-Wno-unknown-pragmas)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Bit of a hack for flatpak building: compress the debug info with zstd to save space in CI
|
# Bit of a hack for flatpak building: compress the debug info with zstd to save space in CI
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0)
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0)
|
||||||
add_compile_options(-gz=zstd)
|
add_compile_options(-gz=zstd)
|
||||||
endif()
|
endif()
|
||||||
@ -492,7 +492,7 @@ endif()
|
|||||||
function(slic3r_remap_configs targets from_Cfg to_Cfg)
|
function(slic3r_remap_configs targets from_Cfg to_Cfg)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
string(TOUPPER ${from_Cfg} from_CFG)
|
string(TOUPPER ${from_Cfg} from_CFG)
|
||||||
|
|
||||||
foreach(tgt ${targets})
|
foreach(tgt ${targets})
|
||||||
if(TARGET ${tgt})
|
if(TARGET ${tgt})
|
||||||
set_target_properties(${tgt} PROPERTIES MAP_IMPORTED_CONFIG_${from_CFG} ${to_Cfg})
|
set_target_properties(${tgt} PROPERTIES MAP_IMPORTED_CONFIG_${from_CFG} ${to_Cfg})
|
||||||
@ -619,7 +619,7 @@ add_custom_target(gettext_make_pot
|
|||||||
COMMAND xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost
|
COMMAND xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost
|
||||||
-f "${BBL_L18N_DIR}/list.txt"
|
-f "${BBL_L18N_DIR}/list.txt"
|
||||||
-o "${BBL_L18N_DIR}/OrcaSlicer.pot"
|
-o "${BBL_L18N_DIR}/OrcaSlicer.pot"
|
||||||
COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR}
|
COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR}
|
||||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||||
COMMENT "Generate pot file from strings in the source tree"
|
COMMENT "Generate pot file from strings in the source tree"
|
||||||
)
|
)
|
||||||
@ -779,7 +779,7 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
|
|||||||
|
|
||||||
PARENT_SCOPE
|
PARENT_SCOPE
|
||||||
)
|
)
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
@ -819,7 +819,7 @@ endif()
|
|||||||
if (WIN32)
|
if (WIN32)
|
||||||
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "./resources")
|
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "./resources")
|
||||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ".")
|
install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ".")
|
||||||
elseif (SLIC3R_FHS)
|
elseif (SLIC3R_FHS)
|
||||||
# CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share)
|
# CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user