mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 08:41:11 -06:00

Cleanup, fix build on windows and add test for rotcalipers. Try to fix compilation on windows With updates from libnest2d Another build fix. Clean up and add comments. adding rotcalipers test and some cleanup Trying to fix on OSX Fix rotcalipers array indexing Get rid of boost convex hull. Adding helper function 'remove_collinear_points' Importing new libnest2d upgrades. Disable using __int128 in NFP on OSX
60 lines
1.8 KiB
CMake
60 lines
1.8 KiB
CMake
|
|
# Try to find existing GTest installation
|
|
find_package(GTest 1.7)
|
|
|
|
if(NOT GTEST_FOUND)
|
|
set(URL_GTEST "https://github.com/google/googletest.git"
|
|
CACHE STRING "Google test source code repository location.")
|
|
|
|
message(STATUS "GTest not found so downloading from ${URL_GTEST}")
|
|
# Go and download google test framework, integrate it with the build
|
|
set(GTEST_LIBS_TO_LINK gtest gtest_main)
|
|
|
|
if (CMAKE_VERSION VERSION_LESS 3.2)
|
|
set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
|
|
else()
|
|
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
|
|
endif()
|
|
|
|
include(DownloadProject)
|
|
download_project(PROJ googletest
|
|
GIT_REPOSITORY ${URL_GTEST}
|
|
GIT_TAG release-1.7.0
|
|
${UPDATE_DISCONNECTED_IF_AVAILABLE}
|
|
)
|
|
|
|
# Prevent GoogleTest from overriding our compiler/linker options
|
|
# when building with Visual Studio
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
|
|
add_subdirectory(${googletest_SOURCE_DIR}
|
|
${googletest_BINARY_DIR}
|
|
)
|
|
|
|
set(GTEST_INCLUDE_DIRS ${googletest_SOURCE_DIR}/include)
|
|
|
|
else()
|
|
find_package(Threads REQUIRED)
|
|
set(GTEST_LIBS_TO_LINK ${GTEST_BOTH_LIBRARIES} Threads::Threads)
|
|
endif()
|
|
|
|
add_executable(tests_clipper_nlopt
|
|
test.cpp
|
|
../tools/svgtools.hpp
|
|
# ../tools/libnfpglue.hpp
|
|
# ../tools/libnfpglue.cpp
|
|
printer_parts.h
|
|
printer_parts.cpp
|
|
)
|
|
|
|
target_link_libraries(tests_clipper_nlopt libnest2d ${GTEST_LIBS_TO_LINK} )
|
|
|
|
target_include_directories(tests_clipper_nlopt PRIVATE BEFORE ${GTEST_INCLUDE_DIRS})
|
|
|
|
if(NOT LIBNEST2D_HEADER_ONLY)
|
|
target_link_libraries(tests_clipper_nlopt ${LIBNAME})
|
|
else()
|
|
target_link_libraries(tests_clipper_nlopt libnest2d)
|
|
endif()
|
|
|
|
add_test(libnest2d_tests tests_clipper_nlopt)
|