Add CMake files for the testbed

This commit is contained in:
Pierre Dejoue 2020-08-27 19:12:15 +02:00
parent 7125fdb13b
commit 05546087fb
2 changed files with 20 additions and 0 deletions

View File

@ -4,6 +4,7 @@ project(poly2tri LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
option(P2T_BUILD_TESTS "Build tests" OFF) option(P2T_BUILD_TESTS "Build tests" OFF)
option(P2T_BUILD_TESTBED "Build the testbed application" OFF)
file(GLOB SOURCES poly2tri/common/*.cc poly2tri/sweep/*.cc) file(GLOB SOURCES poly2tri/common/*.cc poly2tri/sweep/*.cc)
add_library(poly2tri ${SOURCES}) add_library(poly2tri ${SOURCES})
@ -13,3 +14,7 @@ if(P2T_BUILD_TESTS)
enable_testing() enable_testing()
add_subdirectory(unittest) add_subdirectory(unittest)
endif() endif()
if(P2T_BUILD_TESTBED)
add_subdirectory(testbed)
endif()

15
testbed/CMakeLists.txt Normal file
View File

@ -0,0 +1,15 @@
# Dependencies
find_package(glfw3 3.3 REQUIRED)
find_package(OpenGL REQUIRED)
# Build testbed
add_executable(testbed
main.cc
)
target_link_libraries(testbed
PRIVATE
glfw
OpenGL::GL
poly2tri
)