Add version and pkgconfig (#474)
* Add version and pkgconfig * simply versioning Co-authored-by: Bret Curtis <bret.curtis@pegus.digital>
This commit is contained in:
parent
1f25f9cc29
commit
63a4ee4c1e
@ -4,7 +4,8 @@ project(RecastNavigation)
|
||||
|
||||
# lib versions
|
||||
SET(SOVERSION 1)
|
||||
SET(VERSION 1.0.0)
|
||||
set(LIB_VERSION 1.5.1)
|
||||
string(REPLACE "." "," LIB_VERSION_NUM "${LIB_VERSION}.0")
|
||||
|
||||
option(RECASTNAVIGATION_DEMO "Build demo" ON)
|
||||
option(RECASTNAVIGATION_TESTS "Build tests" ON)
|
||||
@ -16,6 +17,26 @@ endif()
|
||||
|
||||
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)
|
||||
|
@ -18,7 +18,7 @@ target_link_libraries(DebugUtils
|
||||
|
||||
set_target_properties(DebugUtils PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${VERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "DebugUtils-d"
|
||||
)
|
||||
|
@ -12,7 +12,7 @@ target_include_directories(Detour PUBLIC
|
||||
|
||||
set_target_properties(Detour PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${VERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "Detour-d"
|
||||
)
|
||||
|
@ -16,7 +16,7 @@ target_link_libraries(DetourCrowd
|
||||
|
||||
set_target_properties(DetourCrowd PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${VERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "DetourCrowd-d"
|
||||
)
|
||||
|
@ -16,7 +16,7 @@ target_link_libraries(DetourTileCache
|
||||
|
||||
set_target_properties(DetourTileCache PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${VERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "DetourTileCache-d"
|
||||
)
|
||||
|
@ -12,7 +12,7 @@ target_include_directories(Recast PUBLIC
|
||||
|
||||
set_target_properties(Recast PROPERTIES
|
||||
SOVERSION ${SOVERSION}
|
||||
VERSION ${VERSION}
|
||||
VERSION ${LIB_VERSION}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY .
|
||||
COMPILE_PDB_NAME "Recast-d"
|
||||
)
|
||||
|
10
recastnavigation.pc.in
Normal file
10
recastnavigation.pc.in
Normal file
@ -0,0 +1,10 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: RecastNavigation
|
||||
Description: RecastNavigation is a cross-platform navigation mesh construction toolset for games
|
||||
Version: @PACKAGE_VERSION@
|
||||
Libs: -L${libdir} -lRecast -lDetour -lDebugUtils -lDetourCrowd -lDetourTileCache
|
||||
Cflags: -I${includedir} -I${includedir}/recastnavigation @PKG_CONFIG_CFLAGS@
|
3
version.h.in
Normal file
3
version.h.in
Normal file
@ -0,0 +1,3 @@
|
||||
/* Define to the library version */
|
||||
#define RECASTNAV_VERSION "${LIB_VERSION}"
|
||||
#define RECASTNAV_VERSION_NUM ${LIB_VERSION_NUM}
|
Loading…
x
Reference in New Issue
Block a user