summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--cmake/FindLTDL.cmake30
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/plugins/test/CMakeLists.txt2
-rw-r--r--src/sound/plugins/oalsound/test/CMakeLists.txt2
5 files changed, 34 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 660c79f..022302a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,7 @@ find_package(SDL 1.2.10 REQUIRED)
find_package(SDL_image 1.2 REQUIRED)
find_package(SDL_ttf 2.0 REQUIRED)
find_package(PNG 1.2 REQUIRED)
+find_package(LTDL 2.4.2 REQUIRED)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
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)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f59abbc..f68a1d5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -173,7 +173,7 @@ ${PNG_LIBRARIES}
${OPTIONAL_LIBS}
${PLATFORM_LIBS}
${Boost_LIBRARIES}
-ltdl
+${LTDL_LIBRARY}
CBot
)
diff --git a/src/plugins/test/CMakeLists.txt b/src/plugins/test/CMakeLists.txt
index 5f86b6f..a68de2c 100644
--- a/src/plugins/test/CMakeLists.txt
+++ b/src/plugins/test/CMakeLists.txt
@@ -9,4 +9,4 @@ include_directories(".")
include_directories("../../")
include_directories("../../../")
-target_link_libraries(manager_test ltdl)
+target_link_libraries(manager_test ${LTDL_LIBRARY})
diff --git a/src/sound/plugins/oalsound/test/CMakeLists.txt b/src/sound/plugins/oalsound/test/CMakeLists.txt
index d10169b..f7b165c 100644
--- a/src/sound/plugins/oalsound/test/CMakeLists.txt
+++ b/src/sound/plugins/oalsound/test/CMakeLists.txt
@@ -8,4 +8,4 @@ add_executable(plugin_test plugin_test.cpp ../../../../common/iman.cpp ../../../
include_directories(".")
include_directories("../../../../")
-target_link_libraries(plugin_test ltdl)
+target_link_libraries(plugin_test ${LTDL_LIBRARY})