aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2024-05-13 13:20:11 -0500
committerMatt Strapp <matt@mattstrapp.net>2024-05-13 13:20:11 -0500
commit3e83931fd2e47bc09fb4e9bebfcdf9246c7219f8 (patch)
tree2fcba34d8b4d083484c5d12e71222e7fb4b1d368
parentAdd CMake (diff)
downloadlocusts-3e83931fd2e47bc09fb4e9bebfcdf9246c7219f8.tar
locusts-3e83931fd2e47bc09fb4e9bebfcdf9246c7219f8.tar.gz
locusts-3e83931fd2e47bc09fb4e9bebfcdf9246c7219f8.tar.bz2
locusts-3e83931fd2e47bc09fb4e9bebfcdf9246c7219f8.tar.lz
locusts-3e83931fd2e47bc09fb4e9bebfcdf9246c7219f8.tar.xz
locusts-3e83931fd2e47bc09fb4e9bebfcdf9246c7219f8.tar.zst
locusts-3e83931fd2e47bc09fb4e9bebfcdf9246c7219f8.zip
Add versioning to CMake and Meson
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
-rw-r--r--CMakeLists.txt2
-rw-r--r--meson.build2
2 files changed, 3 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4740aec..8f770a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,11 +10,13 @@ set_target_properties(objlib PROPERTIES LINKER_LANGUAGE C)
add_library(ocusts SHARED $<TARGET_OBJECTS:objlib> include/locusts.h)
target_link_libraries(ocusts PUBLIC objlib)
set_target_properties(ocusts PROPERTIES LINKER_LANGUAGE C)
+set_target_properties(ocusts PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
add_library(ocusts_static STATIC $<TARGET_OBJECTS:objlib> include/locusts.h)
target_link_libraries(ocusts_static PUBLIC objlib)
set_target_properties(ocusts_static PROPERTIES LINKER_LANGUAGE C)
+# Make autoconf and cmake agree with each other
set(prefix ${CMAKE_INSTALL_PREFIX})
set(libdir $\${prefix}/${CMAKE_INSTALL_LIBDIR})
set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
diff --git a/meson.build b/meson.build
index 174a582..7afb496 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project('locusts', 'c', version: '1.0.0', default_options: ['warning_level=3'])
source = 'include/locusts.h'
-lib = library('ocusts', source, install: true)
+lib = library('ocusts', source, install: true, version: meson.project_version(), soversion: '1')
project_dep =declare_dependency(include_directories: include_directories('include'))