From dc7ae44a907e6338e8bef28a2f35130ef6d09739 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 15 Jan 2021 15:15:52 +0100 Subject: Explicitly set ABI_VERSION / API_VERSION and use ABI_VERSION in the .so filename. --- CMakeLists.txt | 3 +++ src/CMakeLists.txt | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf34c7c..0a52550 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,9 @@ cmake_minimum_required (VERSION 2.8.9) set(PROJECT_VERSION "0.8.1") set(PACKAGE ${CMAKE_PROJECT_NAME}) +set(API_VERSION 0) +set(ABI_VERSION 0) + # Options option(DISABLE_TESTS "Disable tests" off) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5dce006..4a6a5aa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,6 +16,13 @@ set(PUBLIC_HEADERS utils.h ) +set_target_properties(ayatana-common + PROPERTIES + VERSION ${API_VERSION}.0.0 + SOVERSION ${ABI_VERSION} + PUBLIC_HEADER "${PUBLIC_HEADERS}" +) + configure_file(libayatana-common.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libayatana-common.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libayatana-common.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -- cgit v1.2.3 From 792fe77e31364210aac057fb7ed2b5d652a9940d Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 15 Jan 2021 15:06:55 +0100 Subject: tests/: Don't run Lomiri related unit test, if library hasn't been built against lomiri-uri-dispatcher. --- tests/CMakeLists.txt | 4 ++++ tests/tst_utils.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d4c068c..d805971 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,9 @@ find_package(GMock) +if(URLDISPATCHER_FOUND) + add_definitions( -DHAS_URLDISPATCHER ) +endif() + include_directories( ${CMAKE_SOURCE_DIR}/src ) diff --git a/tests/tst_utils.cpp b/tests/tst_utils.cpp index d7a4946..ac671f0 100644 --- a/tests/tst_utils.cpp +++ b/tests/tst_utils.cpp @@ -35,12 +35,14 @@ public: } }; +#ifdef HAS_URLDISPATCHER TEST_F(XdgCurrentDesktopUtilsTest, isLomiri) { EXPECT_FALSE(is_lomiri()); setenv("XDG_CURRENT_DESKTOP", "Lomiri", 1); EXPECT_TRUE(is_lomiri()); } +#endif TEST_F(XdgCurrentDesktopUtilsTest, isGnome) { -- cgit v1.2.3 From f4699d4a4cb5555753cb14bd0d77d0fbe0c82052 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 15 Jan 2021 15:12:02 +0100 Subject: tests/CMakeLists.txt: Add GMOCK_LIBRARIES to target_link_libraries(). --- tests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d805971..fb77924 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,5 +14,6 @@ target_link_libraries(tst_utils ${GTEST_LIBRARIES} ${GTEST_BOTH_LIBRARIES} + ${GMOCK_LIBRARIES} ) add_test(TstUtils tst_utils) -- cgit v1.2.3