summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Wachter <bwachter-tmw@lart.info>2010-01-23 14:56:36 +0100
committerJared Adams <jaxad0127@gmail.com>2010-01-23 16:53:34 -0700
commitb00649b50159f963fd535477987398becbdc3a35 (patch)
tree764e2071b356c2d8f9a1e8c65524654265ee3f92
parentfc3c62f2d68851b89b345a7aa7852d4a22f848dc (diff)
downloadMana-b00649b50159f963fd535477987398becbdc3a35.tar.gz
Mana-b00649b50159f963fd535477987398becbdc3a35.tar.bz2
Mana-b00649b50159f963fd535477987398becbdc3a35.tar.xz
Mana-b00649b50159f963fd535477987398becbdc3a35.zip
Link explicitely to libintl on Win32 builds
-rw-r--r--CMake/Modules/FindLibIntl.cmake46
-rw-r--r--src/CMakeLists.txt2
2 files changed, 48 insertions, 0 deletions
diff --git a/CMake/Modules/FindLibIntl.cmake b/CMake/Modules/FindLibIntl.cmake
new file mode 100644
index 00000000..e7596052
--- /dev/null
+++ b/CMake/Modules/FindLibIntl.cmake
@@ -0,0 +1,46 @@
+# Try to find the libintl library. Explicit searching is currently
+# only required for Win32, though it might be useful for some UNIX
+# variants, too. Therefore code for searching common UNIX include
+# directories is included, too.
+#
+# Once done this will define
+#
+# LIBINTL_FOUND - system has libintl
+# LIBINTL_LIBRARIES - the library needed for linking
+
+IF (LibIntl_LIBRARY)
+ SET(LibIntl_FIND_QUIETLY TRUE)
+ENDIF ()
+
+# for Windows we rely on the environement variables
+# %INCLUDE% and %LIB%; FIND_LIBRARY checks %LIB%
+# automatically on Windows
+IF(WIN32)
+ FIND_LIBRARY(LibIntl_LIBRARY
+ NAMES intl
+ )
+ELSE()
+ FIND_LIBRARY(LibIntl_LIBRARY
+ NAMES intl
+ PATHS /usr/lib /usr/local/lib
+ )
+ENDIF()
+
+IF (LibIntl_LIBRARY)
+ SET(LIBINTL_FOUND TRUE)
+ SET(LIBINTL_LIBRARIES ${LibIntl_LIBRARY})
+ELSE ()
+ SET(LIBINTL_FOUND FALSE)
+ENDIF ()
+
+IF (LIBINTL_FOUND)
+ IF (NOT LibIntl_FIND_QUIETLY)
+ MESSAGE(STATUS "Found libintl: ${LibIntl_LIBRARY}")
+ ENDIF ()
+ELSE ()
+ IF (LibIntl_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could NOT find libintl")
+ ENDIF ()
+ENDIF ()
+
+MARK_AS_ADVANCED(LibIntl_LIBRARY)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c06f7d92..beaef3e4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -16,6 +16,7 @@ SET(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${LOCALEDIR}/\\\"")
IF (WIN32)
SET(EXTRA_LIBRARIES ws2_32 winmm)
+ FIND_PACKAGE(LibIntl REQUIRED)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL SunOS)
# explicit linking to libintl is required on Solaris
SET(EXTRA_LIBRARIES intl)
@@ -563,6 +564,7 @@ FOREACH(program ${PROGRAMS})
${LIBXML2_LIBRARIES}
${GUICHAN_LIBRARIES}
${OPENGL_LIBRARIES}
+ ${LIBINTL_LIBRARIES}
${EXTRA_LIBRARIES})
INSTALL(TARGETS ${program} RUNTIME DESTINATION ${PKG_BINDIR})
ENDFOREACH(program)