forked from Kallu-A/Tri-2-Quad-Mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (46 loc) · 1.62 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
cmake_minimum_required(VERSION 3.12...3.26)
project(Tri2QuadMesh LANGUAGES C CXX )
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE)
message("OSName: " ${OSName})
message("System name: " ${CMAKE_SYSTEM_NAME})
# Get config
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT is_multi_config AND NOT (CMAKE_BUILD_TYPE OR DEFINED ENV{CMAKE_BUILD_TYPE}))
set(CMAKE_BUILD_TYPE Release CACHE STRING "Release default")
endif()
# Get development version of ultimaille directly from git repository
include(FetchContent)
FetchContent_Declare(
ultimaille
GIT_REPOSITORY https://github.com/ssloy/ultimaille
GIT_TAG v2.0.0
)
FetchContent_MakeAvailable(ultimaille)
FetchContent_Declare(
param_parser
GIT_REPOSITORY https://github.com/ultimaille/param-parser
GIT_TAG v1.0.4
)
FetchContent_MakeAvailable(param_parser)
include_directories(${param_parser_SOURCE_DIR})
# Add ultimaille directory to get ultimaille CMakeLists
include_directories(${ultimaille_SOURCE_DIR})
# Add executable binary
add_executable(entrypoint src/entrypoint.cpp)
# Link binary with ultimaille / param-parser
target_link_libraries(entrypoint ${CMAKE_DL_LIBS} ultimaille $<$<BOOL:${OpenMP_CXX_FOUND}>:OpenMP::OpenMP_CXX>)
IF (NOT WIN32)
target_link_libraries(entrypoint m)
ENDIF()
if (NOT DEFINED OSName)
set(OSName ${CMAKE_SYSTEM_NAME})
endif()
set_target_properties(
entrypoint
PROPERTIES
OUTPUT_NAME "entrypoint_exec_${OSName}_addon"
)
# Copy asset files to build directory
configure_file(mesh/quarterdisk_tri.mesh mesh/quarterdisk_tri.mesh COPYONLY)