Add -DLINK_EXTRA to the buildsys to allow for specifying additional libs to link
authorManuel Nickschas <sputnick@quassel-irc.org>
Fri, 13 Mar 2009 15:25:51 +0000 (16:25 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 13 Mar 2009 15:25:51 +0000 (16:25 +0100)
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

index 00b4e66..dbafc33 100644 (file)
@@ -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)