summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Akulich <akulichalexander@gmail.com>2019-12-11 22:02:28 +0300
committerAlexander Akulich <akulichalexander@gmail.com>2020-01-18 22:37:09 +0300
commit379e06a91484f72bf37ff1fc5faa6d7a40bc0d28 (patch)
treea31243ff548240b9abe265c9f6f6cfad7bb51cb2
parentb4030784f02c4d94e193e241ba05b87ee4f94124 (diff)
CMake: Get rid of global include_directories()
-rw-r--r--CMakeLists.txt3
-rw-r--r--TelepathyQt/CMakeLists.txt14
-rw-r--r--tests/lib/glib/CMakeLists.txt1
3 files changed, 14 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 49ea8d39..ced71a7b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,9 +104,6 @@ endif ()
# The doxygen macro requires Qt to have been looked up to enable crosslinking
include(Doxygen)
-include_directories(${CMAKE_SOURCE_DIR}
- ${CMAKE_BINARY_DIR})
-
add_definitions(-DQT_NO_CAST_FROM_ASCII)
set(ENABLE_DEBUG_OUTPUT ON CACHE BOOL "If activated, compiles support for printing debug output to stderr")
diff --git a/TelepathyQt/CMakeLists.txt b/TelepathyQt/CMakeLists.txt
index d742d31e..d96d073f 100644
--- a/TelepathyQt/CMakeLists.txt
+++ b/TelepathyQt/CMakeLists.txt
@@ -755,6 +755,13 @@ target_compile_definitions(telepathy-qt${QT_VERSION_MAJOR} PRIVATE BUILDING_TP_Q
# Library used by tests to test some unexported functionality
add_library(telepathy-qt-test-backdoors STATIC ${telepathy_qt_test_backdoors_SRCS})
+target_include_directories(telepathy-qt-test-backdoors PUBLIC
+ $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}/telepathy-qt${QT_VERSION_MAJOR}/>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
+)
+
add_dependencies(telepathy-qt-test-backdoors stable-constants)
add_dependencies(telepathy-qt-test-backdoors stable-typesgen)
@@ -783,7 +790,12 @@ target_link_libraries(telepathy-qt${QT_VERSION_MAJOR} PRIVATE
target_link_libraries(telepathy-qt${QT_VERSION_MAJOR} PUBLIC
${TP_QT_LIBRARY_LINKER_FLAGS})
-target_include_directories(telepathy-qt${QT_VERSION_MAJOR} PUBLIC "$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}/telepathy-qt${QT_VERSION_MAJOR}/>")
+target_include_directories(telepathy-qt${QT_VERSION_MAJOR} PUBLIC
+ $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}/telepathy-qt${QT_VERSION_MAJOR}/>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
+)
# Link - Library used by tests to test some unexported functionality
target_link_libraries(telepathy-qt-test-backdoors PUBLIC
diff --git a/tests/lib/glib/CMakeLists.txt b/tests/lib/glib/CMakeLists.txt
index 73ff4000..96cb7b6a 100644
--- a/tests/lib/glib/CMakeLists.txt
+++ b/tests/lib/glib/CMakeLists.txt
@@ -1,5 +1,6 @@
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}
${TELEPATHY_GLIB_INCLUDE_DIR}
${GLIB2_INCLUDE_DIR}
${GOBJECT_INCLUDE_DIR}