Modern cmake library example


how-to-export-cpp-library ★7 - An OS-agnostic C++ library template sporting ctest and CI support, written in plain CMake with line-by-line guiding comments. [MIT] ModernCppCI ★59 ⏳1Y - An example of doing a Modern C++ project with CI (although it uses non-modern CMake like include_directories() ). Modern CMake for Library Developers Project Structure. The example code in this blog post is an simplified version of my project yart,... A Song of Targets and Properties. Targets are the main objects CMake manipulate for building... Use the Target. "$ {CMAKE_CURRENT_SOURCE_DIR}/main.cpp" ... ... CMake is controlled by writing instructions in CMakeLists.txt files. Each directory in your project should have a CMakeLists.txt file. What is nice about CMake is that CMakeLists.txt files in a sub-directory inherit properties set in the parent directory, reducing the amount of code duplication. Aug 09, 2016 · I will write some examples tomorrow and will leave a link here. In short: it’s not optimal in build time, doesn’t scale when used as third party, lead to PIC conflicts on Linux and quite surprising for user who expect to see shared library when `CMAKE_SHARED_LIBS=ON` and static library when `CMAKE_SHARED_LIBS=OFF`. ruslo Says: Nov 05, 2017 · My talk at the Dublin C++ User Group about Embracing Modern CMake. Corresponding blog post at https://steveire.wordpress.com/2017/11/05/embracing-modern-cmake/