【问题标题】:I really need to add # in Cmake url but BYPRODUCTS containing a "#" is not allowed我真的需要在 Cmake url 中添加 # 但不允许包含 \"#\" 的 BYPRODUCTS
【发布时间】:2022-10-20 18:01:46
【问题描述】:

CMakeLists.txt 中的代码

if (NOT glad_FOUND)
    include(FetchContent)
    FetchContent_Declare(
            glad
            URL "https://glad.dav1d.de/#language=c&specification=gl&api=gl%3D4.6&api=gles1%3Dnone&api=gles2%3Dnone&api=glsc2%3Dnone&profile=compatibility&loader=on"
            DOWNLOAD_NO_EXTRACT TRUE

    )
    FetchContent_MakeAvailable(glad)
endif()

Url

错误:

D:/IDEs/apps/CLion/ch-0/222.4167.35/bin/cmake/win/share/cmake-3.23/Modules/ExternalProject.cmake:2302:EVAL:2 (add_custom_command) 处的 CMake 错误: 不允许包含“#”的副产品。

【问题讨论】:

标签: cmake glad


【解决方案1】:

我切换到 GLEW

find_package(GLEW QUIET)
if (NOT GLEW_FOUND)
    include(FetchContent)
    FetchContent_Declare(
            GLEW
            GIT_REPOSITORY https://github.com/Perlmint/glew-cmake
            GIT_TAG glew-cmake-2.2.0
    )
    FetchContent_MakeAvailable(GLEW)
endif ()

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-07
    • 2017-07-05
    • 1970-01-01
    • 2017-12-20
    相关资源
    最近更新 更多