MantisBT - CMake
View Issue Details
0013868CMakeModulespublic2013-01-22 19:502016-06-10 14:31
Johnson City 
Kitware Robot 
normalmajoralways
closedmoved 
AppleOS X10.8.2
CMake 2.8.10.1 
 
0013868: FindOpenSSL fails to locate package when OPENSSL_ROOT_DIR is set on non-WIN32 platforms
FindOpenSSL fails to include OPENSSL_ROOT_DIR in the search paths on non-WIN32 configurations
1) cd openssl_source
2) ./config --prefix=$HOME/dev/openssl
3) make install
4) Add find_package(OpenSSL) to a cmake project
5) cmake -DOPENSSL_ROOT_DIR=$HOME/dev/openssl ..

find_package(OpenSSL) fails to locate this installation
No tags attached.
Issue History
2013-01-22 19:50Johnson CityNew Issue
2013-01-22 20:00Johnson CityNote Added: 0032126
2013-01-23 02:07Rolf Eike BeerNote Added: 0032127
2013-12-02 11:07trsystranNote Added: 0034678
2013-12-02 13:37Rolf Eike BeerNote Added: 0034682
2014-11-28 08:52Hannes MezgerNote Added: 0037310
2016-06-10 14:28Kitware RobotNote Added: 0042207
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0032126)
Johnson City   
2013-01-22 20:00   
This seems to be because the FindOpenSSL module gives higher priority to paths returned by pkg-config on UNIX.
(0032127)
Rolf Eike Beer   
2013-01-23 02:07   
Does this help?

 cmake -D CMAKE_PREFIX_PATH=$HOME/dev/openssl ..
(0034678)
trsystran   
2013-12-02 11:07   
I have the same issue:
cmake -DOPENSSL_ROOT_DIR=$HOME/dev/openssl ..
doesn't find the openssl version in ~/dev/openssl, but instead finds the system one, in /usr/lib & /usr/include.

It works with
cmake -D CMAKE_PREFIX_PATH=$HOME/dev/openssl ..

Should we always use CMAKE_PREFIX_PATH? or should OPENSSL_ROOT_DIR always have a higher priority?

(tested with cmake 2.10.2 and Modules from todays cmake git master).


Side question: Is there a standard *_ROOT_DIR for each module that cmake can find?
For ZLIB it seems to be ZLIB_ROOT.
It would be great to have a standard pattern for cmake variables to force modules dependencies search path.
(0034682)
Rolf Eike Beer   
2013-12-02 13:37   
CMAKE_PREFIX_PATH is the standard one.
(0037310)
Hannes Mezger   
2014-11-28 08:52   
The problem in version 2.8.x is that _OPENSSL_ROOT_HINTS_AND_PATHS is not set at all on non-WIN32 systems. This is why paths set in OPENSSL_ROOT_DIR are _never_ evaluated at all on these systems.

This is fixed in version 3.x, OPENSSL_ROOT_DIR is now always appended to _OPENSSL_ROOT_HINTS_AND_PATHS, so I think this issue might be closed now.
(0042207)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.