mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
Replace DEPS_BITS with DEPS_ARCH (#10183)
* Replace DEPS_BITS with DEPS_ARCH * Restore missing DEP_MSVC_GEN * STREQUAL * STREQUAL * Other cmakelists * webview2 rename
This commit is contained in:
@@ -699,10 +699,12 @@ endif()
|
||||
|
||||
set(TOP_LEVEL_PROJECT_DIR ${PROJECT_SOURCE_DIR})
|
||||
function(orcaslicer_copy_dlls target config postfix output_dlls)
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
set(_bits 64)
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
set(_bits 32)
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
|
||||
set(_arch "x64")
|
||||
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "X86")
|
||||
set(_arch "x86")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unable to detect architecture")
|
||||
endif ()
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
@@ -719,9 +721,9 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
|
||||
message ("set out_dir to CMAKE_CURRENT_BINARY_DIR: ${_out_dir}")
|
||||
endif ()
|
||||
|
||||
file(COPY ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll
|
||||
${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll
|
||||
${TOP_LEVEL_PROJECT_DIR}/deps/WebView2/lib/win${_bits}/WebView2Loader.dll
|
||||
file(COPY ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win-${_arch}/libgmp-10.dll
|
||||
${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win-${_arch}/libmpfr-4.dll
|
||||
${TOP_LEVEL_PROJECT_DIR}/deps/WebView2/lib/win-${_arch}/WebView2Loader.dll
|
||||
DESTINATION ${_out_dir})
|
||||
|
||||
file(COPY ${CMAKE_PREFIX_PATH}/bin/occt/TKBO.dll
|
||||
|
||||
12
deps/CMakeLists.txt
vendored
12
deps/CMakeLists.txt
vendored
@@ -203,13 +203,13 @@ endfunction(orcaslicer_add_cmake_project)
|
||||
|
||||
|
||||
if (MSVC)
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
message(STATUS "\nDetected 64-bit compiler => building 64-bit deps bundle\n")
|
||||
set(DEPS_BITS 64)
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
|
||||
message(STATUS "\nDetected X64 compiler => building X64 deps bundle\n")
|
||||
set(DEPS_ARCH "x64")
|
||||
include("deps-windows.cmake")
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
message(STATUS "\nDetected 32-bit compiler => building 32-bit deps bundle\n")
|
||||
set(DEPS_BITS 32)
|
||||
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "X86")
|
||||
message(STATUS "\nDetected X86 compiler => building X86 deps bundle\n")
|
||||
set(DEPS_ARCH "x86")
|
||||
include("deps-windows.cmake")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unable to detect architecture")
|
||||
|
||||
4
deps/GMP/GMP.cmake
vendored
4
deps/GMP/GMP.cmake
vendored
@@ -13,8 +13,8 @@ if (MSVC)
|
||||
add_custom_command(
|
||||
OUTPUT ${_output}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/gmp.h ${DESTDIR}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.lib ${DESTDIR}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.dll ${DESTDIR}/bin/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libgmp-10.lib ${DESTDIR}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libgmp-10.dll ${DESTDIR}/bin/
|
||||
)
|
||||
|
||||
add_custom_target(dep_GMP SOURCES ${_output})
|
||||
|
||||
4
deps/MPFR/MPFR.cmake
vendored
4
deps/MPFR/MPFR.cmake
vendored
@@ -10,8 +10,8 @@ if (MSVC)
|
||||
OUTPUT ${_output}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpfr.h ${DESTDIR}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpf2mpfr.h ${DESTDIR}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.lib ${DESTDIR}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.dll ${DESTDIR}/bin/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libmpfr-4.lib ${DESTDIR}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libmpfr-4.dll ${DESTDIR}/bin/
|
||||
)
|
||||
|
||||
add_custom_target(dep_MPFR SOURCES ${_output})
|
||||
|
||||
19
deps/deps-windows.cmake
vendored
19
deps/deps-windows.cmake
vendored
@@ -27,16 +27,13 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||
set(DEP_BOOST_TOOLSET "clang-win")
|
||||
endif ()
|
||||
|
||||
if (${DEPS_BITS} EQUAL 32)
|
||||
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
|
||||
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
|
||||
if ("${DEPS_ARCH}" STREQUAL "x86")
|
||||
set(DEP_PLATFORM "Win32")
|
||||
else ()
|
||||
if (DEP_VS_VER LESS 16)
|
||||
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER} Win64")
|
||||
else ()
|
||||
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
|
||||
endif ()
|
||||
elseif ("${DEPS_ARCH}" STREQUAL "x64")
|
||||
set(DEP_PLATFORM "x64")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unsupported OS architecture")
|
||||
endif ()
|
||||
|
||||
if (${DEP_DEBUG})
|
||||
@@ -57,12 +54,14 @@ if (${DEP_DEBUG})
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
if (${DEPS_BITS} EQUAL 32)
|
||||
if ("${DEPS_ARCH}" STREQUAL "x86")
|
||||
set(DEP_WXWIDGETS_TARGET "")
|
||||
set(DEP_WXWIDGETS_LIBDIR "vc_lib")
|
||||
else ()
|
||||
elseif ("${DEPS_ARCH}" STREQUAL "x64")
|
||||
set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64")
|
||||
set(DEP_WXWIDGETS_LIBDIR "vc_x64_lib")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unsupported OS architecture")
|
||||
endif ()
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
Reference in New Issue
Block a user