-
Notifications
You must be signed in to change notification settings - Fork 993
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
[question] CMakeToolchain: Support for find_library(), find_path(), find_file(), find_program() #9427
Comments
Hi @SpaceIm Quick question, I guess it will be necessary to add the full paths to the "bin", "lib" subdirectories inside the packages, and it will not be enough to add the root package folders to CMAKE_LIBRARY_PATH et al? This would feel a bit in the wrong place for
So this functionality seems to belong in the Deps objects. Now, the current I think we should consider this, together with the mapping of the current |
Maybe, but root package folder is more appropriate for
I thought that
Or maybe I miss something, and there is some interaction between
Currently, |
One of the issues that trying to add that information will be the lack of multi-config support. That is inevitable as all the CMake Conan CMakeDeps generator will generate files, the |
Maybe one more suggestion if #9427 (comment) is implemented: root package folders shouldn't be added to So to summarize, in
Moreover conan should ensure either:
|
I think you can't require that |
|
I've tested: if(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM STREQUAL "ONLY")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM "BOTH")
endif()
if(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY STREQUAL "ONLY")
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY "BOTH")
endif()
if(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE STREQUAL "ONLY")
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE "BOTH")
endif() Here is the problem, let's take Actually |
That's only true if there is no build sysroot defined. In the cases I have in mind (Yocto SDK) Ninja would be part of the build sysroot which is also set in |
Well, I guess in this case you want to make "CMake sysroot" libs/programs discoverable before conan ones, that's all.
So yes maybe not a good idea to set |
Do you plan to add proper packages paths in
CMakeToolchain
to support:find_library()
of libraries in host context (addlib_paths
of host context packages inCMAKE_LIBRARY_PATH
?)find_path()
andfind_file()
of headers in host context (addinclude_paths
of host context packages inCMAKE_INCLUDE_PATH
?)find_program()
of programs in build context (addbin_paths
of build context packages inCMAKE_PROGRAM_PATH
?)Without this support,
CMakeToolchain
is unusable when:find_library()
orfind_path()
to discover dependencies without official CMake Find/config files or pkgconfig files.virtualrunenv
generator is a workaround, but I find it very hard and unconvenient to use in some IDEs).The text was updated successfully, but these errors were encountered: