From 4e94dfc7e057776b0d1aafbeb72c8dad7918d988 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Mon, 11 Jun 2018 21:02:27 +0300 Subject: 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 --- tests/CMakeLists.txt | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 tests/CMakeLists.txt (limited to 'tests/CMakeLists.txt') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..370d124 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,66 @@ +enable_testing() + +add_executable(test_base64 test_base64.cpp) +target_include_directories(test_base64 PRIVATE include) +target_link_libraries(test_base64 Olm::Olm) +add_test(Base64 test_base64) + +add_executable(test_crypto test_crypto.cpp) +target_include_directories(test_crypto PRIVATE include) +target_link_libraries(test_crypto Olm::Olm) +add_test(Crypto test_crypto) + +add_executable(test_group_session test_group_session.cpp) +target_include_directories(test_group_session PRIVATE include) +target_link_libraries(test_group_session Olm::Olm) +add_test(GroupSession test_group_session) + +add_executable(test_list test_list.cpp) +target_include_directories(test_list PRIVATE include) +target_link_libraries(test_list Olm::Olm) +add_test(List test_list) + +add_executable(test_megolm test_megolm.cpp) +target_include_directories(test_megolm PRIVATE include) +target_link_libraries(test_megolm Olm::Olm) +add_test(Megolm test_megolm) + +add_executable(test_message test_message.cpp) +target_include_directories(test_message PRIVATE include) +target_link_libraries(test_message Olm::Olm) +add_test(Message test_message) + +add_executable(test_olm test_olm.cpp) +target_include_directories(test_olm PRIVATE include) +target_link_libraries(test_olm Olm::Olm) +add_test(Olm test_olm) + +add_executable(test_olm_decrypt test_olm_decrypt.cpp) +target_include_directories(test_olm_decrypt PRIVATE include) +target_link_libraries(test_olm_decrypt Olm::Olm) +add_test(OlmDecrypt test_olm_decrypt) + +add_executable(test_olm_sha256 test_olm_sha256.cpp) +target_include_directories(test_olm_sha256 PRIVATE include) +target_link_libraries(test_olm_sha256 Olm::Olm) +add_test(OlmSha256 test_olm_sha256) + +add_executable(test_olm_signature test_olm_signature.cpp) +target_include_directories(test_olm_signature PRIVATE include) +target_link_libraries(test_olm_signature Olm::Olm) +add_test(OlmSignature test_olm_signature) + +add_executable(test_olm_using_malloc test_olm_using_malloc.cpp) +target_include_directories(test_olm_using_malloc PRIVATE include) +target_link_libraries(test_olm_using_malloc Olm::Olm) +add_test(OlmUsingMalloc test_olm_using_malloc) + +add_executable(test_ratchet test_ratchet.cpp) +target_include_directories(test_ratchet PRIVATE include) +target_link_libraries(test_ratchet Olm::Olm) +add_test(Ratchet test_ratchet) + +add_executable(test_session test_session.cpp) +target_include_directories(test_session PRIVATE include) +target_link_libraries(test_session Olm::Olm) +add_test(Session test_session) -- cgit v1.2.3 From 3da5b6082373514e828d4a943de6305eb34d446b Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Fri, 12 Oct 2018 16:15:16 -0400 Subject: add pk files to cmake, avoid some duplication, and update documentation --- tests/CMakeLists.txt | 73 ++++++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 51 deletions(-) (limited to 'tests/CMakeLists.txt') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 370d124..12aaac4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,66 +1,37 @@ enable_testing() -add_executable(test_base64 test_base64.cpp) -target_include_directories(test_base64 PRIVATE include) -target_link_libraries(test_base64 Olm::Olm) -add_test(Base64 test_base64) +foreach(test IN ITEMS + test_base64 + test_crypto + test_group_session + test_list + test_megolm + test_message + test_olm + test_olm_decrypt + test_olm_sha256 + test_olm_signature + test_olm_using_malloc + test_ratchet + test_session + test_pk + ) +add_executable(${test} ${test}.cpp) +target_include_directories(${test} PRIVATE include) +target_link_libraries(${test} Olm::Olm) +endforeach(test) -add_executable(test_crypto test_crypto.cpp) -target_include_directories(test_crypto PRIVATE include) -target_link_libraries(test_crypto Olm::Olm) +add_test(Base64 test_base64) add_test(Crypto test_crypto) - -add_executable(test_group_session test_group_session.cpp) -target_include_directories(test_group_session PRIVATE include) -target_link_libraries(test_group_session Olm::Olm) add_test(GroupSession test_group_session) - -add_executable(test_list test_list.cpp) -target_include_directories(test_list PRIVATE include) -target_link_libraries(test_list Olm::Olm) add_test(List test_list) - -add_executable(test_megolm test_megolm.cpp) -target_include_directories(test_megolm PRIVATE include) -target_link_libraries(test_megolm Olm::Olm) add_test(Megolm test_megolm) - -add_executable(test_message test_message.cpp) -target_include_directories(test_message PRIVATE include) -target_link_libraries(test_message Olm::Olm) add_test(Message test_message) - -add_executable(test_olm test_olm.cpp) -target_include_directories(test_olm PRIVATE include) -target_link_libraries(test_olm Olm::Olm) add_test(Olm test_olm) - -add_executable(test_olm_decrypt test_olm_decrypt.cpp) -target_include_directories(test_olm_decrypt PRIVATE include) -target_link_libraries(test_olm_decrypt Olm::Olm) add_test(OlmDecrypt test_olm_decrypt) - -add_executable(test_olm_sha256 test_olm_sha256.cpp) -target_include_directories(test_olm_sha256 PRIVATE include) -target_link_libraries(test_olm_sha256 Olm::Olm) add_test(OlmSha256 test_olm_sha256) - -add_executable(test_olm_signature test_olm_signature.cpp) -target_include_directories(test_olm_signature PRIVATE include) -target_link_libraries(test_olm_signature Olm::Olm) add_test(OlmSignature test_olm_signature) - -add_executable(test_olm_using_malloc test_olm_using_malloc.cpp) -target_include_directories(test_olm_using_malloc PRIVATE include) -target_link_libraries(test_olm_using_malloc Olm::Olm) add_test(OlmUsingMalloc test_olm_using_malloc) - -add_executable(test_ratchet test_ratchet.cpp) -target_include_directories(test_ratchet PRIVATE include) -target_link_libraries(test_ratchet Olm::Olm) add_test(Ratchet test_ratchet) - -add_executable(test_session test_session.cpp) -target_include_directories(test_session PRIVATE include) -target_link_libraries(test_session Olm::Olm) add_test(Session test_session) +add_test(PublicKey test_session) -- cgit v1.2.3