|
17 | 17 | # refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and |
18 | 18 | # to the root binary directory of the project as ${HELLO_BINARY_DIR}. |
19 | 19 |
|
20 | | -cmake_minimum_required (VERSION 3.10) |
| 20 | +cmake_minimum_required (VERSION 3.19) |
21 | 21 |
|
22 | 22 | ## TODO: get version from variable |
23 | 23 | project (CacheLib VERSION 0.1) |
24 | 24 |
|
25 | 25 | #configure_file(cachelib/cachelib_config.h.in cachelib_config.h) |
26 | 26 |
|
27 | | -set(CACHELIB_MAJOR_VERSION 0) |
| 27 | +if (NOT DEFINED CACHELIB_MAJOR_VERSION) |
| 28 | + set(CACHELIB_MAJOR_VERSION 0) |
| 29 | +endif () |
28 | 30 | set(CACHELIB_MINOR_VERSION 1) |
29 | 31 | set(CACHELIB_PATCH_VERSION 0) |
30 | 32 | set(CACHELIB_VERSION |
31 | 33 | ${CACHELIB_MAJOR_VERSION}.${CACHELIB_MINOR_VERSION}.${CACHELIB_PATCH_VERSION}) |
32 | 34 |
|
33 | 35 | set(PACKAGE_NAME "cachelib") |
34 | | -set(PACKAGE_VERSION "${CACHELIB_VERSION}") |
| 36 | +if (NOT DEFINED PACKAGE_VERSION) |
| 37 | + set(PACKAGE_VERSION "${CACHELIB_VERSION}") |
| 38 | +endif () |
35 | 39 | set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") |
36 | 40 | set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") |
37 | 41 | set(PACKAGE_BUGREPORT "https://github.com/facebook/TBD") |
@@ -314,7 +318,7 @@ install( |
314 | 318 | PATTERN "CMakeFiles" EXCLUDE |
315 | 319 | ) |
316 | 320 |
|
317 | | - |
| 321 | +include(sanitizers) |
318 | 322 | # Install CMake package configuration files for cachelib |
319 | 323 | # TODO: @ONLY? |
320 | 324 | include(CMakePackageConfigHelpers) |
@@ -361,6 +365,20 @@ install(EXPORT cachelib-exports |
361 | 365 | #NAMESPACE cachelib:: |
362 | 366 | DESTINATION ${CMAKE_INSTALL_DIR}) |
363 | 367 |
|
| 368 | +if (BUILD_SHARED_LIBS) |
| 369 | + set_target_properties( |
| 370 | + cachelib_allocator |
| 371 | + cachelib_cachebench |
| 372 | + cachelib_common |
| 373 | + cachelib_datatype |
| 374 | + cachelib_navy |
| 375 | + cachelib_shm |
| 376 | + PROPERTIES |
| 377 | + SOVERSION ${CACHELIB_MAJOR_VERSION} |
| 378 | + VERSION ${PACKAGE_VERSION} |
| 379 | + ) |
| 380 | +endif () |
| 381 | + |
364 | 382 | if (BUILD_TESTS) |
365 | 383 | get_property(TEST_BINARIES GLOBAL PROPERTY TEST_BINARIES) |
366 | 384 | #message(STATUS "=== Test binaries : ${TEST_BINARIES} ===") |
|
0 commit comments