poly2tri/unittest/CMakeLists.txt
Pierre Dejoue 7125fdb13b Add CMake files for the unit tests
- Building unit tests is optional, disabled by default to prevent
  the library clients from pulling the dependency on boost
- Add the unit tests to the Github Actions.
- Use boost::filesystem to manipulate paths for better portability
2020-08-27 19:16:17 +02:00

33 lines
551 B
CMake

# Dependencies
if (WIN32)
set(Boost_USE_STATIC_LIBS ON)
endif()
find_package(Boost 1.69 REQUIRED COMPONENTS
filesystem
unit_test_framework
)
# Build Unit Tests
add_executable(test_poly2tri
main.cpp
TriangleTest.cpp
)
target_include_directories(test_poly2tri
PRIVATE
${Boost_INCLUDE_DIRS}
)
target_compile_definitions(test_poly2tri
PRIVATE
P2T_BASE_DIR="${PROJECT_SOURCE_DIR}"
)
target_link_libraries(test_poly2tri
PRIVATE
poly2tri
${Boost_LIBRARIES}
)
add_test(NAME poly2tri COMMAND test_poly2tri)