-
Notifications
You must be signed in to change notification settings - Fork 22
/
CMakeLists.txt
72 lines (50 loc) · 1.66 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.5)
project(obj2voxel LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Threads REQUIRED)
string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type)
if(build_type STREQUAL DEBUG)
message("Building obj2voxel DEBUG")
add_compile_definitions(VXIO_DEBUG)
elseif(build_type STREQUAL RELWITHDEBINFO)
message("Building obj2voxel RELEASE (with debug info)")
add_compile_definitions(VXIO_RELEASE)
else()
message("Building obj2voxel RELEASE")
add_compile_definitions(VXIO_RELEASE)
endif()
add_subdirectory(voxelio)
#####################
# OBJ2VOXEL LIBRARY #
#####################
add_library(obj2voxel STATIC
src/3rd_party/tinyobj.hpp
src/3rd_party/args.hpp
src/arrayvector.hpp
src/constants.hpp
src/ringbuffer.hpp
src/threading.hpp
src/triangle.hpp
src/util.hpp
src/voxelization.cpp
src/voxelization.hpp
src/io.cpp
src/io.hpp
src/obj2voxel.cpp
include/obj2voxel.h)
target_link_libraries(obj2voxel PRIVATE voxelio PRIVATE ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(obj2voxel PRIVATE voxelio/include)
target_include_directories(obj2voxel PUBLIC include)
#################
# OBJ2VOXEL CLI #
#################
add_executable(obj2voxel-cli src/main.cpp)
set_target_properties(obj2voxel-cli PROPERTIES OUTPUT_NAME "obj2voxel")
target_link_libraries(obj2voxel-cli PRIVATE obj2voxel PRIVATE voxelio ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(obj2voxel-cli PRIVATE voxelio/include)
target_include_directories(obj2voxel-cli PRIVATE include)
###################
# OBJ2VOXEL TESTS #
###################
add_subdirectory(test)