forked from prusa3d/PrusaSlicer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove unused libnest2d files. Make it use the global build script targets. * Modify FindTBB to address multi-config builds and take care of __TBB_NO_IMPLICIT_LINKAGE * Move FindNLopt to project common cmake module dir * Rename libnest.hpp to nester.hpp and libnest.h to libnest.hpp * Clean up common test suite build scripts
- Loading branch information
1 parent
62b7892
commit fbc174a
Showing
30 changed files
with
1,536 additions
and
5,910 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,31 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
project(Libnest2D) | ||
|
||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) | ||
# Update if necessary | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long ") | ||
endif() | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED) | ||
|
||
# Add our own cmake module path. | ||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/) | ||
|
||
option(LIBNEST2D_HEADER_ONLY "If enabled static library will not be built." ON) | ||
|
||
set(GEOMETRY_BACKENDS clipper boost eigen) | ||
set(LIBNEST2D_GEOMETRIES clipper CACHE STRING "Geometry backend") | ||
set_property(CACHE LIBNEST2D_GEOMETRIES PROPERTY STRINGS ${GEOMETRY_BACKENDS}) | ||
list(FIND GEOMETRY_BACKENDS ${LIBNEST2D_GEOMETRIES} GEOMETRY_TYPE) | ||
if(${GEOMETRY_TYPE} EQUAL -1) | ||
message(FATAL_ERROR "Option ${LIBNEST2D_GEOMETRIES} not supported, valid entries are ${GEOMETRY_BACKENDS}") | ||
endif() | ||
|
||
set(OPTIMIZERS nlopt optimlib) | ||
set(LIBNEST2D_OPTIMIZER nlopt CACHE STRING "Optimization backend") | ||
set_property(CACHE LIBNEST2D_OPTIMIZER PROPERTY STRINGS ${OPTIMIZERS}) | ||
list(FIND OPTIMIZERS ${LIBNEST2D_OPTIMIZER} OPTIMIZER_TYPE) | ||
if(${OPTIMIZER_TYPE} EQUAL -1) | ||
message(FATAL_ERROR "Option ${LIBNEST2D_OPTIMIZER} not supported, valid entries are ${OPTIMIZERS}") | ||
endif() | ||
|
||
add_library(libnest2d INTERFACE) | ||
|
||
set(SRC_DIR ${PROJECT_SOURCE_DIR}/include) | ||
|
||
set(LIBNEST2D_SRCFILES | ||
${SRC_DIR}/libnest2d/libnest2d.hpp # Templates only | ||
${SRC_DIR}/libnest2d/geometry_traits.hpp | ||
${SRC_DIR}/libnest2d/geometry_traits_nfp.hpp | ||
${SRC_DIR}/libnest2d/common.hpp | ||
${SRC_DIR}/libnest2d/optimizer.hpp | ||
${SRC_DIR}/libnest2d/utils/metaloop.hpp | ||
${SRC_DIR}/libnest2d/utils/rotfinder.hpp | ||
${SRC_DIR}/libnest2d/utils/rotcalipers.hpp | ||
${SRC_DIR}/libnest2d/utils/bigint.hpp | ||
${SRC_DIR}/libnest2d/utils/rational.hpp | ||
${SRC_DIR}/libnest2d/placers/placer_boilerplate.hpp | ||
${SRC_DIR}/libnest2d/placers/bottomleftplacer.hpp | ||
${SRC_DIR}/libnest2d/placers/nfpplacer.hpp | ||
${SRC_DIR}/libnest2d/selections/selection_boilerplate.hpp | ||
${SRC_DIR}/libnest2d/selections/filler.hpp | ||
${SRC_DIR}/libnest2d/selections/firstfit.hpp | ||
${SRC_DIR}/libnest2d/selections/djd_heuristic.hpp | ||
include/libnest2d/libnest2d.hpp | ||
include/libnest2d/nester.hpp | ||
include/libnest2d/geometry_traits.hpp | ||
include/libnest2d/geometry_traits_nfp.hpp | ||
include/libnest2d/common.hpp | ||
include/libnest2d/optimizer.hpp | ||
include/libnest2d/utils/metaloop.hpp | ||
include/libnest2d/utils/rotfinder.hpp | ||
include/libnest2d/utils/rotcalipers.hpp | ||
include/libnest2d/placers/placer_boilerplate.hpp | ||
include/libnest2d/placers/bottomleftplacer.hpp | ||
include/libnest2d/placers/nfpplacer.hpp | ||
include/libnest2d/selections/selection_boilerplate.hpp | ||
#include/libnest2d/selections/filler.hpp | ||
include/libnest2d/selections/firstfit.hpp | ||
#include/libnest2d/selections/djd_heuristic.hpp | ||
include/libnest2d/backends/clipper/geometries.hpp | ||
include/libnest2d/backends/clipper/clipper_polygon.hpp | ||
include/libnest2d/optimizers/nlopt/nlopt_boilerplate.hpp | ||
include/libnest2d/optimizers/nlopt/simplex.hpp | ||
include/libnest2d/optimizers/nlopt/subplex.hpp | ||
include/libnest2d/optimizers/nlopt/genetic.hpp | ||
src/libnest2d.cpp | ||
) | ||
|
||
set(TBB_STATIC ON) | ||
find_package(TBB QUIET) | ||
if(TBB_FOUND) | ||
message(STATUS "Parallelization with Intel TBB") | ||
target_include_directories(libnest2d INTERFACE ${TBB_INCLUDE_DIRS}) | ||
target_compile_definitions(libnest2d INTERFACE ${TBB_DEFINITIONS} -DUSE_TBB) | ||
if(MSVC) | ||
# Suppress implicit linking of the TBB libraries by the Visual Studio compiler. | ||
target_compile_definitions(libnest2d INTERFACE -D__TBB_NO_IMPLICIT_LINKAGE) | ||
endif() | ||
# The Intel TBB library will use the std::exception_ptr feature of C++11. | ||
target_compile_definitions(libnest2d INTERFACE -DTBB_USE_CAPTURED_EXCEPTION=0) | ||
|
||
find_package(Threads REQUIRED) | ||
target_link_libraries(libnest2d INTERFACE | ||
tbb # VS debug mode needs linking this way: | ||
# ${TBB_LIBRARIES} | ||
${CMAKE_DL_LIBS} | ||
Threads::Threads | ||
) | ||
else() | ||
find_package(OpenMP QUIET) | ||
|
||
if(OpenMP_CXX_FOUND) | ||
message(STATUS "Parallelization with OpenMP") | ||
target_include_directories(libnest2d INTERFACE OpenMP::OpenMP_CXX) | ||
target_link_libraries(libnest2d INTERFACE OpenMP::OpenMP_CXX) | ||
else() | ||
message("Parallelization with C++11 threads") | ||
find_package(Threads REQUIRED) | ||
target_link_libraries(libnest2d INTERFACE Threads::Threads) | ||
endif() | ||
endif() | ||
|
||
add_subdirectory(${SRC_DIR}/libnest2d/backends/${LIBNEST2D_GEOMETRIES}) | ||
target_link_libraries(libnest2d INTERFACE ${LIBNEST2D_GEOMETRIES}Backend) | ||
|
||
add_subdirectory(${SRC_DIR}/libnest2d/optimizers/${LIBNEST2D_OPTIMIZER}) | ||
target_link_libraries(libnest2d INTERFACE ${LIBNEST2D_OPTIMIZER}Optimizer) | ||
|
||
# target_sources(libnest2d INTERFACE ${LIBNEST2D_SRCFILES}) | ||
target_include_directories(libnest2d INTERFACE ${SRC_DIR}) | ||
add_library(libnest2d ${LIBNEST2D_SRCFILES}) | ||
|
||
if(NOT LIBNEST2D_HEADER_ONLY) | ||
set(LIBNAME libnest2d_${LIBNEST2D_GEOMETRIES}_${LIBNEST2D_OPTIMIZER}) | ||
add_library(${LIBNAME} ${PROJECT_SOURCE_DIR}/src/libnest2d.cpp) | ||
target_link_libraries(${LIBNAME} PUBLIC libnest2d) | ||
target_compile_definitions(${LIBNAME} PUBLIC LIBNEST2D_STATIC) | ||
endif() | ||
target_include_directories(libnest2d PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) | ||
target_link_libraries(libnest2d PUBLIC clipper NLopt::nlopt TBB::tbb Boost::boost) | ||
target_compile_definitions(libnest2d PUBLIC LIBNEST2D_STATIC LIBNEST2D_OPTIMIZER_nlopt LIBNEST2D_GEOMETRIES_clipper) |
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/libnest2d/cmake_modules/DownloadProject.CMakeLists.cmake.in
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.