forked from zeux/meshoptimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
41 lines (35 loc) · 1.08 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
project(meshoptimizer)
cmake_minimum_required(VERSION 3.0)
option(BUILD_DEMO "Build demo" OFF)
option(BUILD_TOOLS "Build tools" OFF)
set(SOURCES
src/meshoptimizer.h
src/clusterizer.cpp
src/indexcodec.cpp
src/indexgenerator.cpp
src/overdrawanalyzer.cpp
src/overdrawoptimizer.cpp
src/simplifier.cpp
src/stripcodec.cpp
src/stripifier.cpp
src/vcacheanalyzer.cpp
src/vcacheoptimizer.cpp
src/vertexcodec.cpp
src/vfetchanalyzer.cpp
src/vfetchoptimizer.cpp
)
add_library(meshoptimizer STATIC ${SOURCES})
target_include_directories(meshoptimizer INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/src")
if(MSVC)
target_compile_options(meshoptimizer PRIVATE /W4 /WX)
else()
target_compile_options(meshoptimizer PRIVATE -Wall -Wextra -Werror)
endif()
if(BUILD_DEMO)
add_executable(demo demo/main.cpp demo/miniz.cpp demo/tests.cpp tools/objparser.cpp)
target_link_libraries(demo meshoptimizer)
endif()
if(BUILD_TOOLS)
add_executable(meshencoder tools/meshencoder.cpp tools/objparser.cpp)
target_link_libraries(meshencoder meshoptimizer)
endif()