mirror of
				https://github.com/TheLartians/ModernCppStarter.git
				synced 2025-10-31 18:21:35 +01:00 
			
		
		
		
	enable cmake formatting
This commit is contained in:
		
							parent
							
								
									4e87a9410a
								
							
						
					
					
						commit
						6ae0cb404f
					
				
					 6 changed files with 134 additions and 80 deletions
				
			
		|  | @ -1,41 +1,59 @@ | |||
| # this file contains a list of tools that can be activated and downloaded on-demand | ||||
| # each tool is enabled during configuration by passing an additional `-DUSE_<TOOL>=<VALUE>` argument to CMake | ||||
| # this file contains a list of tools that can be activated and downloaded on-demand each tool is | ||||
| # enabled during configuration by passing an additional `-DUSE_<TOOL>=<VALUE>` argument to CMake | ||||
| 
 | ||||
| # only activate tools for top level project | ||||
| if (NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) | ||||
| if(NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) | ||||
|   return() | ||||
| endif() | ||||
| 
 | ||||
| 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) | ||||
| # 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( | ||||
|     NAME StableCoder-cmake-scripts | ||||
|     GITHUB_REPOSITORY StableCoder/cmake-scripts | ||||
|     GIT_TAG 3d2d5a9fb26f0ce24e3e4eaeeff686ec2ecfb3fb | ||||
|   ) | ||||
|    | ||||
|   if (USE_SANITIZER) | ||||
| 
 | ||||
|   if(USE_SANITIZER) | ||||
|     include(${StableCoder-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 "") | ||||
|   if(USE_STATIC_ANALYZER) | ||||
|     if("clang-tidy" IN_LIST USE_STATIC_ANALYZER) | ||||
|       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 "") | ||||
|     if("iwyu" IN_LIST USE_STATIC_ANALYZER) | ||||
|       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 "") | ||||
|     if("cppcheck" IN_LIST USE_STATIC_ANALYZER) | ||||
|       set(CPPCHECK | ||||
|           ON | ||||
|           CACHE INTERNAL "" | ||||
|       ) | ||||
|     else() | ||||
|       SET(CPPCHECK OFF CACHE INTERNAL "") | ||||
|       set(CPPCHECK | ||||
|           OFF | ||||
|           CACHE INTERNAL "" | ||||
|       ) | ||||
|     endif() | ||||
| 
 | ||||
|     include(${StableCoder-cmake-scripts_SOURCE_DIR}/tools.cmake) | ||||
|  | @ -46,9 +64,8 @@ if (USE_SANITIZER OR USE_STATIC_ANALYZER) | |||
|   endif() | ||||
| endif() | ||||
| 
 | ||||
| # enables CCACHE support through the USE_CCACHE flag | ||||
| # possible values are: YES, NO or equivalent | ||||
| if (USE_CCACHE) | ||||
| # enables CCACHE support through the USE_CCACHE flag possible values are: YES, NO or equivalent | ||||
| if(USE_CCACHE) | ||||
|   CPMAddPackage( | ||||
|     NAME Ccache.cmake | ||||
|     GITHUB_REPOSITORY TheLartians/Ccache.cmake | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue