Second, we add one line to the top of 3rdparty/CMakeLists. Third-party dependencies in one location. This lets us keep the versions (and the SHA256 hash of the tarball) of all our Let’s look at Boost for an example.įirst, we add two lines to Versions.cmake: set(BOOST_VERSION "1.53.0") addexecutable(bootstrap bootstrap.cpp) targetlinklibraries(bootstrap PRIVATE sut) First, we created a sut library and marked. Library lets you declare a header-only library as a proper CMake target, and Using header-only libraries in CMake is a breeze. Use ExternalProject_Add to obtain, configure, and build the library.Use add_library(IMPORTED) to declare an imported target.Ī header-only library is imported with add_library(INTERFACE).Add a nice header with the name, description, and home page. Find an appropriate location in 3rdparty/CMakeLists.txt to declare the.Add the URL/tarball file to the top of 3rdparty/CMakeLists.txt.Add the version and SHA256 hash to Versions.cmake.The steps to add a new third-party dependency are: Only have to add target_link_libraries(consumer dependency), with every otherīuild property coming from the graph (library location, include directories, When adding a third-party dependency, keep the principle of locality in mind.Īll necessary data for building with and linking to the library shouldīe defined where the library is imported. ![]() On disk needs to be a specific value, set the target property OUTPUT_NAME. Note that, on platforms where it is conventional,Īdd_library will prepend lib when writing the library to disk.ĭo not introduce a variable simply to hold the name of the target if the name ![]() libprocess is add_library(process), and mesos-agent isĪdd_executable(mesos-agent). ![]() When adding a new library or executable, prefer using the name directly as the
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |