[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [digikam] core/tests/assistants: factoring assistant stand alone tools compilation rules
From:       Gilles Caulier <null () kde ! org>
Date:       2018-09-03 14:35:14
Message-ID: E1fwpwg-0006mM-Ro () code ! kde ! org
[Download RAW message or body]

Git commit 8cf3c504037809f44eb8382df283692b81ab0e23 by Gilles Caulier.
Committed on 03/09/2018 at 14:34.
Pushed by cgilles into branch 'master'.

factoring assistant stand alone tools compilation rules

M  +17   -98   core/tests/assistants/CMakeLists.txt

https://commits.kde.org/digikam/8cf3c504037809f44eb8382df283692b81ab0e23

diff --git a/core/tests/assistants/CMakeLists.txt b/core/tests/assistants/CMakeLists.txt
index e9ca5865b4..ed89d688bd 100644
--- a/core/tests/assistants/CMakeLists.txt
+++ b/core/tests/assistants/CMakeLists.txt
@@ -19,119 +19,38 @@ include_directories(
     $<TARGET_PROPERTY:KF5::I18n,INTERFACE_INCLUDE_DIRECTORIES>
 )
 
-# =======================================================
-# Stand alone version of ExpoBlending tool
-
-set(expoblending_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/expoblending.cpp)
-
-add_executable(expoblending ${expoblending_SRCS})
+macro(ASSISTANTS_BUILD_STANDALONE)
 
-target_link_libraries(expoblending
-                      digikamcore
-
-                      Qt5::Gui
-                      Qt5::Xml
-)
-
-# =======================================================
-# Stand alone version of Calendar tool
+    set(_filename ${ARGV0})
+    string(REPLACE "." ";" _temp ${_filename})
+    list(GET _temp 0 _target)
 
-set(calendar_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/calendar.cpp)
+    set(${_target}_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/${_filename})
 
-add_executable(calendar ${calendar_SRCS})
-
-target_link_libraries(calendar
-                      digikamcore
-
-                      Qt5::Gui
-                      Qt5::Xml
-)
-
-# =======================================================
-# Stand alone version of Panorama tool plus test code
-
-if(FLEX_FOUND AND BISON_FOUND AND KF5ThreadWeaver_FOUND)
-    set(panorama_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/panorama.cpp)
+    add_executable(${_target} ${${_target}_SRCS})
 
-    add_executable(panorama ${panorama_SRCS})
-
-    target_link_libraries(panorama
+    target_link_libraries(${_target}
                           digikamcore
-
                           Qt5::Gui
                           Qt5::Xml
     )
 
-    set(panoparser_test_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/panoparser_test.cpp)
+endmacro()
 
-    add_executable(panoparser_test ${panoparser_test_SRCS})
-
-    target_link_libraries(panoparser_test
-                          digikamcore
+ASSISTANTS_BUILD_STANDALONE(expoblending)
+ASSISTANTS_BUILD_STANDALONE(calendar)
+ASSISTANTS_BUILD_STANDALONE(sendbymail)
+ASSISTANTS_BUILD_STANDALONE(printcreator)
 
-                          Qt5::Gui
-                          Qt5::Xml
-    )
+if(FLEX_FOUND AND BISON_FOUND AND KF5ThreadWeaver_FOUND)
+    ASSISTANTS_BUILD_STANDALONE(panorama)
+    ASSISTANTS_BUILD_STANDALONE(panoparser_test)
 endif()
 
-# =======================================================
-# Stand alone version of SendByMail tool
-
-set(sendbymail_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/sendbymail.cpp)
-
-add_executable(sendbymail ${sendbymail_SRCS})
-
-target_link_libraries(sendbymail
-                      digikamcore
-
-                      Qt5::Gui
-                      Qt5::Xml
-)
-
-# =======================================================
-# Stand alone version of PrintCreator tool
-
-set(printcreator_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/printcreator.cpp)
-
-add_executable(printcreator ${printcreator_SRCS})
-
-target_link_libraries(printcreator
-                      digikamcore
-
-                      Qt5::Gui
-                      Qt5::Xml
-)
-
-# =======================================================
-# Stand alone version of VideoSlideshow tool
-
 if(ENABLE_MEDIAPLAYER)
-
-    set(videoslideshow_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/videoslideshow.cpp)
-
-    add_executable(videoslideshow ${videoslideshow_SRCS})
-
-    target_link_libraries(videoslideshow
-                          digikamcore
-
-                          Qt5::Gui
-                          Qt5::Xml
-    )
+    ASSISTANTS_BUILD_STANDALONE(videoslideshow)
 endif()
 
-# =======================================================
-# Stand alone version of HTML Gallery tool
-
 if(LibXml2_FOUND AND LibXslt_FOUND)
-
-    set(htmlgallery_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/htmlgallery.cpp)
-
-    add_executable(htmlgallery ${htmlgallery_SRCS})
-
-    target_link_libraries(htmlgallery
-                          digikamcore
-
-                          Qt5::Gui
-                          Qt5::Xml
-    )
+    ASSISTANTS_BUILD_STANDALONE(htmlgallery)
 endif()

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic