generated from TheLartians/ModernCppStarter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix cmake formatting through fix-format target
- Loading branch information
Showing
5 changed files
with
31 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,9 @@ project( | |
# ---- Include guards ---- | ||
|
||
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) | ||
message( | ||
FATAL_ERROR | ||
"In-source builds not allowed. Use a build directory." | ||
) | ||
message(FATAL_ERROR "In-source builds not allowed. Use a build directory.") | ||
endif() | ||
|
||
|
||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) | ||
|
||
# Optionally set things like CMAKE_CXX_STANDARD, CMAKE_POSITION_INDEPENDENT_CODE here | ||
|
@@ -30,13 +26,10 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) | |
# Let's nicely support folders in IDEs | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
|
||
# Testing only available if this is the main app | ||
# Note this needs to be done in the main CMakeLists | ||
# since it calls enable_testing, which must be in the | ||
# main CMakeLists. | ||
# Testing only available if this is the main app Note this needs to be done in the main CMakeLists | ||
# since it calls enable_testing, which must be in the main CMakeLists. | ||
include(CTest) | ||
# include(CMakePrintHelpers) | ||
# Docs only available if this is the main app | ||
# include(CMakePrintHelpers) Docs only available if this is the main app | ||
find_package(Doxygen) | ||
if(Doxygen_FOUND) | ||
add_subdirectory(docs) | ||
|
@@ -56,7 +49,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | |
include(cmake/CPM.cmake) | ||
include(cmake/tools.cmake) | ||
|
||
|
||
CPMAddPackage( | ||
NAME fmt | ||
GIT_TAG 7.1.3 | ||
|
@@ -78,9 +70,8 @@ add_subdirectory(apps) | |
CPMAddPackage("gh:TheLartians/[email protected]") | ||
|
||
# ---- Create an installable target ---- | ||
# this allows users to install and find the library via `find_package()`. | ||
# the location where the project's version header will be placed should match the project's regular | ||
# header paths | ||
# this allows users to install and find the library via `find_package()`. the location where the | ||
# project's version header will be placed should match the project's regular header paths | ||
string(TOLOWER greeter/version.h VERSION_HEADER_LOCATION) | ||
packageProject( | ||
NAME greeter | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,50 +11,44 @@ include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake) | |
# enables sanitizers support using the the `USE_SANITIZER` flag available values are: Address, | ||
# Memory, MemoryWithOrigins, Undefined, Thread, Leak, 'Address;Undefined' | ||
if(USE_SANITIZER OR USE_STATIC_ANALYZER) | ||
cpmaddpackage("gh:StableCoder/cmake-scripts#1f822d1fc87c8d7720c074cde8a278b44963c354") | ||
CPMAddPackage("gh:StableCoder/cmake-scripts#1f822d1fc87c8d7720c074cde8a278b44963c354") | ||
|
||
if(USE_SANITIZER) | ||
include(${cmake-scripts_SOURCE_DIR}/sanitizers.cmake) | ||
endif() | ||
|
||
if(USE_STATIC_ANALYZER) | ||
if("clang-tidy" IN_LIST USE_STATIC_ANALYZER) | ||
set( | ||
CLANG_TIDY | ||
ON | ||
CACHE INTERNAL "" | ||
set(CLANG_TIDY | ||
ON | ||
CACHE INTERNAL "" | ||
) | ||
else() | ||
set( | ||
CLANG_TIDY | ||
OFF | ||
CACHE INTERNAL "" | ||
set(CLANG_TIDY | ||
OFF | ||
CACHE INTERNAL "" | ||
) | ||
endif() | ||
if("iwyu" IN_LIST USE_STATIC_ANALYZER) | ||
set( | ||
IWYU | ||
ON | ||
CACHE INTERNAL "" | ||
set(IWYU | ||
ON | ||
CACHE INTERNAL "" | ||
) | ||
else() | ||
set( | ||
IWYU | ||
OFF | ||
CACHE INTERNAL "" | ||
set(IWYU | ||
OFF | ||
CACHE INTERNAL "" | ||
) | ||
endif() | ||
if("cppcheck" IN_LIST USE_STATIC_ANALYZER) | ||
set( | ||
CPPCHECK | ||
ON | ||
CACHE INTERNAL "" | ||
set(CPPCHECK | ||
ON | ||
CACHE INTERNAL "" | ||
) | ||
else() | ||
set( | ||
CPPCHECK | ||
OFF | ||
CACHE INTERNAL "" | ||
set(CPPCHECK | ||
OFF | ||
CACHE INTERNAL "" | ||
) | ||
endif() | ||
|
||
|
@@ -68,5 +62,5 @@ endif() | |
|
||
# enables CCACHE support through the USE_CCACHE flag possible values are: YES, NO or equivalent | ||
if(USE_CCACHE) | ||
cpmaddpackage("gh:TheLartians/[email protected]") | ||
CPMAddPackage("gh:TheLartians/[email protected]") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters