Fix inconsistent option variable names in deps

Still support old behaviour
This commit is contained in:
tamasmeszaros 2023-08-14 16:08:44 +02:00
parent 0eb5517b57
commit 79b86abebf
7 changed files with 32 additions and 21 deletions

View File

@ -1,9 +1,9 @@
include(ExternalProject)
include(ProcessorCount)
set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory")
set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Path for downloaded source packages.")
option(DEP_BUILD_VERBOSE "Use verbose output for each dependency build" OFF)
set(${PROJECT_NAME}_DEP_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/destdir/usr/local" CACHE PATH "Destination directory")
set(${PROJECT_NAME}_DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads CACHE PATH "Path for downloaded source packages.")
option(${PROJECT_NAME}_DEP_BUILD_VERBOSE "Use verbose output for each dependency build" OFF)
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
@ -45,17 +45,19 @@ function(add_cmake_project projectname)
set(_verbose_switch "")
if (CMAKE_GENERATOR MATCHES "Ninja")
set(_verbose_switch "--verbose")
elseif (CMAKE_GENERATOR MATCHES "Visual Studio")
set(_verbose_switch "-v:d")
endif ()
ExternalProject_Add(
dep_${projectname}
EXCLUDE_FROM_ALL ON # Not built by default, dep_${projectname} needs to be added to ALL target
INSTALL_DIR ${DESTDIR}/usr/local
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
INSTALL_DIR ${${PROJECT_NAME}_DEP_INSTALL_PREFIX}
DOWNLOAD_DIR ${${PROJECT_NAME}_DEP_DOWNLOAD_DIR}/${projectname}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
-DCMAKE_INSTALL_PREFIX:STRING=${${PROJECT_NAME}_DEP_INSTALL_PREFIX}
-DCMAKE_MODULE_PATH:STRING=${CMAKE_MODULE_PATH}
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}/usr/local
-DCMAKE_PREFIX_PATH:STRING=${${PROJECT_NAME}_DEP_INSTALL_PREFIX}
-DCMAKE_DEBUG_POSTFIX:STRING=${CMAKE_DEBUG_POSTFIX}
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}

6
deps/+GMP/GMP.cmake vendored
View File

@ -1,6 +1,6 @@
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/gmp)
set(_dstdir ${DESTDIR}/usr/local)
set(_dstdir ${${PROJECT_NAME}_DEP_INSTALL_PREFIX})
if (MSVC)
set(_output ${_dstdir}/include/gmp.h
@ -47,9 +47,9 @@ else ()
EXCLUDE_FROM_ALL ON
URL https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2
URL_HASH SHA256=eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP
DOWNLOAD_DIR ${${PROJECT_NAME}_DEP_DOWNLOAD_DIR}/GMP
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" ${_gmp_build_tgt}
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${${PROJECT_NAME}_DEP_INSTALL_PREFIX}" ${_gmp_build_tgt}
BUILD_COMMAND make -j
INSTALL_COMMAND make install
)

View File

@ -1,5 +1,5 @@
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/mpfr)
set(_dstdir ${DESTDIR}/usr/local)
set(_dstdir ${${PROJECT_NAME}_DEP_INSTALL_PREFIX})
if (MSVC)
set(_output ${_dstdir}/include/mpfr.h
@ -29,9 +29,9 @@ else ()
EXCLUDE_FROM_ALL ON
URL http://ftp.vim.org/ftp/gnu/mpfr/mpfr-3.1.6.tar.bz2 https://www.mpfr.org/mpfr-3.1.6/mpfr-3.1.6.tar.bz2 # mirrors are allowed
URL_HASH SHA256=cf4f4b2d80abb79e820e78c8077b6725bbbb4e8f41896783c899087be0e94068
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR
DOWNLOAD_DIR ${${PROJECT_NAME}_DEP_DOWNLOAD_DIR}/MPFR
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt}
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${${PROJECT_NAME}_DEP_INSTALL_PREFIX} --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt}
BUILD_COMMAND make -j
INSTALL_COMMAND make install
)

