From 73146d4eb2334bd95f98d27dcd7fa3d7cea4adc3 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Tue, 24 Nov 2009 13:18:49 +0100 Subject: [PATCH] Fix building with the GNU Gold linker MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Thanks to Thomas Müller (DeepDiver) for providing the patch. Fixes #863. --- src/common/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index f36d00e8..9d0af6ee 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -72,6 +72,16 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) # for vers set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES version.gen) add_library(mod_common STATIC ${SOURCES} ${MOC}) + if(APPLE) target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation") -endif(APPLE) \ No newline at end of file +endif(APPLE) + +if(CMAKE_HOST_UNIX) + find_library(libdl dl) + if (libdl-NOTFOUND) + message(FATAL_ERROR "Cannot find required library: libdl") + endif (libdl-NOTFOUND) + + target_link_libraries(mod_common ${libdl}) +endif(CMAKE_HOST_UNIX) -- 2.20.1