From 0e7d36703ee686dd38a2a5943a6f5872d7bca297 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 23 Aug 2010 11:33:47 +0200 Subject: [PATCH] Use _LDFLAGS instead of _LIBRARIES If a library is in a non-standard path, the linker needs an extra argument so that it knows how to find this library: -L/path/to/lib pkg_check_modules() sets _LIBRARIES only to the library's name, but _LDFLAGS also contains a -L flag if one was found. Signed-off-by: Uli Schlachter --- CMakeLists.txt | 6 +++--- awesomeConfig.cmake | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cf74b6e..a2f5b0f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,9 +99,9 @@ set_target_properties(${PROJECT_AWE_NAME} LINK_FLAGS -export-dynamic) target_link_libraries(${PROJECT_AWE_NAME} - ${AWESOME_COMMON_REQUIRED_LIBRARIES} - ${AWESOME_REQUIRED_LIBRARIES} - ${AWESOME_OPTIONAL_LIBRARIES}) + ${AWESOME_COMMON_REQUIRED_LDFLAGS} + ${AWESOME_REQUIRED_LDFLAGS} + ${AWESOME_OPTIONAL_LDFLAGS}) # atoms file(MAKE_DIRECTORY ${BUILD_DIR}/common) diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index a90bbc61..baa68322 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -124,7 +124,7 @@ execute_process( # {{{ Required libraries # # this sets up: -# AWESOME_REQUIRED_LIBRARIES +# AWESOME_REQUIRED_LDFLAGS # AWESOME_REQUIRED_INCLUDE_DIRS # Use pkgconfig to get most of the libraries @@ -173,8 +173,8 @@ if(NOT HAS_EXECINFO) find_library(LIB_EXECINFO execinfo) if(LIB_EXECINFO) set(HAS_EXECINFO 1) - set(AWESOME_REQUIRED_LIBRARIES - ${AWESOME_REQUIRED_LIBRARIES} + set(AWESOME_REQUIRED_LDFLAGS + ${AWESOME_REQUIRED_LDFLAGS} ${LIB_EXECINFO}) endif() endif() @@ -199,9 +199,9 @@ if(NOT LUA51_FOUND AND NOT LUA50_FOUND) # This is a workaround to a cmake bug message(FATAL_ERROR "lua library not found") endif() -set(AWESOME_REQUIRED_LIBRARIES +set(AWESOME_REQUIRED_LDFLAGS ${AWESOME_COMMON_REQUIRED_LDFLAGS} - ${AWESOME_REQUIRED_LIBRARIES} + ${AWESOME_REQUIRED_LDFLAGS} ${LIB_EV} ${LUA_LIBRARIES}) @@ -214,13 +214,13 @@ set(AWESOME_REQUIRED_INCLUDE_DIRS # {{{ Optional libraries # # this sets up: -# AWESOME_OPTIONAL_LIBRARIES +# AWESOME_OPTIONAL_LDFLAGS # AWESOME_OPTIONAL_INCLUDE_DIRS if(WITH_DBUS) pkg_check_modules(DBUS dbus-1) if(DBUS_FOUND) - set(AWESOME_OPTIONAL_LIBRARIES ${AWESOME_OPTIONAL_LIBRARIES} ${DBUS_LDFLAGS}) + set(AWESOME_OPTIONAL_LDFLAGS ${AWESOME_OPTIONAL_LDFLAGS} ${DBUS_LDFLAGS}) set(AWESOME_OPTIONAL_INCLUDE_DIRS ${AWESOME_OPTIONAL_INCLUDE_DIRS} ${DBUS_INCLUDE_DIRS}) else() set(WITH_DBUS OFF)