You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMake Error at cmake/modules/SearchInstalledSoftware.cmake:924 (target_link_libraries):
The link interface of target "XRootD" contains:
OpenSSL::SSL
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
CMakeLists.txt:305 (include)
while on the same machine and in another empty directory doing just:
cmake -Dbuiltin_xrootd=ON .
The difference between the two case is that the ssl variable usually default to ON but in the minimal case it default to OFF and turning on builtin_xrootd does not turn ssl back on.
The reason why this matters is that find_package defaults to declaring its results only inside the parent_scope. In practice we see find_package works properly in the top level CMakeList.txt and in one level of indirection (typically cmake/modules/SearchInstalledSoftware.cmake) but a second level of direction (i.e. inside the add_subdirectory(builtins/xrootd) inside SearchInstalledSoftware.cmake), it does not work.
New in version 3.24: Specifying the GLOBAL keyword will promote all imported targets to a global scope in the importing project. Alternatively, this functionality can be enabled by setting the CMAKE_FIND_PACKAGE_TARGETS_GLOBAL variable.
So there is 3 possible solution
Require CMake version 3.24 and add the GLOBAL keyword where needed (or set the variable)
Make sure that builtin_xrootd (and any other similar components) to turn ssl ON when turned ON
Move the find_package(OpenSSL) from inside builtins/xrootd/CMakeLists.txtto it inclusion point inSearchInstalledSoftware.cmake`
Add an error if builtin_xrootd is ON while ssl is OFF.
The text was updated successfully, but these errors were encountered:
pcanal
changed the title
Configuring with builtin xrootd can failed because of seemingly not found OpenSSL library
Configuring with builtin xrootd can fail because of seemingly not found OpenSSL library
Sep 6, 2024
I checked that the following chain of configurations works now, and
failed before:
```
cmake -Dminimial=ON -Dssl=OFF ..
cmake -Dbuiltin_xrootd=ON .
```
Closesroot-project#16374.
Doing in a empty build directory
fails with:
while on the same machine and in another empty directory doing just:
The difference between the two case is that the
ssl
variable usually default toON
but in the minimal case it default toOFF
and turning onbuiltin_xrootd
does not turnssl
back on.The reason why this matters is that
find_package
defaults to declaring its results only inside the parent_scope. In practice we seefind_package
works properly in the top levelCMakeList.txt
and in one level of indirection (typicallycmake/modules/SearchInstalledSoftware.cmake
) but a second level of direction (i.e. inside theadd_subdirectory(builtins/xrootd)
insideSearchInstalledSoftware.cmake
), it does not work.From https://cmake.org/cmake/help/latest/command/find_package.html we read:
So there is 3 possible solution
CMake
version3.24
and add theGLOBAL
keyword where needed (or set the variable)builtin_xrootd
(and any other similar components) to turnssl
ON when turned ONfind_package(OpenSSL) from inside
builtins/xrootd/CMakeLists.txtto it inclusion point in
SearchInstalledSoftware.cmake`builtin_xrootd
is ON whilessl
is OFF.The text was updated successfully, but these errors were encountered: