Skip to content

Potential Cmake issue. Not able to get secondary dependency when including in own helloworld-app #119

@bratne

Description

@bratne

I trying to include program_options in a simple testapp, by using CMake.

include(FetchContent)
FetchContent_Declare (
    boost_program_options
    GIT_REPOSITORY https://github.com/boostorg/program_options.git   
    GIT_TAG boost-1.80.0
)
FetchContent_MakeAvailable(boost_program_options)
add_executable(helloworld main.cpp)
target_link_libraries(helloworld PRIVATE boost_program_options) 

Trying to build this yields

[cmake] CMake Error at CMakeLists.txt:15 (add_executable):
[cmake]   Target "helloworld" links to target "Boost::any" but the target was not
[cmake]   found.  Perhaps a find_package() call is missing for an IMPORTED target, or
[cmake]   an ALIAS target is missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions