Files correlati : Commento : Spostamento in libraries delle librerie esterne di Campo per una maggiore pulizia e organizzazione git-svn-id: svn://10.65.10.50/branches/R_10_00@24150 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			27 lines
		
	
	
		
			998 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			998 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
| cmake_minimum_required(VERSION 3.0)
 | |
| include(FindPkgConfig)
 | |
| pkg_check_modules(CURLPP REQUIRED curlpp)
 | |
| 
 | |
| set(CMAKE_CXX_STANDARD 11) # C++11...
 | |
| set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required...
 | |
| set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11
 | |
| 
 | |
| 
 | |
| file(GLOB ExamplesFileList "*.cpp")
 | |
| 
 | |
| # Create a meta target to create examples
 | |
| add_custom_target(build_all_examples COMMENT A target that requires all the examples.)
 | |
| 
 | |
| message(STATUS "Creating build rules for Examples:")
 | |
| foreach(Example ${ExamplesFileList})
 | |
|   message(STATUS "\tCreating build rule for ${Example}")
 | |
|   # Get the name without extension or directory
 | |
|   get_filename_component(ExampleName ${Example} NAME_WE)
 | |
|   # Define example executable
 | |
|   add_executable(${ExampleName} ${Example})
 | |
|   # Link example against curlpp
 | |
|   target_link_libraries(${ExampleName} ${CURLPP_LDFLAGS})
 | |
|   # make the meta target depend on this example.
 | |
|   add_dependencies(build_all_examples ${ExampleName})
 | |
| endforeach(Example ${ExamplesFileList})
 |