How to use CMake

    2020年05月30日 字数:397
  • add_library(actorgraph_dep ActorGraph.cpp) means we add a library with the name actorgraph_dep and it’s implemented in ActorGraph.cpp. However, we also need to include the header files
  • target_include_directories(actorgraph_dep PUBLIC .) so we use target_include_directories to include the header files in the directory of actorgraph_dep. But what if actorgraph_dep also dependents on other libraries? Eg we have a vertex.cpp and vertex.hpp, at present we only have vertex.hpp handled, but still need to add vertex.cpp by
  • target_link_libraries(actorgraph_dep PUBLIC other_dep1)