Provide some useful tools for C++
include(FetchContent)
FetchContent_Declare(
cpptools
GIT_REPOSITORY https://github.com/ting2938/cpptools.git
GIT_TAG master
)
FetchContent_MakeAvailable(cpptools)
cpptools::ct
: basic target for cpptoolscpptools::gitinfo
: link git infomation to your target:CT_USE_GITINFO() add_execuable(your_main main.cpp) target_link_libraries(your_main cpptools::gitinfo) # and then you can use these macro in main.cpp: # GIT_BRANCH # GIT_TAG # GIT_COMMIT_HASH # GIT_DIRTY
cpptools::asan
: asan support for your target
-DCT_ASAN=ON/OFF
: setON
to enable link to asan library