-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (37 loc) · 1.36 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# To use VCPKG, uncomment
#set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
#message("Using Toolchain: ${CMAKE_TOOLCHAIN_FILE}")
cmake_minimum_required(VERSION 3.12)
project(base VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
find_package(GLUT REQUIRED)
find_package(OpenGL REQUIRED)
set(GL_SILENCE_DEPRECATION ON)
include(FetchContent)
option(LIBIGL_COPYLEFT_TETGEN "Build target igl_copyleft::tetgen" ON)
FetchContent_Declare(
libigl
GIT_REPOSITORY https://github.com/libigl/libigl.git
GIT_TAG 66b3ef2253e765d0ce0db74cec91bd706e5ba176
)
FetchContent_MakeAvailable(libigl)
option(BUILD_TESTING "Build tests" ON)
if (BUILD_TESTING)
enable_testing()
include(GoogleTest)
add_subdirectory(Tests)
endif ()
find_package(OpenGL REQUIRED)
add_subdirectory(Lib)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
macro(package_add_scene FILENAME)
add_executable(${FILENAME} Scenes/${FILENAME}.cc)
target_link_libraries(${FILENAME} PRIVATE ${OPENGL_LIBRARIES} GLUT::GLUT ${PROJECT_NAME})
endmacro()
package_add_scene(BunnyDropExplicit)
package_add_scene(StrandDropExplicit)
package_add_scene(StrandBendExplicit)
package_add_scene(StrandTwistExplicit)
package_add_scene(FrameDebug)
add_executable(viewer main.cc)
target_link_libraries(viewer PRIVATE ${OPENGL_LIBRARIES} GLUT::GLUT ${PROJECT_NAME})