mirror of
				https://github.com/TheLartians/ModernCppStarter.git
				synced 2025-10-31 18:21:35 +01:00 
			
		
		
		
	add options.cmake project config file
common options used for every cmake project prevent reame of standalone executable via cmake properties
This commit is contained in:
		
							parent
							
								
									9391ce636a
								
							
						
					
					
						commit
						6ea6bdd2ea
					
				
					 11 changed files with 84 additions and 103 deletions
				
			
		|  | @ -25,14 +25,14 @@ CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..) | |||
| file(GLOB sources CONFIGURE_DEPENDS source/*.cpp) | ||||
| 
 | ||||
| add_executable(GreeterStandalone ${sources}) | ||||
| 
 | ||||
| # TODO: why rename in this way? Seems only for CI with GitHub actions! CK | ||||
| set_target_properties( | ||||
|   GreeterStandalone PROPERTIES CXX_STANDARD ${CMAKE_CXX_STANDARD} OUTPUT_NAME "Greeter" | ||||
| ) | ||||
| set_target_properties(GreeterStandalone PROPERTIES CXX_STANDARD ${CMAKE_CXX_STANDARD}) | ||||
| 
 | ||||
| # WORKAROUND missing ALIAS target error! CK | ||||
| if(NOT TARGET cxxopts::cxxopts) | ||||
|   add_library(cxxopts::cxxopts ALIAS cxxopts) | ||||
| endif() | ||||
| target_link_libraries(GreeterStandalone Greeter::Greeter cxxopts::cxxopts) | ||||
| 
 | ||||
| # ---- run the standalone executable ---- | ||||
| enable_testing() | ||||
| add_test(NAME GreeterStandalone COMMAND GreeterStandalone) | ||||
|  |  | |||
|  | @ -1,9 +0,0 @@ | |||
| # CPM Package Lock This file should be committed to version control | ||||
| 
 | ||||
| # Ccache.cmake | ||||
| CPMDeclarePackage( | ||||
|   Ccache.cmake | ||||
|   NAME Ccache.cmake | ||||
|   VERSION 1.2.1 | ||||
|   GITHUB_REPOSITORY TheLartians/Ccache.cmake | ||||
| ) | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue