View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015887CMakeModulespublic2015-12-18 19:442016-06-10 14:21
ReporterPatrick Spendrin 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformWindowsOSWindowsOS Version
Product VersionCMake 3.4.1 
Target VersionCMake 3.6Fixed in VersionCMake 3.6 
Summary0015887: FindOpenssl can't find self built openssl but prefers slproweb openssl
DescriptionWhen having a pre-built package of openssl installed from slproweb.com and you try to find a self-built openssl package in a different location, the slproweb stuff is always preferred.
Steps To Reproduce1) Install slproweb openssl development package (including import libraries and headers).
2a) Build openssl yourself
or
2b) copy over the include directory and the lib directory from the slproweb location and delete the VC and the MinGW folder inside the lib dir.
3) run find_package(OpenSSL)

-> you will not be able to find the new location, which contains both ssleay32.lib and libeay32.lib
Additional InformationThe problem occurs because ssleay32MD.lib/ssleay32MT.lib and libeay32MD.lib/libeay32MT.lib are searched before trying to find ssleay32.lib and libeay32.lib. Since the registry paths are by default in the HINTS section, these will be used first.

Attached patch fixes this by providing an option OPENSSL_MSVC_NO_RT_MODE which disables searching for MD/MT libraries.
TagsNo tags attached.
Attached Filespatch file icon 0001-Make-it-possible-to-ignore-slproweb-OpenSSL.patch [^] (2,004 bytes) 2015-12-18 19:44 [Show Content]
patch file icon 0001-FindOpenSSL-set-NAMES_PER_DIR-in-all-find_library-in.patch [^] (2,619 bytes) 2016-04-04 08:33 [Show Content]

 Relationships

  Notes
(0040006)
Brad King (manager)
2015-12-21 08:29

Corresponding mailing list thread:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/15308 [^]
(0040802)
Hannes Mezger (reporter)
2016-04-04 08:39

We have the same problem with self-built OpenSSL libraries not being found if slproweb's OpenSSL is installed. There actually is an additional problem: OPENSSL_INCLUDE_DIR points to the location of the self-built OpenSSL, but the OPENSSL_LIBRARIES point to slproweb's OpenSSL.

My proposal is not to modify the OPENSSL_MSVC_STATIC_RT behaviour, but to use the NAMES_PER_DIR option of find_library. This changes the logic for looking for libraries to check all given names for one directory at once and then go to the next directory. This would lead to the self-built OpenSSL to be found first.

A patch containing the needed changes is attached as 0001-FindOpenSSL-set-NAMES_PER_DIR-in-all-find_library-in.patch
(0040812)
Brad King (manager)
2016-04-05 09:37

Re 0015887:0040802: Great, thanks. Applied:

FindOpenSSL: Prefer libs early in search path regardless of name
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b1484403 [^]
(0041202)
Kitware Robot (administrator)
2016-06-10 14:21

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.

 Issue History
Date Modified Username Field Change
2015-12-18 19:44 Patrick Spendrin New Issue
2015-12-18 19:44 Patrick Spendrin File Added: 0001-Make-it-possible-to-ignore-slproweb-OpenSSL.patch
2015-12-21 08:29 Brad King Note Added: 0040006
2016-04-04 08:33 Hannes Mezger File Added: 0001-FindOpenSSL-set-NAMES_PER_DIR-in-all-find_library-in.patch
2016-04-04 08:39 Hannes Mezger Note Added: 0040802
2016-04-05 09:37 Brad King Note Added: 0040812
2016-04-05 09:37 Brad King Status new => resolved
2016-04-05 09:37 Brad King Resolution open => fixed
2016-04-05 09:37 Brad King Fixed in Version => CMake 3.6
2016-04-05 09:37 Brad King Target Version => CMake 3.6
2016-06-10 14:21 Kitware Robot Note Added: 0041202
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team