-
Notifications
You must be signed in to change notification settings - Fork 1.1k
new test for relocaiton of cmake_find_none #18819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop2
Are you sure you want to change the base?
new test for relocaiton of cmake_find_none #18819
Conversation
It seems that defining relative paths while exporting fixes it. The generated CMake config.cmake file contains then: # Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target pkg::pkg
add_library(pkg::pkg STATIC IMPORTED)
set_target_properties(pkg::pkg PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
)
# Load information for each installed configuration.
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/pkgConfig-*.cmake")
foreach(_cmake_config_file IN LISTS _cmake_config_files)
include("${_cmake_config_file}")
endforeach()
unset(_cmake_config_file)
unset(_cmake_config_files)
# Cleanup temporary variables.
set(_IMPORT_PREFIX) There are a couple of challenges in this generated code:
A possible approach could be:
|
This may be related. One thing I've noticed relating to this, is that if I use I have to add the line: # Add conan toolchain so that a project in "none" type is found correctly.
include(${_conan_generators_folder}/conan_toolchain.cmake) I do know the BYPASS_PROVIDER option exists in CMake which is how we are finding non-conan managed dependencies, but the project in question is still conan managed, but not being found using that. just before the second |
yes, that is expected at the moment. The finding of in-package There is already ongoing work in the |
Changelog: (Feature | Fix | Bugfix): Describe here your pull request
Docs: Omit
Related to: #18815