-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
70 lines (61 loc) · 2.01 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
67
68
69
70
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(tinyurdf VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
set(BUILD_SHARED_LIBS OFF)
set(BUILD_TESTS OFF)
set(USE_VTK OFF)
set(BUILD_EXAMPLES OFF)
set(BUILD_PYTHON3 OFF)
set(BUILD_DOCS OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
configure_file(${CMAKE_SOURCE_DIR}/include/tinyurdf/tinyurdf_config.h.in tinyurdf_config.h @ONLY)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -DDEBUG")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Od")
endif()
if(WIN32)
cmake_policy(SET CMP0135 NEW)
endif()
set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(ExternalEigen)
if(BUILD_PYTHON3)
include(ExternalPybind11)
endif()
if(USE_VTK)
include(ExternalVTK)
endif(USE_VTK)
add_subdirectory(extern/loguru)
add_subdirectory(extern/tinyxml2)
add_subdirectory(src)
if (BUILD_SHARED_LIBS)
set_target_properties(tinyurdf PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
if (BUILD_TESTS)
include(ExternalGTest)
add_subdirectory(test)
endif(BUILD_TESTS)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif(BUILD_EXAMPLES)
if(BUILD_PYTHON3)
add_subdirectory(python)
endif(BUILD_PYTHON3)
if(BUILD_DOCS)
add_subdirectory(docs)
endif(BUILD_DOCS)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/tinyurdf DESTINATION include)
install(FILES ${CMAKE_BINARY_DIR}/tinyurdf_config.h ${CMAKE_BINARY_DIR}/tinyurdf_config.h
DESTINATION include/tinyurdf)
install(TARGETS tinyurdf DESTINATION lib/tinyurdf)