From 421089ebc816d2b440581e809e79b8c9e647193d Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 19 Aug 2021 16:56:22 +0200 Subject: [PATCH] Possibility to link curl and glew dynamically in static mode. --- CMakeLists.txt | 6 +++--- src/slic3r/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7d3dbf92..0f6b09983 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -405,7 +405,7 @@ else() target_link_libraries(libcurl INTERFACE crypt32) endif() -if (SLIC3R_STATIC) +if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL) if (NOT APPLE) # libcurl is always linked dynamically to the system libcurl on OSX. # On other systems, libcurl is linked statically if SLIC3R_STATIC is set. @@ -456,13 +456,13 @@ set(OpenGL_GL_PREFERENCE "LEGACY") find_package(OpenGL REQUIRED) # Find glew or use bundled version -if (SLIC3R_STATIC) +if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_GLEW) set(GLEW_USE_STATIC_LIBS ON) set(GLEW_VERBOSE ON) endif() find_package(GLEW) -if (NOT GLEW_FOUND) +if (NOT TARGET GLEW::GLEW) message(STATUS "GLEW not found, using bundled version.") add_library(glew STATIC ${LIBDIR}/glew/src/glew.c) set(GLEW_FOUND TRUE) diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index 3d89025cc..34f1a188d 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -268,7 +268,7 @@ if(APPLE) target_link_libraries(libslic3r_gui ${DISKARBITRATION_LIBRARY}) endif() -if (SLIC3R_STATIC AND UNIX AND NOT APPLE) +if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL AND UNIX AND NOT APPLE) target_compile_definitions(libslic3r_gui PRIVATE OPENSSL_CERT_OVERRIDE) endif ()