marzer / tomlplusplus

Header-only TOML config file parser and serializer for C++17.
https://marzer.github.io/tomlplusplus/
MIT License
1.47k stars 141 forks source link

fetch_content module does not build tomlplusplus #181

Closed raphaelsoul closed 1 year ago

raphaelsoul commented 1 year ago
FetchContent_Declare(
        tomlplusplus
        GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
        GIT_TAG v3.2.0
        GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(tomlplusplus)
target_link_libraries(${PROJECT_NAME} PRIVATE tomlplusplus)

using fetchContent module download toml++.

but cannot find any reference in IDE(Clion), header file also cannot be found.

tried include_directories(${tomlplusplus_SOURCE_DIR}/include)

but throws error bellow when compile

ld: library not found for -ltomlplusplus

quite rookie to cpp and cmake, any advise?

image

raphaelsoul commented 1 year ago
FetchContent_Declare(
        tomlplusplus
        GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
        GIT_TAG        v3.2.0
)
FetchContent_MakeAvailable(tomlplusplus)
target_include_directories(${PROJECT_NAME} PRIVATE ${tomlplusplus_SOURCE_DIR}/include)

this works