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

Documentation for CONAN_RUNTIME_LIB_DIRS seems incorrect #3775

Open
Todiq opened this issue Jun 14, 2024 · 0 comments
Open

Documentation for CONAN_RUNTIME_LIB_DIRS seems incorrect #3775

Todiq opened this issue Jun 14, 2024 · 0 comments

Comments

@Todiq
Copy link

Todiq commented Jun 14, 2024

Hello!

I was unable to create a minimal reproducible case that I could have posted in the conan repo issues.

Following https://docs.conan.io/2/reference/tools/cmake/cmaketoolchain.html#conan-runtime-lib-dirs kept leading me to the following error:

Running cmake --install .\dbconnectivity\build\windows-msvc-194-x86_64\ --prefix Release/:

-- Install configuration: "Release"
-- Installing: D://Release/lib/cwdbc.lib
-- Installing: D://Release/bin/cwdbc.dll
CMake Error at bconnectivity/build/windows-msvc-194-x86_64/cmake_install.cmake:75 (file): <-- we can observe a syntax error here as well: bconnectivity instead of dbconnectivity
  file Could not resolve runtime dependencies:

    HvsiFileTrust.dll

I managed to fix it by replacing [[.*/system32/.*\.dll]] with [=[.*system32\/.*\.dll]=]. I found the solution here: https://discourse.cmake.org/t/control-what-is-installed-packaged/3778/9.

I think we could even go as far as using these regexes. It works flawlessly for me on Windows but I'll let you test it further:

file(GET_RUNTIME_DEPENDENCIES my_app_deps
        PRE_EXCLUDE_REGEXES
            [=[api-ms-]=] # VC Redistibutable DLLs
            [=[ext-ms-]=] # Windows extension DLLs
            [[kernel32\.dll]] # Default in conan doc
            [[libc\.so\..*]] [[libgcc_s\.so\..*]] [[libm\.so\..*]] [[libstdc\+\+\.so\..*]] # Default in conan doc
        POST_EXCLUDE_REGEXES
            [=[.*system32\/.*\.dll]=] # Windows system DLLs
            [=[^\/(lib|usr\/lib|usr\/local\/lib)]=] # Unix system libraries
            DIRECTORIES ${CONAN_RUNTIME_LIB_DIRS}
    )

Would you mind having a look? Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant