telepathy-qt: CMake: Refactor internal/private build definitions

Alexandr Akulich kaffeine at kemper.freedesktop.org
Mon Nov 11 17:28:14 UTC 2019


Module: telepathy-qt
Branch: master
Commit: 148f88dcf49577b9518ee7c8ad6c65c2c10e7ea8
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=148f88dcf49577b9518ee7c8ad6c65c2c10e7ea8

Author: Alexander Akulich <akulichalexander at gmail.com>
Date:   Thu Nov  7 02:24:56 2019 +0300

CMake: Refactor internal/private build definitions

---

 TelepathyQt/CMakeLists.txt           |  6 +++---
 TelepathyQt/Farstream/CMakeLists.txt | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/TelepathyQt/CMakeLists.txt b/TelepathyQt/CMakeLists.txt
index 626d9531..f79d3d6c 100644
--- a/TelepathyQt/CMakeLists.txt
+++ b/TelepathyQt/CMakeLists.txt
@@ -4,9 +4,6 @@ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/_gen")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VISIBILITY_HIDDEN_FLAGS} ${COMPILER_COVERAGE_FLAGS} ${DEPRECATED_DECLARATIONS_FLAGS}")
 set(LD_FLAGS "${LD_FLAGS} ${VISIBILITY_HIDDEN_FLAGS} ${COMPILER_COVERAGE_FLAGS} ${DEPRECATED_DECLARATIONS_FLAGS}")
 
-# We are building Telepathy-Qt
-add_definitions(-DBUILDING_TP_QT)
-
 configure_file(global.h.in ${CMAKE_CURRENT_BINARY_DIR}/global.h)
 
 # Sources for Tp-Qt
@@ -752,6 +749,9 @@ else ()
     add_library(telepathy-qt${QT_VERSION_MAJOR} SHARED ${telepathy_qt_SRCS})
 endif ()
 
+# We are building Telepathy-Qt
+target_compile_definitions(telepathy-qt${QT_VERSION_MAJOR} PRIVATE BUILDING_TP_QT)
+
 # Library used by tests to test some unexported functionality
 add_library(telepathy-qt-test-backdoors STATIC ${telepathy_qt_test_backdoors_SRCS})
 add_dependencies(telepathy-qt-test-backdoors stable-constants)
diff --git a/TelepathyQt/Farstream/CMakeLists.txt b/TelepathyQt/Farstream/CMakeLists.txt
index 6ddc9c6a..fe542967 100644
--- a/TelepathyQt/Farstream/CMakeLists.txt
+++ b/TelepathyQt/Farstream/CMakeLists.txt
@@ -7,11 +7,6 @@ if(FARSTREAM_COMPONENTS_FOUND)
                         ${LIBXML2_INCLUDE_DIR}
                         ${DBUS_INCLUDE_DIR})
 
-    # It gets inherited from the previous directory, hence it has to be removed explicitely
-    remove_definitions(-DBUILDING_TP_QT)
-    # We are building Telepathy-Qt-Farstream
-    add_definitions(-DBUILDING_TP_QT_FARSTREAM -DQT_NO_KEYWORDS)
-
     set(telepathy_qt_farstream_SRCS
         channel.cpp)
 
@@ -37,6 +32,11 @@ if(FARSTREAM_COMPONENTS_FOUND)
                     ${telepathy_qt_farstream_SRCS} ${telepathy_qt_farstream_MOC_SRCS})
     endif ()
 
+    # We are building Telepathy-Qt-Farstream
+    target_compile_definitions(telepathy-qt${QT_VERSION_MAJOR}-farstream PRIVATE
+        BUILDING_TP_QT_FARSTREAM
+        QT_NO_KEYWORDS)
+
     # Link
     target_link_libraries(telepathy-qt${QT_VERSION_MAJOR}-farstream
         ${QT_QTDBUS_LIBRARY}



More information about the telepathy-commits mailing list