Cmake scripts for build c++ projects
Find conanfile in project
Find modules in folder modules
.
Default: OFF
Examle: -DFIND_MODULES=ON
Find tests in folder tests
.
Default: OFF
Examle: -DFIND_TESTS=ON
Enable clang-tidy for code analysis.
Default: OFF
Examle: -DENABLE_TIDY=ON
\
|--CMakeList.txt
|--cmake
|--conanfile.txt
|--modules
| \
| |--Modules1--CMakeLists.txt
| |--Modules2--CMakeLists.txt
|
|--include
|--src
|--tests
\
|--googletests
|--test1--CMakeLists.txt
conanfile.txt
[requires]
toml11/3.7.0
[generators]
cmake_paths
cmake_find_package
[options]
Conan documentatio: https://docs.conan.io/en/1.46/reference/generators.html https://docs.conan.io/en/1.46/integrations/build_system/cmake.html
Executable
project(TestApp)
include(cmake/make.cmake)
#TARGET - project name
#SOURCES - path to source
#THREADS - threads module to add project
#CONAN_MODULES - list of conan modules to add project
#BOOST - list of boost modules to add project
#MODULES - list of own modules to add project
#LIBS - list of external modules to add project
executable(${PROJECT_NAME}
SOURCES ""
THREADS
CONAN_MODULES toml11
BOOST system
MODULES Modules1 Modules2
LIBS ... ...)
Modules 1
project(Modules1)
include(cmake/make.cmake)
static_library(${PROJECT_NAME}
SOURCES ""
THREADS
CONAN_MODULES ... ...
BOOST ... ...
MODULES ... ...
LIBS ... ...)
Modules 2
project(Modules2)
include(cmake/make.cmake)
shared_library(${PROJECT_NAME}
SOURCES ""
THREADS
CONAN_MODULES ... ...
BOOST ... ...
MODULES ... ...
LIBS ... ...)