forked from recastnavigation/recastnavigation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support build by CMake (recastnavigation#310)
- Loading branch information
1 parent
05dd77d
commit 4566d01
Showing
11 changed files
with
447 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,7 @@ RecastDemo/Contrib/SDL/* | |
|
||
## Generated doc files | ||
Docs/html | ||
|
||
## IDE files | ||
.idea/ | ||
cmake-build-*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
project(RecastNavigation) | ||
|
||
# lib versions | ||
SET(SOVERSION 1) | ||
SET(VERSION 1.0.0) | ||
|
||
option(RECASTNAVIGATION_DEMO "Build demo" ON) | ||
option(RECASTNAVIGATION_TESTS "Build tests" ON) | ||
option(RECASTNAVIGATION_EXAMPLES "Build examples" ON) | ||
option(RECASTNAVIGATION_STATIC "Build static libraries" OFF) | ||
|
||
add_subdirectory(DebugUtils) | ||
add_subdirectory(Detour) | ||
add_subdirectory(DetourCrowd) | ||
add_subdirectory(DetourTileCache) | ||
add_subdirectory(Recast) | ||
|
||
if (RECASTNAVIGATION_DEMO) | ||
add_subdirectory(RecastDemo) | ||
endif () | ||
|
||
if (RECASTNAVIGATION_TESTS) | ||
enable_testing() | ||
add_subdirectory(Tests) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
file(GLOB SOURCES Source/*.cpp) | ||
|
||
include_directories(../Recast/Include) | ||
include_directories(../Detour/Include) | ||
include_directories(../DetourTileCache/Include) | ||
include_directories(Include) | ||
|
||
if (RECASTNAVIGATION_STATIC) | ||
add_library(DebugUtils STATIC ${SOURCES}) | ||
else() | ||
add_library(DebugUtils SHARED ${SOURCES}) | ||
endif() | ||
|
||
set_target_properties(DebugUtils PROPERTIES | ||
SOVERSION ${SOVERSION} | ||
VERSION ${VERSION} | ||
) | ||
|
||
install(TARGETS DebugUtils | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
COMPONENT library | ||
) | ||
|
||
file(GLOB INCLUDES Include/*.h) | ||
install(FILES ${INCLUDES} DESTINATION include) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
file(GLOB SOURCES Source/*.cpp) | ||
|
||
include_directories(Include) | ||
|
||
if(RECASTNAVIGATION_STATIC) | ||
add_library(Detour STATIC ${SOURCES}) | ||
else() | ||
add_library(Detour SHARED ${SOURCES}) | ||
endif() | ||
|
||
set_target_properties(Detour PROPERTIES | ||
SOVERSION ${SOVERSION} | ||
VERSION ${VERSION} | ||
) | ||
|
||
install(TARGETS Detour | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
COMPONENT library | ||
) | ||
|
||
file(GLOB INCLUDES Include/*.h) | ||
install(FILES ${INCLUDES} DESTINATION include) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
file(GLOB SOURCES Source/*.cpp) | ||
|
||
include_directories(../Detour/Include) | ||
include_directories(Include) | ||
|
||
if (RECASTNAVIGATION_STATIC) | ||
add_library(DetourCrowd STATIC ${SOURCES}) | ||
else () | ||
add_library(DetourCrowd SHARED ${SOURCES}) | ||
endif () | ||
|
||
set_target_properties(DetourCrowd PROPERTIES | ||
SOVERSION ${SOVERSION} | ||
VERSION ${VERSION} | ||
) | ||
|
||
install(TARGETS DetourCrowd | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
COMPONENT library | ||
) | ||
|
||
file(GLOB INCLUDES Include/*.h) | ||
install(FILES ${INCLUDES} DESTINATION include) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
file(GLOB SOURCES Source/*.cpp) | ||
|
||
include_directories(../Detour/Include) | ||
include_directories(Include) | ||
|
||
if (RECASTNAVIGATION_STATIC) | ||
add_library(DetourTileCache STATIC ${SOURCES}) | ||
else () | ||
add_library(DetourTileCache SHARED ${SOURCES}) | ||
endif () | ||
|
||
set_target_properties(DetourTileCache PROPERTIES | ||
SOVERSION ${SOVERSION} | ||
VERSION ${VERSION} | ||
) | ||
|
||
|
||
install(TARGETS DetourTileCache | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
COMPONENT library | ||
) | ||
|
||
file(GLOB INCLUDES Include/*.h) | ||
install(FILES ${INCLUDES} DESTINATION include) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
file(GLOB SOURCES Source/*.cpp) | ||
|
||
include_directories(Include) | ||
|
||
if (RECASTNAVIGATION_STATIC) | ||
add_library(Recast STATIC ${SOURCES}) | ||
else () | ||
add_library(Recast SHARED ${SOURCES}) | ||
endif () | ||
|
||
set_target_properties(Recast PROPERTIES | ||
SOVERSION ${SOVERSION} | ||
VERSION ${VERSION} | ||
) | ||
|
||
install(TARGETS Recast | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
COMPONENT library | ||
) | ||
|
||
file(GLOB INCLUDES Include/*.h) | ||
install(FILES ${INCLUDES} DESTINATION include) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
file(GLOB SOURCES Source/*.cpp Contrib/fastlz/fastlz.c) | ||
|
||
include(cmake/FindSDL2.cmake) | ||
|
||
find_package(OpenGL REQUIRED) | ||
find_package(SDL2 REQUIRED) | ||
|
||
include_directories(SYSTEM ${OPENGL_INCLUDE_DIR}) | ||
include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) | ||
include_directories(SYSTEM Contrib/fastlz) | ||
include_directories(SYSTEM Contrib) | ||
include_directories(../DebugUtils/Include) | ||
include_directories(../Detour/Include) | ||
include_directories(../DetourCrowd/Include) | ||
include_directories(../DetourTileCache/Include) | ||
include_directories(../Recast/Include) | ||
include_directories(Include) | ||
|
||
add_executable(RecastDemo ${SOURCES}) | ||
file(COPY Bin/Meshes DESTINATION ${CMAKE_BINARY_DIR}/RecastDemo) | ||
file(COPY Bin/TestCases DESTINATION ${CMAKE_BINARY_DIR}/RecastDemo) | ||
file(COPY Bin/DroidSans.ttf DESTINATION ${CMAKE_BINARY_DIR}/RecastDemo) | ||
|
||
add_dependencies(RecastDemo DebugUtils Detour DetourCrowd DetourTileCache Recast) | ||
target_link_libraries(RecastDemo ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} DebugUtils Detour DetourCrowd DetourTileCache Recast) | ||
|
||
install(TARGETS RecastDemo RUNTIME DESTINATION bin) |
Oops, something went wrong.