From b8017f7f0469e47a0e214ae573b08ffc346bd950 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Fri, 13 Mar 2009 16:25:51 +0100 Subject: [PATCH] Add -DLINK_EXTRA to the buildsys to allow for specifying additional libs to link This is intended for adding missing libs for static builds, as deps are not always picked up correctly. As it is highly system- and configuration-specific, we can't hardcode those libs in the buildsys. For example, to build a static core with postgres support, I need: -DLINK_EXTRA=pq,crypt Also fix a warning for WIN32. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00b4e661..dbafc334 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,13 @@ if(WIN32) set(EMBED_DATA ON) endif(WIN32) +# For static builds, arbitrary extra libs might need to be linked +# Define a comma-separated list here +# e.g. for pgsql, we need -DLINK_EXTRA=pq;crypt +set(LINK_EXTRA "" CACHE STRING "Semicolon-separated list of libraries to be linked") +string(REPLACE "," ";" LINK_EXTRA ${LINK_EXTRA}) +link_libraries(${LINK_EXTRA}) + # Build Type # We need to make sure it's not empty # Supported: Release, RelWithDebugInfo, Debug, Debugfull @@ -253,8 +260,6 @@ if(WIN32) if(HAVE_SSL) link_libraries(${OPENSSL_LIBRARIES} libeay32MD) endif(HAVE_SSL) - - set(RC_WIN32 ../pics/win32.rc) # for app icons on windows endif(WIN32) if(STATIC) -- 2.20.1