Skip to content
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

let generator overwrite xxxConfig.cmake #16279

Merged
merged 3 commits into from
May 28, 2024

Conversation

memsharded
Copy link
Member

Changelog: Bugfix: Let CMakeDeps generator overwrite the xxxConfig.cmake when it already exists.
Docs: Omit

This is exploratory PR to see if something breaks and trying to understand why it was there.

Close #16274

@memsharded memsharded marked this pull request as ready for review May 27, 2024 22:17
@memsharded
Copy link
Member Author

@jcar87 I have checked the protobuf->protoc case, in the included protobuf_BUILD_MODULES we can find:

 # Locate protoc executable
    ## Workaround for legacy "cmake" generator in case of cross-build
    if(CMAKE_CROSSCOMPILING)
        find_program(PROTOC_PROGRAM NAMES protoc PATHS ENV PATH NO_DEFAULT_PATH)
    endif()
    ## And here this will work fine with "CMakeToolchain" (for native & cross-build)
    ## and legacy "cmake" generator in case of native build
    if(NOT PROTOC_PROGRAM)
        find_program(PROTOC_PROGRAM NAMES protoc)
    endif()

that means, that as long the "build" context with the build profile keeps being build_type=Release, it doesn't really affect that the module that is loaded is the Debug or Release one, the same protoc from the "build" context is found.

Of course there might be other cases where it will reference some in-package things, but this wouldn't be the recommended case in general.

@czoido czoido merged commit 4279e48 into conan-io:develop2 May 28, 2024
2 checks passed
@memsharded memsharded deleted the fix/cmakedeps_cached_config branch May 28, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Conan generator results are not overwritten on a second run
3 participants