mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-10-18 23:05:56 +00:00
CMake: Set the C++ standard version per-target rather than globally
Also clean up the CMakeLists.txt files a bit
This commit is contained in:
@@ -3,12 +3,10 @@ cmake_minimum_required(VERSION 3.1)
|
||||
project(RecastNavigation)
|
||||
|
||||
# lib versions
|
||||
SET(SOVERSION 1)
|
||||
set(SOVERSION 1)
|
||||
set(LIB_VERSION 1.6.0)
|
||||
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)
|
||||
@@ -16,7 +14,7 @@ option(RECASTNAVIGATION_DT_POLYREF64 "Use 64bit polyrefs instead of 32bit for De
|
||||
option(RECASTNAVIGATION_DT_VIRTUAL_QUERYFILTER "Use dynamic dispatch for dtQueryFilter in Detour to allow for custom filters" OFF)
|
||||
option(RECASTNAVIGATION_ENABLE_ASSERTS "Enable custom recastnavigation asserts" "$<IF:$<CONFIG:Debug>,ON,OFF>")
|
||||
|
||||
if(MSVC AND BUILD_SHARED_LIBS)
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
|
||||
@@ -26,8 +24,7 @@ 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)
|
||||
install(FILES "${RecastNavigation_BINARY_DIR}/version.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
|
||||
|
||||
# Needed for recastnavigation.pc.in
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
@@ -36,18 +33,18 @@ set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
set(bindir "${CMAKE_INSTALL_FULL_BINDIR}")
|
||||
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
|
||||
set(PACKAGE_VERSION "${LIB_VERSION}")
|
||||
if(RECASTNAVIGATION_DT_POLYREF64)
|
||||
if (RECASTNAVIGATION_DT_POLYREF64)
|
||||
set(PKG_CONFIG_CFLAGS "${PKG_CONFIG_CFLAGS} -DDT_POLYREF64")
|
||||
endif()
|
||||
if(RECASTNAVIGATION_DT_VIRTUAL_QUERYFILTER)
|
||||
if (RECASTNAVIGATION_DT_VIRTUAL_QUERYFILTER)
|
||||
set(PKG_CONFIG_CFLAGS "${PKG_CONFIG_CFLAGS} -DDT_VIRTUAL_QUERYFILTER")
|
||||
endif()
|
||||
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")
|
||||
"${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)
|
||||
@@ -89,9 +86,9 @@ install(
|
||||
|
||||
if (RECASTNAVIGATION_DEMO)
|
||||
add_subdirectory(RecastDemo)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
if (RECASTNAVIGATION_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(Tests)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
@@ -1,39 +1,37 @@
|
||||
file(GLOB SOURCES Source/*.cpp)
|
||||
add_library(DebugUtils ${SOURCES})
|
||||
|
||||
add_library(RecastNavigation::DebugUtils ALIAS DebugUtils)
|
||||
set_target_properties(DebugUtils PROPERTIES DEBUG_POSTFIX -d)
|
||||
|
||||
set_target_properties(DebugUtils PROPERTIES
|
||||
DEBUG_POSTFIX -d
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "DebugUtils-d"
|
||||
CXX_STANDARD 98
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF # Disable compiler-specific extensions
|
||||
)
|
||||
|
||||
# Set include path
|
||||
set(DebugUtils_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
|
||||
|
||||
target_include_directories(DebugUtils PUBLIC
|
||||
"$<BUILD_INTERFACE:${DebugUtils_INCLUDE_DIR}>"
|
||||
)
|
||||
|
||||
target_link_libraries(DebugUtils
|
||||
Recast
|
||||
Detour
|
||||
DetourTileCache
|
||||
)
|
||||
|
||||
set_target_properties(DebugUtils PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "DebugUtils-d"
|
||||
)
|
||||
# Set linkages
|
||||
target_link_libraries(DebugUtils Recast Detour DetourTileCache)
|
||||
|
||||
install(TARGETS DebugUtils
|
||||
EXPORT recastnavigation-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation
|
||||
)
|
||||
EXPORT recastnavigation-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation
|
||||
)
|
||||
|
||||
file(GLOB INCLUDES Include/*.h)
|
||||
install(FILES ${INCLUDES} DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
|
||||
if(MSVC)
|
||||
install(FILES ${INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
|
||||
if (MSVC)
|
||||
install(FILES "$<TARGET_FILE_DIR:DebugUtils>/DebugUtils-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib" OPTIONAL)
|
||||
endif()
|
||||
|
||||
@@ -2,43 +2,47 @@ file(GLOB SOURCES Source/*.cpp)
|
||||
add_library(Detour ${SOURCES})
|
||||
|
||||
add_library(RecastNavigation::Detour ALIAS Detour)
|
||||
set_target_properties(Detour PROPERTIES DEBUG_POSTFIX -d)
|
||||
set_target_properties(Detour PROPERTIES
|
||||
DEBUG_POSTFIX -d
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "Detour-d"
|
||||
CXX_STANDARD 98
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF # Disable compiler-specific extensions
|
||||
)
|
||||
|
||||
set(Detour_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
|
||||
|
||||
if(RECASTNAVIGATION_DT_POLYREF64)
|
||||
# Set build options
|
||||
if (RECASTNAVIGATION_DT_POLYREF64)
|
||||
target_compile_definitions(Detour PUBLIC DT_POLYREF64)
|
||||
endif()
|
||||
if(RECASTNAVIGATION_DT_VIRTUAL_QUERYFILTER)
|
||||
|
||||
if (RECASTNAVIGATION_DT_VIRTUAL_QUERYFILTER)
|
||||
target_compile_definitions(Detour PUBLIC DT_VIRTUAL_QUERYFILTER)
|
||||
endif()
|
||||
|
||||
if(NOT RECASTNAVIGATION_ENABLE_ASSERTS)
|
||||
if (NOT RECASTNAVIGATION_ENABLE_ASSERTS)
|
||||
target_compile_definitions(Detour PUBLIC RC_DISABLE_ASSERTS)
|
||||
endif()
|
||||
|
||||
# Set include path
|
||||
set(Detour_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
|
||||
target_include_directories(Detour PUBLIC
|
||||
"$<BUILD_INTERFACE:${Detour_INCLUDE_DIR}>"
|
||||
)
|
||||
|
||||
set_target_properties(Detour PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "Detour-d"
|
||||
)
|
||||
|
||||
install(TARGETS Detour
|
||||
EXPORT recastnavigation-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation
|
||||
)
|
||||
EXPORT recastnavigation-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation
|
||||
)
|
||||
|
||||
file(GLOB INCLUDES Include/*.h)
|
||||
install(FILES ${INCLUDES} DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
|
||||
if(MSVC)
|
||||
if (MSVC)
|
||||
install(FILES "$<TARGET_FILE_DIR:Detour>/Detour-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib" OPTIONAL)
|
||||
endif()
|
||||
|
||||
@@ -2,36 +2,36 @@ file(GLOB SOURCES Source/*.cpp)
|
||||
add_library(DetourCrowd ${SOURCES})
|
||||
|
||||
add_library(RecastNavigation::DetourCrowd ALIAS DetourCrowd)
|
||||
set_target_properties(DetourCrowd PROPERTIES DEBUG_POSTFIX -d)
|
||||
set_target_properties(DetourCrowd PROPERTIES
|
||||
DEBUG_POSTFIX -d
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "DetourCrowd-d"
|
||||
CXX_STANDARD 98
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF # Disable compiler-specific extensions
|
||||
)
|
||||
|
||||
# Set include path
|
||||
set(DetourCrowd_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
|
||||
|
||||
target_include_directories(DetourCrowd PUBLIC
|
||||
"$<BUILD_INTERFACE:${DetourCrowd_INCLUDE_DIR}>"
|
||||
)
|
||||
|
||||
target_link_libraries(DetourCrowd
|
||||
Detour
|
||||
)
|
||||
|
||||
set_target_properties(DetourCrowd PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "DetourCrowd-d"
|
||||
)
|
||||
# Set linkages
|
||||
target_link_libraries(DetourCrowd Detour)
|
||||
|
||||
install(TARGETS DetourCrowd
|
||||
EXPORT recastnavigation-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation
|
||||
)
|
||||
EXPORT recastnavigation-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation
|
||||
)
|
||||
|
||||
file(GLOB INCLUDES Include/*.h)
|
||||
install(FILES ${INCLUDES} DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
|
||||
if(MSVC)
|
||||
install(FILES ${INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
|
||||
if (MSVC)
|
||||
install(FILES "$<TARGET_FILE_DIR:DetourCrowd>/DetourCrowd-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib" OPTIONAL)
|
||||
endif()
|
||||
|
||||
@@ -1,38 +1,37 @@
|
||||
file(GLOB SOURCES Source/*.cpp)
|
||||
add_library(DetourTileCache ${SOURCES})
|
||||
|
||||
add_library(RecastNavigation::DetourTileCache ALIAS DetourTileCache)
|
||||
set_target_properties(DetourTileCache PROPERTIES DEBUG_POSTFIX -d)
|
||||
|
||||
set_target_properties(DetourTileCache PROPERTIES
|
||||
DEBUG_POSTFIX -d
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "DetourTileCache-d"
|
||||
CXX_STANDARD 98
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF # Disable compiler-specific extensions
|
||||
)
|
||||
|
||||
# Set include path
|
||||
set(DetourTileCache_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
|
||||
|
||||
target_include_directories(DetourTileCache PUBLIC
|
||||
"$<BUILD_INTERFACE:${DetourTileCache_INCLUDE_DIR}>"
|
||||
)
|
||||
|
||||
target_link_libraries(DetourTileCache
|
||||
Detour
|
||||
)
|
||||
|
||||
set_target_properties(DetourTileCache PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "DetourTileCache-d"
|
||||
)
|
||||
|
||||
# Set linkages
|
||||
target_link_libraries(DetourTileCache Detour)
|
||||
|
||||
install(TARGETS DetourTileCache
|
||||
EXPORT recastnavigation-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation
|
||||
)
|
||||
EXPORT recastnavigation-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation
|
||||
)
|
||||
|
||||
file(GLOB INCLUDES Include/*.h)
|
||||
install(FILES ${INCLUDES} DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
|
||||
if(MSVC)
|
||||
install(FILES ${INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
|
||||
if (MSVC)
|
||||
install(FILES "$<TARGET_FILE_DIR:DetourTileCache>/DetourTileCache-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib" OPTIONAL)
|
||||
endif()
|
||||
|
||||
@@ -1,37 +1,38 @@
|
||||
file(GLOB SOURCES Source/*.cpp)
|
||||
add_library(Recast ${SOURCES})
|
||||
|
||||
add_library(RecastNavigation::Recast ALIAS Recast)
|
||||
set_target_properties(Recast PROPERTIES DEBUG_POSTFIX -d)
|
||||
|
||||
set_target_properties(Recast PROPERTIES
|
||||
DEBUG_POSTFIX -d
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "Recast-d"
|
||||
CXX_STANDARD 98
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF # Disable compiler-specific extensions
|
||||
)
|
||||
|
||||
# Set include path
|
||||
set(Recast_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
|
||||
|
||||
target_include_directories(Recast PUBLIC
|
||||
"$<BUILD_INTERFACE:${Recast_INCLUDE_DIR}>"
|
||||
)
|
||||
|
||||
if(NOT RECASTNAVIGATION_ENABLE_ASSERTS)
|
||||
if (NOT RECASTNAVIGATION_ENABLE_ASSERTS)
|
||||
target_compile_definitions(Recast PUBLIC RC_DISABLE_ASSERTS)
|
||||
endif()
|
||||
|
||||
set_target_properties(Recast PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "Recast-d"
|
||||
)
|
||||
|
||||
install(TARGETS Recast
|
||||
EXPORT recastnavigation-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation
|
||||
)
|
||||
EXPORT recastnavigation-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation
|
||||
)
|
||||
|
||||
file(GLOB INCLUDES Include/*.h)
|
||||
install(FILES ${INCLUDES} DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
|
||||
if(MSVC)
|
||||
install(FILES ${INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
|
||||
if (MSVC)
|
||||
install(FILES "$<TARGET_FILE_DIR:Recast>/Recast-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib" OPTIONAL)
|
||||
endif()
|
||||
|
||||
@@ -2,8 +2,8 @@ file(GLOB SOURCES Source/*.cpp Contrib/fastlz/fastlz.c)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
if(NOT SDL2_ROOT_DIR)
|
||||
if(WIN32)
|
||||
if (NOT SDL2_ROOT_DIR)
|
||||
if (WIN32)
|
||||
set(SDL2_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Contrib/SDL")
|
||||
elseif(APPLE)
|
||||
set(SDL2_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Bin")
|
||||
@@ -11,7 +11,7 @@ if(NOT SDL2_ROOT_DIR)
|
||||
endif()
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
if(APPLE)
|
||||
if (APPLE)
|
||||
find_library(SDL2_LIBRARY
|
||||
NAMES SDL2
|
||||
PATHS ${SDL2_ROOT_DIR}
|
||||
@@ -30,20 +30,26 @@ include_directories(../DetourTileCache/Include)
|
||||
include_directories(../Recast/Include)
|
||||
include_directories(Include)
|
||||
include_directories(Contrib/SDL/include)
|
||||
if(APPLE)
|
||||
if (APPLE)
|
||||
include_directories(${SDL2_LIBRARY}/Headers)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
add_executable(RecastDemo WIN32 ${SOURCES})
|
||||
elseif(APPLE)
|
||||
elseif (APPLE)
|
||||
add_executable(RecastDemo MACOSX_BUNDLE ${SOURCES})
|
||||
else()
|
||||
add_executable(RecastDemo ${SOURCES})
|
||||
endif()
|
||||
|
||||
if( WIN32 )
|
||||
if ( "${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild" )
|
||||
set_target_properties(RecastDemo PROPERTIES
|
||||
CXX_STANDARD 20
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF # Disable compiler-specific extensions
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
if ("${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild")
|
||||
add_custom_command(TARGET RecastDemo
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${SDL2_RUNTIME_LIBRARY}" ${CMAKE_BINARY_DIR}/RecastDemo/$(ConfigurationName)/
|
||||
@@ -51,7 +57,7 @@ if( WIN32 )
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Bin/TestCases ${CMAKE_BINARY_DIR}/RecastDemo/$(ConfigurationName)/TestCases
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Bin/DroidSans.ttf ${CMAKE_BINARY_DIR}/RecastDemo/$(ConfigurationName)/
|
||||
)
|
||||
elseif ( MINGW )
|
||||
elseif (MINGW)
|
||||
add_custom_command(TARGET RecastDemo
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${SDL2_RUNTIME_LIBRARY}" ${CMAKE_BINARY_DIR}/RecastDemo/
|
||||
@@ -66,15 +72,13 @@ else()
|
||||
file(COPY Bin/DroidSans.ttf DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
|
||||
add_dependencies(RecastDemo DebugUtils Detour DetourCrowd DetourTileCache Recast)
|
||||
if(APPLE)
|
||||
if (APPLE)
|
||||
target_link_libraries(RecastDemo ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} DebugUtils Detour DetourCrowd DetourTileCache Recast)
|
||||
else()
|
||||
target_link_libraries(RecastDemo ${OPENGL_LIBRARIES} SDL2::SDL2main DebugUtils Detour DetourCrowd DetourTileCache Recast)
|
||||
endif()
|
||||
|
||||
|
||||
install(TARGETS RecastDemo
|
||||
RUNTIME DESTINATION bin
|
||||
BUNDLE DESTINATION bin)
|
||||
|
||||
@@ -10,7 +10,11 @@ add_executable(Tests
|
||||
DetourCrowd/Tests_DetourPathCorridor.cpp
|
||||
)
|
||||
|
||||
set_property(TARGET Tests PROPERTY CXX_STANDARD 17)
|
||||
set_target_properties(Tests PROPERTIES
|
||||
CXX_STANDARD 20
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF # Disable compiler-specific extensions
|
||||
)
|
||||
|
||||
add_dependencies(Tests Recast Detour DetourCrowd)
|
||||
target_link_libraries(Tests Recast Detour DetourCrowd)
|
||||
|
||||
Reference in New Issue
Block a user