Skip to content

How do I config ylt with fetch content? (Solved) #590

Answered by PikachuHyA
yhyu13 asked this question in Q&A
Discussion options

You must be logged in to vote

@yhyu13 hi, I test fetch content on my MacOS 13, it work fine

the highlight cmake config maybe

# change ylt_cmake_fetch to your own target name
target_link_libraries(ylt_cmake_fetch PRIVATE yalantinglibs)

the following is detail information about my demo

  • cmake config
cmake_minimum_required(VERSION 3.28)
project(ylt_cmake_fetch)

set(CMAKE_CXX_STANDARD 20)
include(FetchContent)
FetchContent_Declare(
        yalantinglibs
        GIT_REPOSITORY https://github.com/alibaba/yalantinglibs.git
        GIT_TAG a920fce8b0d7b6a3a42e459c17ee5b9925d5a2ff # the least commit id
        GIT_SHALLOW 1 # optional ( --depth=1 )
)
FetchContent_MakeAvailable(yalantinglibs)
add_executable(ylt_cmake_fetch m…

Replies: 6 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@PikachuHyA
Comment options

@yhyu13
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by poor-circle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #580 on February 04, 2024 12:06.