2/18/2023 0 Comments Recompile with cmakeset ( CMAKE_CXX_STANDARD 14 ) set ( CMAKE_CXX_STANDARD_REQUIRED ON ) # Abseil currently supports C++14, C++17, and C++20. Project ( my_app_project ) # Pick the C++ standard to compile with. Here is a short CMakeLists.txt example of an application project using Abseil. You can then use the CMake command add_subdirectory() to include Abseil directly in your CMake project.Īdd the absl:: target you wish to use to the target_link_libraries() section of your executable or of your library. To disable Abseil tests, you have to pass either -DBUILD_TESTING=OFF or -DABSL_BUILD_TESTING=OFF when configuring your project with CMake.ĭownload Abseil and copy it into a subdirectory in your CMake project or add Abseil as a git submodule in your CMake project. If you want to build the Abseil tests, integrate the Abseil dependency Google Test into your CMake project. The recommendations below are similar to those for using CMake within the googletest framework ( ) Step-by-Step Instructions Incorporating Abseil Into a CMake Project ĬMake works by generating native makefiles or build projects that can be used in the compiler environment of your choice.įor API/ABI compatibility reasons, we strongly recommend building Abseil in a subdirectory of your project or as an embedded dependency. If you don't have CMake installed already, you can download it for free from. Abseil comes with a CMake build script ( CMakeLists.txt) that can be used on a wide range of platforms (“C” stands for cross-platform.).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |