Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Flex: Conan v2 support #14013
Flex: Conan v2 support #14013
Changes from 6 commits
c9ddde4
db455b6
f3953c0
2d144ed
5c22dd7
b40b1bf
7633203
8d43543
7d4c9b2
2a9395f
68e9796
2669f83
6ba553b
bab5e21
e4c69b5
0b0160d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can omit
scope="build"
here as it is the default.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://cmake.org/cmake/help/latest/module/FindFLEX.html 🤔 Usually it's just variables so it's say #13511 (comment)
If this was an output of flex's CMake install we could use
build_modules
but I am not sure if thats the case?Just a note this recipe is missing the cmake target definitions so you'll want to add those
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to inject the necessary variables in the CMakeToolchain via
conf
. Generate a small CMake script that sets the necessary Flex variables and add it totools.cmake.cmaketoolchain:user_toolchain
so that anything thattool_requires
Flex will inherit those CMake variables. You probably will only need to setFLEX_EXECUTABLE
,FLEX_LIBRARIES
, andFLEX_INCLUDE_DIRS
. Then maybe see what happens if you rename Conan's generated Config module to something like_Flex
so that nothing will actually use it.Alternatively, if you can add a build module that includes CMake's
FindFlex
module, that may also work. You'd probably have to set the same variables before including it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to @prince-chrismc and @jwillikers for the insights. The suggestion to set up an environment variable gave me an idea. I went and looked at the code for
FindFLEX
. It's internally usingfind_program
,find_library
andfind_path
, all of which will useFLEX_ROOT
as the first place to search, for CMake >= 3.12. See also the doc forfind_library
.Turns out the following works, at least in my local testing:
FLEX_ROOT
at the package.FindFLEX
. For CMakeDeps, have the recipe produce nothing for CMake, and for the old generators, make the package with a different name.