Build system tweaks to get rid of cmake and boost warnings.

This commit is contained in:
tamasmeszaros 2019-05-30 17:48:32 +02:00
parent 9c46eed742
commit 96380180f4
9 changed files with 37 additions and 24 deletions

View File

@ -241,7 +241,7 @@ if(NOT WIN32)
endif()
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS system filesystem thread log locale regex)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
# include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
if (APPLE)
# BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339
add_definitions(-DBOOST_ASIO_DISABLE_KQUEUE)

View File

@ -142,6 +142,7 @@ if (MSVC)
target_compile_definitions(PrusaSlicer_app_gui PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE)
add_dependencies(PrusaSlicer_app_gui PrusaSlicer)
set_target_properties(PrusaSlicer_app_gui PROPERTIES OUTPUT_NAME "prusa-slicer")
target_include_directories(PrusaSlicer_app_gui SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
add_executable(PrusaSlicer_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/PrusaSlicer.rc)
# Generate debug symbols even in release mode.
@ -149,6 +150,7 @@ if (MSVC)
target_compile_definitions(PrusaSlicer_app_console PRIVATE -DSLIC3R_WRAPPER_CONSOLE)
add_dependencies(PrusaSlicer_app_console PrusaSlicer)
set_target_properties(PrusaSlicer_app_console PROPERTIES OUTPUT_NAME "prusa-slicer-console")
target_include_directories(PrusaSlicer_app_console SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
endif ()
# Link the resources dir to where Slic3r GUI expects it

View File

@ -10,3 +10,5 @@ add_library(admesh STATIC
stlinit.cpp
util.cpp
)
target_include_directories(admesh SYSTEM PRIVATE ${Boost_INCLUDE_DIRS})

View File

@ -18,3 +18,7 @@ add_library(nowide STATIC
nowide/utf8_codecvt.hpp
nowide/windows.hpp
)
target_include_directories(nowide SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})

View File

@ -91,9 +91,11 @@ else()
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_sources(libnest2d INTERFACE ${LIBNEST2D_SRCFILES})
target_include_directories(libnest2d INTERFACE ${SRC_DIR})
if(NOT LIBNEST2D_HEADER_ONLY)

View File

@ -50,8 +50,8 @@ if(NOT TARGET clipper) # If there is a clipper target in the parent project we a
else()
# set(CLIPPER_INCLUDE_DIRS "" PARENT_SCOPE)
# set(CLIPPER_LIBRARIES clipper PARENT_SCOPE)
add_library(ClipperBackend INTERFACE)
target_link_libraries(ClipperBackend INTERFACE clipper)
add_library(clipperBackend INTERFACE)
target_link_libraries(clipperBackend INTERFACE clipper)
endif()
# Clipper backend is not enough on its own, it still needs some functions
@ -61,14 +61,14 @@ if(NOT Boost_INCLUDE_DIRS_FOUND)
# TODO automatic download of boost geometry headers
endif()
target_include_directories(ClipperBackend INTERFACE ${Boost_INCLUDE_DIRS} )
target_sources(ClipperBackend INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/geometries.hpp
${CMAKE_CURRENT_SOURCE_DIR}/clipper_polygon.hpp
${SRC_DIR}/libnest2d/utils/boost_alg.hpp )
target_include_directories(clipperBackend SYSTEM INTERFACE ${Boost_INCLUDE_DIRS} )
#target_sources(ClipperBackend INTERFACE
# ${CMAKE_CURRENT_SOURCE_DIR}/geometries.hpp
# ${CMAKE_CURRENT_SOURCE_DIR}/clipper_polygon.hpp
# ${SRC_DIR}/libnest2d/utils/boost_alg.hpp )
target_compile_definitions(ClipperBackend INTERFACE LIBNEST2D_BACKEND_CLIPPER)
target_compile_definitions(clipperBackend INTERFACE LIBNEST2D_BACKEND_CLIPPER)
# And finally plug the ClipperBackend into libnest2d
target_link_libraries(libnest2d INTERFACE ClipperBackend)
#target_link_libraries(libnest2d INTERFACE ClipperBackend)

View File

@ -39,23 +39,23 @@ if(NOT NLopt_FOUND)
set(NLopt_INCLUDE_DIR ${nlopt_BINARY_DIR} ${nlopt_BINARY_DIR}/src/api)
set(SHARED_LIBS_STATE ${SHARED_STATE})
add_library(NloptOptimizer INTERFACE)
target_link_libraries(NloptOptimizer INTERFACE nlopt)
target_include_directories(NloptOptimizer INTERFACE ${NLopt_INCLUDE_DIR})
add_library(nloptOptimizer INTERFACE)
target_link_libraries(nloptOptimizer INTERFACE nlopt)
target_include_directories(nloptOptimizer INTERFACE ${NLopt_INCLUDE_DIR})
else()
add_library(NloptOptimizer INTERFACE)
target_link_libraries(NloptOptimizer INTERFACE Nlopt::Nlopt)
add_library(nloptOptimizer INTERFACE)
target_link_libraries(nloptOptimizer INTERFACE Nlopt::Nlopt)
endif()
target_sources( NloptOptimizer INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/simplex.hpp
${CMAKE_CURRENT_SOURCE_DIR}/subplex.hpp
${CMAKE_CURRENT_SOURCE_DIR}/genetic.hpp
${CMAKE_CURRENT_SOURCE_DIR}/nlopt_boilerplate.hpp
)
#target_sources( NloptOptimizer INTERFACE
#${CMAKE_CURRENT_SOURCE_DIR}/simplex.hpp
#${CMAKE_CURRENT_SOURCE_DIR}/subplex.hpp
#${CMAKE_CURRENT_SOURCE_DIR}/genetic.hpp
#${CMAKE_CURRENT_SOURCE_DIR}/nlopt_boilerplate.hpp
#)
target_compile_definitions(NloptOptimizer INTERFACE LIBNEST2D_OPTIMIZER_NLOPT)
target_compile_definitions(nloptOptimizer INTERFACE LIBNEST2D_OPTIMIZER_NLOPT)
# And finally plug the NloptOptimizer into libnest2d
target_link_libraries(libnest2d INTERFACE NloptOptimizer)
#target_link_libraries(libnest2d INTERFACE NloptOptimizer)

View File

@ -180,6 +180,7 @@ if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY)
endif ()
target_compile_definitions(libslic3r PUBLIC -DUSE_TBB)
target_include_directories(libslic3r SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
target_include_directories(libslic3r PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${LIBNEST2D_INCLUDES} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(libslic3r
libnest2d

View File

@ -12,3 +12,5 @@ add_library(miniz STATIC
miniz_tinfl.cpp
miniz_zip.cpp
)
target_link_libraries(miniz nowide)