summaryrefslogtreecommitdiff
path: root/cmake/FindPMEM.cmake
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-03-20 16:23:47 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-03-20 16:23:47 +0200
commite8113f7572ef7eab45b7b696429101690caeeed4 (patch)
tree8a49dbb8a5ad672cd5e002726a6a79a1cf799ad7 /cmake/FindPMEM.cmake
parent4eeea4e212755408ca963d22faa11c12963c1d0a (diff)
downloadmariadb-git-e8113f7572ef7eab45b7b696429101690caeeed4.tar.gz
CMake cleanup: Make WITH_URING, WITH_PMEM Boolean
The new default values WITH_URING:BOOL=OFF, WITH_PMEM:BOOL=OFF imply that the dependencies are optional. An explicit request WITH_URING=ON or WITH_PMEM=ON will cause the build to fail if the requested dependencies are not available. Last, to prevent a feature to be built in even though the built-time dependencies are available, the following can be used: cmake -DCMAKE_DISABLE_FIND_PACKAGE_URING=1 cmake -DCMAKE_DISABLE_FIND_PACKAGE_PMEM=1 This cleanup was suggested by Vladislav Vaintroub.
Diffstat (limited to 'cmake/FindPMEM.cmake')
-rw-r--r--cmake/FindPMEM.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/FindPMEM.cmake b/cmake/FindPMEM.cmake
new file mode 100644
index 00000000000..d5f0c24364a
--- /dev/null
+++ b/cmake/FindPMEM.cmake
@@ -0,0 +1,9 @@
+find_path(LIBPMEM_INCLUDE_DIR NAMES libpmem.h)
+find_library(LIBPMEM_LIBRARIES NAMES pmem)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(
+ PMEM DEFAULT_MSG
+ LIBPMEM_LIBRARIES LIBPMEM_INCLUDE_DIR)
+
+mark_as_advanced(LIBPMEM_INCLUDE_DIR LIBPMEM_LIBRARIES)