[TOC] Adding FeaturesPosition independent codeLittle librariesInterprocedural optimization Adding Features There are lots of compiler and linker settings. When you need to add s...
[TOC] CUDAAdding the CUDA LanguageVariables for CUDAAdding a library / executableTargeting architecturesWorking with targetsUseful variablesNote that FindCUDA is deprecated, but f...
[TOC] OpenMP OpenMP OpenMP support was drastically improved in CMake 3.9+. The Modern(TM) way to add OpenMP to a target is: find_package(OpenMP)if(OpenMP_CXX_FOUND) target_l...
[TOC] Boost library Boost library The Boost library is included in the find packages that CMake provides, but it has a couple of oddities in how it works. See FindBoost for a fu...
[TOC] MPI MPI To add MPI, like OpenMP, you’ll be best off with CMake 3.9+. find_package(MPI REQUIRED)message(STATUS "Run: ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPR...
[TOC] CCache and UtilitiesCCacheUtilitiesClang tidyInclude what you useLink what you useClang-format CCache and Utilities Over the versions, common utilities that help you write...
[TOC] ROOTFinding ROOTThe right way (Targets)The old global wayComponentsDictionary generation Using Old ROOT ROOT ROOT is a C++ Toolkit for High Energy Physics. It is huge. The...
[TOC] Supporting IDEsFolders for targetsFolders for filesRunning with an IDE Supporting IDEs In general, IDEs are already supported by a standard CMake project. There are just a...
[TOC] A Simple ROOT Projectexamples/root-usefile/CMakeLists.txtexamples/root-usefile/SimpleExample.cxx A Simple ROOT Project This is a minimal example of a ROOT project using th...