FindOpenSSL always uses system libs

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FindOpenSSL always uses system libs

Josef 'Jeff' Sipek
If you have a (linux or solaris) system with openssl installed in /usr and a
second copy installed elsewhere (e.g., /opt) and you want a cmake project to
find the elsewhere version, no matter what you try it finds the system copy.
(In other words, OPENSSL_ROOT_DIR has no effect.)  Are we missing something or
is this a bug in FindOpenSSL?  We've tested cmake 2.8.5, 2.8.8, and 2.8.11
without any luck.

Thanks,

Jeff.


Example:

jsipek@poseidon:/tmp/ssltest$ cat CMakeLists.txt
cmake_minimum_required(VERSION 2.8.5)
project(test)

find_package(OpenSSL REQUIRED)
jsipek@poseidon:/tmp/ssltest$ rm CMakeCache.txt && OPENSSL_ROOT_DIR=/tmp/ossl/ cmake . -DOPENSSL_ROOT_DIR=/tmp/ossl/
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/gnu/bin/gcc
-- Check for working C compiler: /usr/gnu/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/gnu/bin/c++
-- Check for working CXX compiler: /usr/gnu/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found OpenSSL: /usr/lib/libssl.so;/usr/lib/libcrypto.so (found version "0.9.8x")
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/ssltest
jsipek@poseidon:/tmp/ssltest$ find /tmp/ossl/lib/
/tmp/ossl/lib/
/tmp/ossl/lib/engines
/tmp/ossl/lib/pkgconfig
/tmp/ossl/lib/pkgconfig/libcrypto.pc
/tmp/ossl/lib/pkgconfig/libssl.pc
/tmp/ossl/lib/pkgconfig/openssl.pc
/tmp/ossl/lib/libcrypto.a
/tmp/ossl/lib/libssl.a

--
mainframe, n.:
  An obsolete device still used by thousands of obsolete companies serving
  billions of obsolete customers and making huge obsolete profits for their
  obsolete shareholders. And this year's run twice as fast as last year's.
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: FindOpenSSL always uses system libs

Andreas Pakulat-2
Hi,

On Wed, Aug 14, 2013 at 8:06 PM, Josef 'Jeff' Sipek <[hidden email]> wrote:
If you have a (linux or solaris) system with openssl installed in /usr and a
second copy installed elsewhere (e.g., /opt) and you want a cmake project to
find the elsewhere version, no matter what you try it finds the system copy.
(In other words, OPENSSL_ROOT_DIR has no effect.)  Are we missing something or
is this a bug in FindOpenSSL?  We've tested cmake 2.8.5, 2.8.8, and 2.8.11
without any luck.

Yes this is a bug in the module, on Windows it sets a variable called _OPENSSL_HINTS_AND_PATHS, but on *nix it only sets _OPENSSL_HINTS based on the OPENSSL_ROOT_DIR variable. The code further down that looks for headers and libs only uses _OPENSSL_HINTS_AND_PATHS with the HINTS keyword and nothing else in the file uses _OPENSSL_HINTS.

Andreas 


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake