[rkward/frameworks] /: Fix gettext library linkage on Windows

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Mon Feb 22 08:23:37 UTC 2016


Git commit 81a9f730d5846da6a5c2df8c52a22c5e37bb27fc by Thomas Friedrichsmeier.
Committed on 22/02/2016 at 08:23.
Pushed by tfry into branch 'frameworks'.

Fix gettext library linkage on Windows

M  +10   -1    CMakeLists.txt
M  +1    -1    rkward/CMakeLists.txt
M  +1    -1    rkward/rbackend/CMakeLists.txt

http://commits.kde.org/rkward/81a9f730d5846da6a5c2df8c52a22c5e37bb27fc

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 22f6464..0bb2489 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@ IF(NOT CMAKE_VERBOSE_MAKEFILE)
 ENDIF(NOT CMAKE_VERBOSE_MAKEFILE)
 
 FIND_PACKAGE(ECM 0.0.11 REQUIRED NO_MODULE)
-FIND_PACKAGE(Gettext REQUIRED)
+
 SET(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
 
 INCLUDE(KDEInstallDirs)
@@ -18,6 +18,15 @@ INCLUDE(FeatureSummary)
 
 FIND_PACKAGE(Qt5 5.2 CONFIG REQUIRED COMPONENTS Widgets Core Xml Network WebKit Script PrintSupport)
 FIND_PACKAGE(KF5 5.2 REQUIRED COMPONENTS CoreAddons DocTools I18n XmlGui TextEditor WidgetsAddons WebKit Parts Config Notifications WindowSystem)
+FIND_PACKAGE(Gettext REQUIRED)
+if("${CMAKE_VERSION}" VERSION_GREATER 3.2.3)
+	FIND_PACKAGE(Intl REQUIRED)
+ELSE()
+# Note: this may or may not work (it does not on Windows), but is worth a try:
+	IF(NOT ${Intl_LIBRARIES})
+		SET(Intl_LIBRARIES ${GETTEXT_LIBRARIES})
+	ENDIF(NOT ${Intl_LIBRARIES})
+ENDIF()
 
 IF(FORCE_PRETTY_MAKEFILE)
 	SET(CMAKE_VERBOSE_MAKEFILE OFF)
diff --git a/rkward/CMakeLists.txt b/rkward/CMakeLists.txt
index a777268..ce41c8c 100644
--- a/rkward/CMakeLists.txt
+++ b/rkward/CMakeLists.txt
@@ -53,7 +53,7 @@ IF(Q_WS_MAC)
 		@ONLY)
 ENDIF(Q_WS_MAC)
 
-TARGET_LINK_LIBRARIES(rkward.frontend  windows ${RKWARD_ADDLIBS} agents dialogs plugin settings dataeditor core scriptbackends rbackend misc KF5::WindowSystem Qt5::Widgets KF5::XmlGui ${GETTEXT_LIBRARIES})
+TARGET_LINK_LIBRARIES(rkward.frontend  windows ${RKWARD_ADDLIBS} agents dialogs plugin settings dataeditor core scriptbackends rbackend misc KF5::WindowSystem Qt5::Widgets KF5::XmlGui ${Intl_LIBRARIES})
 
 # wrapper executable
 GET_DIRECTORY_PROPERTY(R_EXECUTABLE DIRECTORY rbackend DEFINITION R_EXECUTABLE)
diff --git a/rkward/rbackend/CMakeLists.txt b/rkward/rbackend/CMakeLists.txt
index 56b5b34..c6b6937 100644
--- a/rkward/rbackend/CMakeLists.txt
+++ b/rkward/rbackend/CMakeLists.txt
@@ -56,7 +56,7 @@ SET (
 ADD_DEFINITIONS (-DRKWARD_SPLIT_PROCESS)
 LINK_DIRECTORIES(${R_SHAREDLIBDIR})
 ADD_EXECUTABLE(rkward.rbackend ${rbackend_BACKEND_SRCS})
-TARGET_LINK_LIBRARIES(rkward.rbackend rkgraphicsdevice.backend ${R_USED_LIBS} ${CMAKE_THREAD_LIBS_INIT} Qt5::Network Qt5::Core ${GETTEXT_LIBRARIES} )
+TARGET_LINK_LIBRARIES(rkward.rbackend rkgraphicsdevice.backend ${R_USED_LIBS} ${CMAKE_THREAD_LIBS_INIT} Qt5::Network Qt5::Core ${Intl_LIBRARIES} )
 
 IF(WIN32)
 	# on Widows, we install to the rbackend subdirectory, because 1) LIBEXEC_INSTALL_DIR == BIN_INSTALL_DIR and 2) we don't want the backend to pick up



More information about the rkward-tracker mailing list