aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-11 21:02:27 +0300
committerHubert Chathi <hubert@uhoreg.ca>2018-10-12 16:22:03 -0400
commit4e94dfc7e057776b0d1aafbeb72c8dad7918d988 (patch)
treef78cea96a63f146b161c6feb6e96d3a047498354 /cmake
parentaf86a9a8b899eeb3c1c464cb0c54218acd788fa6 (diff)
Add CMake support
The library can now be installed using CMake v3.0+. Below is an example configuration. 1. Generate configuation cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release // The default profile. -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_SHARED_LIBS=ON -DOLM_TESTS=1 -DOLM_FUZZERS=1 2. Build & install the targets cmake --build build --config Release --target install 3. Run the tests cd build/test && ctest . The library can also be used as a dependency with CMake using find_package(Olm::Olm REQUIRED) target_link_libraries(my_exe Olm::Olm) Signed-off-by: Konstantinos Sideris <sideris.konstantin@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/OlmConfig.cmake.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/OlmConfig.cmake.in b/cmake/OlmConfig.cmake.in
new file mode 100644
index 0000000..a7541f7
--- /dev/null
+++ b/cmake/OlmConfig.cmake.in
@@ -0,0 +1,11 @@
+get_filename_component(Olm_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+include(CMakeFindDependencyMacro)
+
+list(APPEND CMAKE_MODULE_PATH ${Olm_CMAKE_DIR})
+list(REMOVE_AT CMAKE_MODULE_PATH -1)
+
+if(NOT TARGET Olm::olm)
+ include("${Olm_CMAKE_DIR}/OlmTargets.cmake")
+endif()
+
+set(Olm_LIBRARIES Olm::olm)