MantisBT - CMake
View Issue Details
0007172CMakeModulespublic2008-06-06 13:002012-01-04 16:18
Zhang Le 
Alex Neundorf 
normalminoralways
closedfixed 
CMake-2-6 
 
0007172: FindOpenSSL better use FindPkgConfig so that -Wl,--as-needed linking failure would be avoided
Gnu linker ld's --as-needed option has many advantages.
Please check "How can --as-needed be useful?" section on this page:
http://www.gentoo.org/proj/en/qa/asneeded.xml [^]

However if the build system can't find the actual needed libs, linking will failed when --as-needed is used.

Using pkg-config to find the libs would be a good idea. And thus this patch:

--- /usr/share/cmake/Modules/FindOpenSSL.cmake 2008-06-07 00:20:26.000000000 +0800
+++ home/FindOpenSSL.cmake 2008-06-07 00:57:48.000000000 +0800
@@ -46,7 +46,8 @@
    MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE)
 ELSE(WIN32 AND MSVC)
 
- FIND_LIBRARY(OPENSSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD )
+ INCLUDE( FindPkgConfig )
+ pkg_search_module(OPENSSL "openssl")
 
 ENDIF(WIN32 AND MSVC)
No tags attached.
Issue History
2008-06-06 13:00Zhang LeNew Issue
2008-08-19 16:41Bill HoffmanStatusnew => assigned
2008-08-19 16:41Bill HoffmanAssigned To => Alex Neundorf
2009-01-10 08:51Alex NeundorfCategoryCMake => Modules
2012-01-04 16:18Alex NeundorfNote Added: 0028180
2012-01-04 16:18Alex NeundorfStatusassigned => closed
2012-01-04 16:18Alex NeundorfResolutionopen => fixed

Notes
(0028180)
Alex Neundorf   
2012-01-04 16:18   
FindOpenSSL.cmake uses pkg-config in the meantime (since March 2011, which should be in cmake 2.8.5).

So I'm closing this one.

Alex