From ff4e8d94c0bbd17cc58e066802c77ab75c5ec95c Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 28 Aug 2017 23:11:43 +0200 Subject: [PATCH] CMake build process: Workaround for an old CMake on Linux. --- CMakeLists.txt | 14 +++++++++----- xs/CMakeLists.txt | 5 +++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65b326d4a..43d7dee70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,11 +8,15 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE) endif() -if (MSVC OR MINGW OR APPLE) - set(SLIC3R_STATIC_INITIAL 1) -else () - set(SLIC3R_STATIC_INITIAL 0) -endif () +if(DEFINED ENV{SLIC3R_STATIC}) + set(SLIC3R_STATIC_INITIAL $ENV{SLIC3R_STATIC}) +else() + if (MSVC OR MINGW OR APPLE) + set(SLIC3R_STATIC_INITIAL 1) + else() + set(SLIC3R_STATIC_INITIAL 0) + endif() +endif() option(SLIC3R_STATIC "Compile Slic3r with static libraries (Boost, TBB, glew)" ${SLIC3R_STATIC_INITIAL}) option(SLIC3R_GUI "Compile Slic3r with GUI components (OpenGL, wxWidgets)" 1) diff --git a/xs/CMakeLists.txt b/xs/CMakeLists.txt index 7be742216..68f061f25 100644 --- a/xs/CMakeLists.txt +++ b/xs/CMakeLists.txt @@ -5,6 +5,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # Add our own cmake module path. list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/) +if (UNIX) + # Workaround for an old CMake, which does not understand CMAKE_CXX_STANDARD. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +endif() + # Where all the bundled libraries reside? set(LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/src/) # For the bundled boost libraries (boost::nowide)