From: Manuel Nickschas Date: Fri, 13 Mar 2009 15:25:51 +0000 (+0100) Subject: Add -DLINK_EXTRA to the buildsys to allow for specifying additional libs to link X-Git-Tag: 0.5-rc1~304 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=b8017f7f0469e47a0e214ae573b08ffc346bd950;hp=b040ef84cdc254a0b1f083db3151f2724e45d210 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. --- 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)