diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2018-05-17 11:37:26 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2018-05-17 11:37:26 +0300 |
commit | fd829580e9c9c1f92e4a2338bcee35a5b319030a (patch) | |
tree | 7c79acf5d00e4775854649c871ff6a470e4117c6 /xs/src/libnest2d/tests/CMakeLists.txt | |
parent | b6b79458300f907e6878a71512912238bcb3e692 (diff) |
Working arrange_objects with DJD selection heuristic and a bottom-left placement strategy.
Diffstat (limited to 'xs/src/libnest2d/tests/CMakeLists.txt')
-rw-r--r-- | xs/src/libnest2d/tests/CMakeLists.txt | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/xs/src/libnest2d/tests/CMakeLists.txt b/xs/src/libnest2d/tests/CMakeLists.txt new file mode 100644 index 000000000..bfe32bfeb --- /dev/null +++ b/xs/src/libnest2d/tests/CMakeLists.txt @@ -0,0 +1,48 @@ + +# Try to find existing GTest installation +find_package(GTest QUIET) + +if(NOT GTEST_FOUND) + # Go and download google test framework, integrate it with the build + set(GTEST_LIBRARIES gtest gmock) + + 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 https://github.com/google/googletest.git + GIT_TAG release-1.8.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} + ) + +else() + include_directories(${GTEST_INCLUDE_DIRS} ) +endif() + +include_directories(BEFORE ${LIBNEST2D_HEADERS}) +add_executable(bp2d_tests test.cpp printer_parts.h printer_parts.cpp) +target_link_libraries(bp2d_tests libnest2d + ${GTEST_LIBRARIES} +) + +if(DEFINED LIBNEST2D_TEST_LIBRARIES) + target_link_libraries(bp2d_tests ${LIBNEST2D_TEST_LIBRARIES}) +endif() + +add_test(gtests bp2d_tests) + +add_executable(main EXCLUDE_FROM_ALL main.cpp printer_parts.cpp printer_parts.h) +target_link_libraries(main libnest2d) +target_include_directories(main PUBLIC ${CMAKE_SOURCE_DIR}) |