forked from recastnavigation/recastnavigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
88 lines (72 loc) · 2.44 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
cmake_minimum_required(VERSION 3.0)
project(RecastNavigation)
# lib versions
SET(SOVERSION 1)
set(LIB_VERSION 1.5.1)
string(REPLACE "." "," LIB_VERSION_NUM "${LIB_VERSION}.0")
set_property(GLOBAL PROPERTY CXX_STANDARD 98)
option(RECASTNAVIGATION_DEMO "Build demo" ON)
option(RECASTNAVIGATION_TESTS "Build tests" ON)
option(RECASTNAVIGATION_EXAMPLES "Build examples" ON)
if(MSVC AND BUILD_SHARED_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
configure_file(
"${RecastNavigation_SOURCE_DIR}/version.h.in"
"${RecastNavigation_BINARY_DIR}/version.h")
install(FILES "${RecastNavigation_BINARY_DIR}/version.h" DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
# Needed for recastnavigation.pc.in
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
set(bindir "\${exec_prefix}/${CMAKE_INSTALL_BINDIR}")
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
set(PACKAGE_VERSION "${LIB_VERSION}")
configure_file(
"${RecastNavigation_SOURCE_DIR}/recastnavigation.pc.in"
"${RecastNavigation_BINARY_DIR}/recastnavigation.pc"
@ONLY)
install(FILES "${RecastNavigation_BINARY_DIR}/recastnavigation.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
add_subdirectory(DebugUtils)
add_subdirectory(Detour)
add_subdirectory(DetourCrowd)
add_subdirectory(DetourTileCache)
add_subdirectory(Recast)
configure_package_config_file(
${PROJECT_SOURCE_DIR}/recastnavigation-config.cmake.in
recastnavigation-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/recastnavigation
)
write_basic_package_version_file(
recastnavigation-config-version.cmake
VERSION ${LIB_VERSION}
COMPATIBILITY AnyNewerVersion
)
export(
EXPORT recastnavigation-targets
NAMESPACE RecastNavigation::
FILE recastnavigation-targets.cmake
)
install(
EXPORT recastnavigation-targets
NAMESPACE RecastNavigation::
FILE recastnavigation-targets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/recastnavigation
)
install(
FILES
${PROJECT_BINARY_DIR}/recastnavigation-config.cmake
${PROJECT_BINARY_DIR}/recastnavigation-config-version.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/recastnavigation
)
if (RECASTNAVIGATION_DEMO)
add_subdirectory(RecastDemo)
endif ()
if (RECASTNAVIGATION_TESTS)
enable_testing()
add_subdirectory(Tests)
endif ()