kxmlgui: fixed tests not building with Attica.

parent f548fc5f
......@@ -13,18 +13,21 @@ depends=('kglobalaccel' 'ktextwidgets' 'kf5-attica')
makedepends=('extra-cmake-modules')
groups=('kf5')
options=("debug")
source=("${KFServer}/${pkgver}/${pkgname}-${pkgver}.tar.xz")
source=("${KFServer}/${pkgver}/${pkgname}-${pkgver}.tar.xz"
"${pkgname}-${pkgver}-attica-tests.patch")
md5sums=('26388cf42f06e8be77d6d48cbaac9857')
prepare() {
mkdir -p build
cd ${srcdir}/${pkgname}-${pkgver}
patch -uNp1 -i ${srcdir}/${pkgname}-${pkgver}-attica-tests.patch
}
build() {
cd build
cmake ../${pkgname}-${pkgver} \
-DCMAKE_BUILD_TYPE=${KFBuildType} \
-DCMAKE_INSTALL_PREFIX=${KFInstallPrefix} \
-DCMAKE_BUILD_TYPE=${KFBuildType} \
-DLIB_INSTALL_DIR=lib \
-DSYSCONF_INSTALL_DIR=/etc
make
......@@ -40,3 +43,6 @@ package() {
cd build
make DESTDIR="${pkgdir}" install
}
md5sums=('08ec20c30633854d0ae2827c52648bbf')
md5sums=('08ec20c30633854d0ae2827c52648bbf'
'e813c4689ce74af330d40aa02682d2ff')
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4db9ac5..251236d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,7 +43,15 @@ set_package_properties(KF5Attica PROPERTIES DESCRIPTION "A Qt library that imple
URL "https://projects.kde.org/attica"
TYPE OPTIONAL
)
+
+# Extra libraries
set (HAVE_ATTICA ${KF5Attica_FOUND})
+if (HAVE_ATTICA)
+ set(XMLGUI_EXTRA_LIBS ${XMLGUI_EXTRA_LIBS} KF5::Attica)
+endif()
+if (WIN32)
+ set(XMLGUI_EXTRA_LIBS ${XMLGUI_EXTRA_LIBS} Segur32) # GetUserNameEx()
+endif()
# Subdirectories
add_subdirectory(src)
diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index 01725da..13b57fa 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -12,7 +12,7 @@ macro(XMLGUI_TESTS)
add_executable(${_testname} ${_testname}.cpp)
add_test(kxmlgui-${_testname} ${_testname})
ecm_mark_as_test(${_testname})
- target_link_libraries(${_testname} Qt5::Test KF5::I18n KF5::IconThemes KF5::XmlGui)
+ target_link_libraries(${_testname} Qt5::Test KF5::I18n KF5::IconThemes KF5::XmlGui ${XMLGUI_EXTRA_LIBS})
endforeach(_testname)
endmacro()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a0dd642..e12a22e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,12 +1,5 @@
add_subdirectory(ksendbugmail)
-if (HAVE_ATTICA)
- set (XMLGUI_EXTRA_LIBS ${XMLGUI_EXTRA_LIBS} KF5::Attica)
-endif ()
-if(WIN32)
- set (XMLGUI_EXTRA_LIBS ${XMLGUI_EXTRA_LIBS} Secur32) # GetUserNameEx()
-endif()
-
configure_file(config-xmlgui.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-xmlgui.h )
configure_file(
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 413fa92..c456ede 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -6,7 +6,7 @@ find_package(Qt5 5.2.0 CONFIG REQUIRED Test)
macro(xmlgui_executable_tests)
foreach(_testname ${ARGN})
add_executable(${_testname} ${_testname}.cpp)
- target_link_libraries(${_testname} Qt5::Test KF5::WidgetsAddons KF5::I18n KF5::XmlGui)
+ target_link_libraries(${_testname} Qt5::Test KF5::WidgetsAddons KF5::I18n KF5::XmlGui ${XMLGUI_EXTRA_LIBS})
ecm_mark_as_test(${_testname})
endforeach(_testname)
endmacro()
diff --git a/tests/krichtexteditor/CMakeLists.txt b/tests/krichtexteditor/CMakeLists.txt
index 45c1abe..b8d8b56 100644
--- a/tests/krichtexteditor/CMakeLists.txt
+++ b/tests/krichtexteditor/CMakeLists.txt
@@ -9,7 +9,7 @@ include_directories(
)
add_executable(krichtexteditor ${krichtexteditorSources} )
ecm_mark_as_test(krichtexteditor)
-target_link_libraries(krichtexteditor Qt5::Test KF5::ConfigWidgets KF5::TextWidgets KF5::XmlGui)
+target_link_libraries(krichtexteditor Qt5::Test KF5::ConfigWidgets KF5::TextWidgets KF5::XmlGui ${XMLGUI_EXTRA_LIBS})
#install(TARGETS krichtexteditor DESTINATION ${BIN_INSTALL_DIR})
#install(FILES krichtexteditorui.rc DESTINATION ${DATA_INSTALL_DIR}/krichtexteditor)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment