From 69139c2a6f83edc9f5da51991e8d5f4d89a50b1e Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Fri, 19 Mar 2021 19:03:31 +0100 Subject: [PATCH] Add NLopt the new way to dependencies --- deps/CMakeLists.txt | 4 +++- deps/NLopt/NLopt.cmake | 15 +++++++++++++++ deps/deps-unix-common.cmake | 14 -------------- deps/deps-windows.cmake | 21 --------------------- 4 files changed, 18 insertions(+), 36 deletions(-) create mode 100644 deps/NLopt/NLopt.cmake diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 718945828..5fa01c886 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -79,6 +79,7 @@ function(prusaslicer_add_cmake_project projectname) -DCMAKE_DEBUG_POSTFIX:STRING=d -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER} + -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} -DBUILD_SHARED_LIBS:BOOL=OFF "${_configs_line}" ${DEP_CMAKE_OPTS} @@ -150,6 +151,7 @@ include(OpenCSG/OpenCSG.cmake) include(GMP/GMP.cmake) include(MPFR/MPFR.cmake) include(CGAL/CGAL.cmake) +include(NLopt/NLopt.cmake) include(wxWidgets/wxWidgets.cmake) if (NOT "${ZLIB_PKG}" STREQUAL "") @@ -164,7 +166,7 @@ set(_dep_list dep_wxWidgets dep_gtest dep_cereal - dep_nlopt + dep_NLopt dep_openvdb dep_OpenCSG dep_CGAL diff --git a/deps/NLopt/NLopt.cmake b/deps/NLopt/NLopt.cmake new file mode 100644 index 000000000..db638c897 --- /dev/null +++ b/deps/NLopt/NLopt.cmake @@ -0,0 +1,15 @@ +prusaslicer_add_cmake_project(NLopt + URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz" + URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae + CMAKE_ARGS + -DNLOPT_PYTHON:BOOL=OFF + -DNLOPT_OCTAVE:BOOL=OFF + -DNLOPT_MATLAB:BOOL=OFF + -DNLOPT_GUILE:BOOL=OFF + -DNLOPT_SWIG:BOOL=OFF + -DNLOPT_TESTS:BOOL=OFF +) + +if (MSVC) + add_debug_dep(dep_NLopt) +endif () diff --git a/deps/deps-unix-common.cmake b/deps/deps-unix-common.cmake index 46c9f8864..f035817fe 100644 --- a/deps/deps-unix-common.cmake +++ b/deps/deps-unix-common.cmake @@ -47,20 +47,6 @@ ExternalProject_Add(dep_cereal ${DEP_CMAKE_OPTS} ) -ExternalProject_Add(dep_nlopt - EXCLUDE_FROM_ALL 1 - URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz" - URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae - CMAKE_ARGS - -DBUILD_SHARED_LIBS=OFF - -DNLOPT_PYTHON=OFF - -DNLOPT_OCTAVE=OFF - -DNLOPT_MATLAB=OFF - -DNLOPT_GUILE=OFF - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - ${DEP_CMAKE_OPTS} -) - ExternalProject_Add(dep_qhull EXCLUDE_FROM_ALL 1 #URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz" diff --git a/deps/deps-windows.cmake b/deps/deps-windows.cmake index fc9f55f5f..eab60f698 100644 --- a/deps/deps-windows.cmake +++ b/deps/deps-windows.cmake @@ -128,27 +128,6 @@ ExternalProject_Add(dep_cereal INSTALL_COMMAND "" ) -ExternalProject_Add(dep_nlopt - EXCLUDE_FROM_ALL 1 - URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz" - URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae - CMAKE_GENERATOR "${DEP_MSVC_GEN}" - CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}" - CMAKE_ARGS - -DBUILD_SHARED_LIBS=OFF - -DNLOPT_PYTHON=OFF - -DNLOPT_OCTAVE=OFF - -DNLOPT_MATLAB=OFF - -DNLOPT_GUILE=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DCMAKE_DEBUG_POSTFIX=d - "-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local" - BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj - INSTALL_COMMAND "" -) - -add_debug_dep(dep_nlopt) - if (${DEPS_BITS} EQUAL 32) set(DEP_LIBCURL_TARGET "x86") else ()