View File

@ -3,7 +3,6 @@ add_cmake_project(OpenCSG
URL https://github.com/floriankirsch/OpenCSG/archive/refs/tags/opencsg-1-4-2-release.zip
URL_HASH SHA256=51afe0db79af8386e2027d56d685177135581e0ee82ade9d7f2caff8deab5ec5
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in ./CMakeLists.txt
DEPENDS dep_GLEW
)
set(DEP_OpenCSG_DEPENDS ZLIB)
set(DEP_OpenCSG_DEPENDS GLEW ZLIB)

View File

@ -21,10 +21,10 @@ ExternalProject_Add(dep_OpenSSL
EXCLUDE_FROM_ALL ON
URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0l.tar.gz"
URL_HASH SHA256=e2acf0cf58d9bff2b42f2dc0aee79340c8ffe2c5e45d3ca4533dd5d4f5775b1d
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL
DOWNLOAD_DIR ${${PROJECT_NAME}_DEP_DOWNLOAD_DIR}/OpenSSL
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch}
"--prefix=${DESTDIR}/usr/local"
"--prefix=${PROJECT_NAME}_DEP_INSTALL_PREFIX"
${_cross_comp_prefix_line}
no-shared
no-ssl3-method

View File

@ -7,7 +7,7 @@ else()
endif()
set (_openvdb_vdbprint ON)
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_BUILD_TYPE} STREQUAL Debug)
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR NOT ${CMAKE_BUILD_TYPE} STREQUAL Release)
# Build fails on raspberry pi due to missing link directive to latomic
# Let's hope it will be fixed soon.
set (_openvdb_vdbprint OFF)

16
deps/CMakeLists.txt vendored
View File

@ -28,6 +28,16 @@ project(PrusaSlicer_deps)
set(${PROJECT_NAME}_PACKAGE_EXCLUDES "" CACHE STRING "Exclude packages matching this regex pattern")
# Support legacy parameter DESTDIR
if (DESTDIR)
set(${PROJECT_NAME}_DEP_INSTALL_PREFIX ${DESTDIR}/usr/local CACHE PATH "Destination directory" FORCE)
endif ()
# Support legacy parameter DEP_DOWNLOAD_DIR
if (DEP_DOWNLOAD_DIR)
set(${PROJECT_NAME}_DEP_DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR} CACHE PATH "Path for downloaded source packages." FORCE)
endif ()
# Slightly controversial
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake/modules)
@ -236,11 +246,11 @@ if (DEP_DEBUG AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -G${CMAKE_GENERATOR}
-DCMAKE_BUILD_TYPE=Debug
-DDEP_WX_GTK3=${DEP_WX_GTK3}
-DDEP_DOWNLOAD_DIR=${DEP_DOWNLOAD_DIR}
-DDESTDIR=${DESTDIR}
-D${PROJECT_NAME}_DEP_DOWNLOAD_DIR=${${PROJECT_NAME}_DEP_DOWNLOAD_DIR}
-D${PROJECT_NAME}_DEP_INSTALL_PREFIX=${${PROJECT_NAME}_DEP_INSTALL_PREFIX}
-D${PROJECT_NAME}_PACKAGE_EXCLUDES="${_excl_regexp}"
-D${PROJECT_NAME}_SELECT_ALL=${${PROJECT_NAME}_SELECT_ALL}
-DDEP_BUILD_VERBOSE=${DEP_BUILD_VERBOSE}
-D${PROJECT_NAME}_DEP_BUILD_VERBOSE=${${PROJECT_NAME}_DEP_BUILD_VERBOSE}
-DCMAKE_DEBUG_POSTFIX=d
#TODO: forward per-package selector variables
-DDEP_MESSAGES_WRITTEN=ON