forked from jhasse/poly2tri
-
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.
- 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
- Loading branch information
1 parent
a269fb4
commit 7125fdb
Showing
6 changed files
with
61 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
cmake_minimum_required(VERSION 3.6) | ||
cmake_minimum_required(VERSION 3.12) | ||
|
||
project(poly2tri LANGUAGES CXX) | ||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
option(P2T_BUILD_TESTS "Build tests" OFF) | ||
|
||
file(GLOB SOURCES poly2tri/common/*.cc poly2tri/sweep/*.cc) | ||
add_library(poly2tri ${SOURCES}) | ||
target_include_directories(poly2tri INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
if(P2T_BUILD_TESTS) | ||
enable_testing() | ||
add_subdirectory(unittest) | ||
endif() |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# 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) |
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