summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2012-12-14 15:47:46 +0100
committerDidier Raboud <odyx@debian.org>2012-12-14 15:50:11 +0100
commit9b127fc0a349972b1312866766f288534b1d47e4 (patch)
tree929452326750f0fed23c635606711631310edaa6 /cmake
parent2173e86025f03cc19af833f99c786391bd32718e (diff)
downloadcolobot-9b127fc0a349972b1312866766f288534b1d47e4.tar.gz
colobot-9b127fc0a349972b1312866766f288534b1d47e4.tar.bz2
colobot-9b127fc0a349972b1312866766f288534b1d47e4.zip
Add FindLTDL cmake module
As mentionned in FindLTDL.cmake, this is code that is hereby relicensed under GPLv3. closes #68
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindLTDL.cmake30
1 files changed, 30 insertions, 0 deletions
diff --git a/cmake/FindLTDL.cmake b/cmake/FindLTDL.cmake
new file mode 100644
index 0000000..051e70c
--- /dev/null
+++ b/cmake/FindLTDL.cmake
@@ -0,0 +1,30 @@
+# Find the native LTDL includes and library
+# Copied verbatim from
+# http://code.metager.de/source/xref/hshannover/trust/tnc-fhh/shared/cmake_modules/FindLTDL.cmake
+# The above version was under GPL-2, this one is under GPL-3, for consistency
+# with the rest of the colobot project.
+#
+# This module defines
+# LTDL_INCLUDE_DIR, where to find ltdl.h, etc.
+# LTDL_LIBRARY, where to find the LTDL library.
+# LTDL_FOUND, If false, do not try to use LTDL.
+
+FIND_PATH(LTDL_INCLUDE_DIR ltdl.h)
+
+FIND_LIBRARY(LTDL_LIBRARY ltdl)
+
+IF (LTDL_INCLUDE_DIR AND LTDL_LIBRARY)
+ SET(LTDL_FOUND TRUE)
+ELSE(LTDL_INCLUDE_DIR AND LTDL_LIBRARY)
+ SET(LTDL_FOUND FALSE)
+ENDIF (LTDL_INCLUDE_DIR AND LTDL_LIBRARY)
+
+IF (LTDL_FOUND)
+ IF (NOT LTDL_FIND_QUIETLY)
+ MESSAGE(STATUS "Found LTDL: ${LTDL_LIBRARY}")
+ ENDIF (NOT LTDL_FIND_QUIETLY)
+ELSE (LTDL_FOUND)
+ IF (LTDL_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find LTDL")
+ ENDIF (LTDL_FIND_REQUIRED)
+ENDIF (LTDL_FOUND)