From 5f84bf718b0efefe691b1184b7080a64b31a19b5 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 30 Nov 2012 12:59:08 +0100 Subject: [PATCH] Add library search directories to linker options Some older packages, and notably those that are detected by PkgConfig, only give library names and then a list of library search directories. Add to link_directories here in order to support this configuration, even though it is deprecated in newer versions of CMake. --- CMakeLists.txt | 1 + cmake/Modules/UseOpmFind.cmake | 1 + 2 files changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bceec6c8..b24988f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,6 +99,7 @@ remove_duplicate_libraries (opm-core) # create this library include_directories (${opm-core_INCLUDE_DIRS}) +link_directories (${opm-core_LIBRARY_DIRS}) add_definitions (${opm-core_DEFINITIONS}) add_library (opmcore SHARED ${opm-core_SOURCES}) set_target_properties (opmcore PROPERTIES diff --git a/cmake/Modules/UseOpmFind.cmake b/cmake/Modules/UseOpmFind.cmake index b1365789..e11a853c 100644 --- a/cmake/Modules/UseOpmFind.cmake +++ b/cmake/Modules/UseOpmFind.cmake @@ -29,6 +29,7 @@ set (_opm_proj_vars LIBRARIES DEFINITIONS INCLUDE_DIRS + LIBRARY_DIRS CONFIG_VARS )