mirror of
				https://github.com/TheLartians/ModernCppStarter.git
				synced 2025-10-31 18:21:35 +01:00 
			
		
		
		
	Added ${CMAKE_PROJECT_NAME}
This commit is contained in:
		
							parent
							
								
									2528ba4123
								
							
						
					
					
						commit
						004f33fde1
					
				
					 3 changed files with 9 additions and 9 deletions
				
			
		|  | @ -19,9 +19,9 @@ CPMAddPackage("gh:onqtam/doctest#2.4.5") | |||
| CPMAddPackage("gh:TheLartians/Format.cmake@1.7.0") | ||||
| 
 | ||||
| if(TEST_INSTALLED_VERSION) | ||||
|   find_package(Greeter REQUIRED) | ||||
|   find_package(${CMAKE_PROJECT_NAME} REQUIRED) | ||||
| else() | ||||
|   CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..) | ||||
|   CPMAddPackage(NAME ${CMAKE_PROJECT_NAME} SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..) | ||||
| endif() | ||||
| 
 | ||||
| # ---- Create binary ---- | ||||
|  | @ -34,9 +34,9 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17) | |||
| # enable compiler warnings | ||||
| if(NOT TEST_INSTALLED_VERSION) | ||||
|   if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||||
|     target_compile_options(Greeter PUBLIC -Wall -Wpedantic -Wextra -Werror) | ||||
|     target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC -Wall -Wpedantic -Wextra -Werror) | ||||
|   elseif(MSVC) | ||||
|     target_compile_options(Greeter PUBLIC /W4 /WX) | ||||
|     target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC /W4 /WX) | ||||
|     target_compile_definitions(${PROJECT_NAME} PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS) | ||||
|   endif() | ||||
| endif() | ||||
|  | @ -54,6 +54,6 @@ doctest_discover_tests(${PROJECT_NAME}) | |||
| # ---- code coverage ---- | ||||
| 
 | ||||
| if(ENABLE_TEST_COVERAGE) | ||||
|   target_compile_options(Greeter PUBLIC -O0 -g -fprofile-arcs -ftest-coverage) | ||||
|   target_link_options(Greeter PUBLIC -fprofile-arcs -ftest-coverage) | ||||
|   target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC -O0 -g -fprofile-arcs -ftest-coverage) | ||||
|   target_link_options(${CMAKE_PROJECT_NAME} PUBLIC -fprofile-arcs -ftest-coverage) | ||||
| endif() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue