Skip to content

Commit

Permalink
Merge branch 'master' into lm_tm_hollowing
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmatena committed Dec 12, 2019
2 parents 135660d + c284a65 commit 5372604
Show file tree
Hide file tree
Showing 185 changed files with 83,220 additions and 4,531 deletions.
47 changes: 39 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8)
project(PrusaSlicer)
cmake_minimum_required(VERSION 3.2)

include("version.inc")
include(GNUInstallDirs)
Expand Down Expand Up @@ -369,18 +369,24 @@ if (NOT EXPAT_FOUND)
endif ()
include_directories(${EXPAT_INCLUDE_DIRS})

find_package(OpenGL REQUIRED)

# Find glew or use bundled version
if (NOT SLIC3R_STATIC)
find_package(GLEW)
endif ()
if (SLIC3R_STATIC)
set(GLEW_USE_STATIC_LIBS ON)
set(GLEW_VERBOSE ON)
endif()

find_package(GLEW)
if (NOT GLEW_FOUND)
message(STATUS "GLEW not found, using bundled version.")
add_library(glew STATIC ${LIBDIR}/glew/src/glew.c)
set(GLEW_FOUND 1)
set(GLEW_FOUND TRUE)
set(GLEW_INCLUDE_DIRS ${LIBDIR}/glew/include/)
set(GLEW_LIBRARIES glew)
add_definitions(-DGLEW_STATIC)
target_compile_definitions(glew PUBLIC GLEW_STATIC)
target_include_directories(glew PUBLIC ${GLEW_INCLUDE_DIRS})
add_library(GLEW::GLEW ALIAS glew)
endif ()
include_directories(${GLEW_INCLUDE_DIRS})

# Find the Cereal serialization library
add_library(cereal INTERFACE)
Expand All @@ -403,11 +409,36 @@ if(SLIC3R_STATIC)
set(USE_BLOSC TRUE)
endif()


find_package(OpenVDB 5.0 COMPONENTS openvdb)
if(OpenVDB_FOUND)
slic3r_remap_configs(IlmBase::Half RelWithDebInfo Release)
endif()

set(TOP_LEVEL_PROJECT_DIR ${PROJECT_SOURCE_DIR})
function(prusaslicer_copy_dlls target)
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(_bits 64)
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(_bits 32)
endif ()

get_target_property(_out_dir ${target} BINARY_DIR)

# This has to be a separate target due to the windows command line lenght limits
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll ${_out_dir}/
COMMENT "Copy gmp runtime to build tree"
VERBATIM)

add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll ${_out_dir}/
COMMENT "Copy mpfr runtime to build tree"
VERBATIM)

endfunction()


# libslic3r, PrusaSlicer GUI and the PrusaSlicer executable.
add_subdirectory(src)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT PrusaSlicer_app_console)
Expand Down
Loading

0 comments on commit 5372604

Please sign in to comment.