Pack target_compile_definitions() and target_include_directories()
authorLuís Pereira <luis.artur.pereira@gmail.com>
Thu, 27 Oct 2016 17:57:42 +0000 (18:57 +0100)
committerLuís Pereira <luis.artur.pereira@gmail.com>
Thu, 27 Oct 2016 17:57:42 +0000 (18:57 +0100)
Terse and easier to read.

CMakeLists.txt

index 87696c8..048bfbc 100644 (file)
@@ -258,21 +258,19 @@ set_target_properties(${LXQT_LIBRARY_NAME} PROPERTIES
 )
 
 target_compile_definitions(${LXQT_LIBRARY_NAME}
-    PRIVATE "LXQT_RELATIVE_SHARE_DIR=\"${LXQT_RELATIVE_SHARE_DIR}\""
-    PRIVATE "LXQT_SHARE_DIR=\"${LXQT_SHARE_DIR}\""
-    PRIVATE "LXQT_RELATIVE_SHARE_TRANSLATIONS_DIR=\"${LXQT_RELATIVE_TRANSLATIONS_DIR}\""
-    PRIVATE "LXQT_SHARE_TRANSLATIONS_DIR=\"${LXQT_TRANSLATIONS_DIR}\""
-    PRIVATE "LXQT_GRAPHICS_DIR=\"${LXQT_GRAPHICS_DIR}\""
-    PRIVATE "LXQT_ETC_XDG_DIR=\"${LXQT_ETC_XDG_DIR}\""
-    PRIVATE "LXQT_DATA_DIR=\"${LXQT_DATA_DIR}\""
-    PRIVATE "LXQT_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\""
-    PRIVATE "LXQT_VERSION=\"${LXQT_VERSION}\""
-    PRIVATE "COMPILE_LIBLXQT"
-)
-
-target_compile_definitions(${LXQT_LIBRARY_NAME}
-    PRIVATE "$<$<CONFIG:Release>:QT_NO_DEBUG_OUTPUT>"
-    PRIVATE "$<$<CONFIG:Release>:QT_NO_WARNING_OUTPUT>"
+    PRIVATE
+        "LXQT_RELATIVE_SHARE_DIR=\"${LXQT_RELATIVE_SHARE_DIR}\""
+        "LXQT_SHARE_DIR=\"${LXQT_SHARE_DIR}\""
+        "LXQT_RELATIVE_SHARE_TRANSLATIONS_DIR=\"${LXQT_RELATIVE_TRANSLATIONS_DIR}\""
+        "LXQT_SHARE_TRANSLATIONS_DIR=\"${LXQT_TRANSLATIONS_DIR}\""
+        "LXQT_GRAPHICS_DIR=\"${LXQT_GRAPHICS_DIR}\""
+        "LXQT_ETC_XDG_DIR=\"${LXQT_ETC_XDG_DIR}\""
+        "LXQT_DATA_DIR=\"${LXQT_DATA_DIR}\""
+        "LXQT_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\""
+        "LXQT_VERSION=\"${LXQT_VERSION}\""
+        "COMPILE_LIBLXQT"
+        "$<$<CONFIG:Release>:QT_NO_DEBUG_OUTPUT>"
+        "$<$<CONFIG:Release>:QT_NO_WARNING_OUTPUT>"
 )
 
 if (WITH_XDG_DIRS_FALLBACK)
@@ -282,13 +280,11 @@ if (WITH_XDG_DIRS_FALLBACK)
 endif ()
 
 target_include_directories(${LXQT_LIBRARY_NAME}
-    INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${LXQT_LIBRARY_NAME}>"
-    INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${LXQT_LIBRARY_NAME}/LXQt>"
-)
-
-target_include_directories(${LXQT_LIBRARY_NAME}
-    INTERFACE "$<BUILD_INTERFACE:${LXQT_INTREE_INCLUDE_DIR}>"
-    INTERFACE "$<BUILD_INTERFACE:${LXQT_INTREE_INCLUDE_DIR}/LXQt>"
+    INTERFACE
+        "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${LXQT_LIBRARY_NAME}>"
+        "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${LXQT_LIBRARY_NAME}/LXQt>"
+        "$<BUILD_INTERFACE:${LXQT_INTREE_INCLUDE_DIR}>"
+        "$<BUILD_INTERFACE:${LXQT_INTREE_INCLUDE_DIR}/LXQt>"
 )
 
 install(TARGETS