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

Unable to run from cmakelists generated by xmake #6115

Open
01Pollux opened this issue Jan 25, 2025 · 1 comment
Open

Unable to run from cmakelists generated by xmake #6115

01Pollux opened this issue Jan 25, 2025 · 1 comment
Labels

Comments

@01Pollux
Copy link

Xmake Version

xmake v2.9.7+HEAD.2bb99e0c3

Operating System Version and Architecture

Windows 11 23H2

Describe Bug

When generating CMakeLists.txt from xmake and building the project, the resulting file does not copy required libraries to the output directory.

Expected Behavior

The generated CMakeLists.txt should copy required libraries to the output directory.

Project Configuration

xmake.lua:

add_rules("mode.debug", "mode.release")

add_requires("fmt", {configs = {shared = true}})

target("test")
    set_kind("binary")
    add_files("main.cpp")
    add_packages("fmt", {public = true})

main.cpp:

#include <fmt/format.h>

int main(int argc, char** argv) {
    fmt::print("Hello World!\n");
    return 0;
}

Additional Information and Error Logs

Adding this to CMakeLists.txt to copy the files to output directory fixes the issue.

add_custom_command(TARGET test POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
        "......./fmt.dll"
        $<TARGET_FILE_DIR:test>
)
@01Pollux 01Pollux added the bug label Jan 25, 2025
@waruqi
Copy link
Member

waruqi commented Jan 26, 2025

This is not supported yet, only support for compilation.

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

No branches or pull requests

2 participants