Added dir_monitor
This commit is contained in:
		
							parent
							
								
									22d42fa236
								
							
						
					
					
						commit
						17cd355668
					
				
					 2 changed files with 59 additions and 13 deletions
				
			
		|  | @ -1,4 +1,12 @@ | ||||||
| format: | format: | ||||||
|  |   line_width: 120 | ||||||
|   tab_size: 4 |   tab_size: 4 | ||||||
|   use_tabchars: true |   use_tabchars: true | ||||||
|   fractional_tab_policy: round-up |   fractional_tab_policy: round-up | ||||||
|  |   max_subgroups_hwrap: 2 | ||||||
|  |   max_pargs_hwrap: 3 | ||||||
|  |   dangle_parens: true | ||||||
|  |   dangle_align: prefix | ||||||
|  |   min_prefix_chars: 0 | ||||||
|  |   max_prefix_chars: 16 | ||||||
|  |   keyword_case: upper | ||||||
|  |  | ||||||
|  | @ -3,43 +3,81 @@ cmake_minimum_required(VERSION 3.16) | ||||||
| set(CMAKE_CXX_STANDARD 17) | set(CMAKE_CXX_STANDARD 17) | ||||||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||||||
| set(CMAKE_CXX_CLANG_TIDY clang-tidy) | set(CMAKE_CXX_CLANG_TIDY clang-tidy) | ||||||
| set(BOOST_ENABLE_CMAKE ON) | 
 | ||||||
|  | include(ProcessorCount) | ||||||
|  | ProcessorCount(CPU_COUNT) | ||||||
|  | if(CPU_COUNT EQUAL 0) | ||||||
|  | 	set(CPU_COUNT 4) | ||||||
|  | endif() | ||||||
|  | message(STATUS "Counted ${CPU_COUNT} cores") | ||||||
|  | set(CTEST_BUILD_FLAGS -j${CPU_COUNT}) | ||||||
|  | set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${CPU_COUNT}) | ||||||
| 
 | 
 | ||||||
| execute_process( | execute_process( | ||||||
| 	COMMAND git describe --tags --dirty --always | 	COMMAND git describe --tags --dirty --always | ||||||
| 	WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | 	WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||||||
| 	OUTPUT_VARIABLE VERSION_STRING | 	OUTPUT_VARIABLE VERSION_STRING | ||||||
| 	OUTPUT_STRIP_TRAILING_WHITESPACE) | 	OUTPUT_STRIP_TRAILING_WHITESPACE | ||||||
|  | ) | ||||||
| 
 | 
 | ||||||
| string(REGEX REPLACE "^v?([0-9]+)\\.([0-9]+)\\.([0-9]+).*$" "\\1.\\2.\\3" | string( | ||||||
| 						MODIFIED_VERSION_STRING "${VERSION_STRING}") | 	REGEX | ||||||
|  | 	REPLACE "^v?([0-9]+)\\.([0-9]+)\\.([0-9]+).*$" | ||||||
|  | 			"\\1.\\2.\\3" | ||||||
|  | 			MODIFIED_VERSION_STRING | ||||||
|  | 			"${VERSION_STRING}" | ||||||
|  | ) | ||||||
| project( | project( | ||||||
| 	collector | 	collector | ||||||
| 	VERSION ${MODIFIED_VERSION_STRING} | 	VERSION ${MODIFIED_VERSION_STRING} | ||||||
| 	LANGUAGES CXX) | 	LANGUAGES CXX | ||||||
|  | ) | ||||||
| 
 | 
 | ||||||
| include(FetchContent) | include(FetchContent) | ||||||
| set(FETCHCONTENT_QUIET FALSE) | set(FETCHCONTENT_QUIET FALSE) | ||||||
|  | set(BOOST_ENABLE_CMAKE ON) | ||||||
| 
 | 
 | ||||||
| FetchContent_Declare( | FetchContent_Declare( | ||||||
| 	boostorg | 	boostorg | ||||||
| 	GIT_REPOSITORY https://github.com/boostorg/boost.git | 	GIT_REPOSITORY https://github.com/boostorg/boost.git | ||||||
| 	GIT_TAG boost-1.80.0 | 	GIT_TAG boost-1.80.0 | ||||||
| 	GIT_PROGRESS TRUE | 	GIT_PROGRESS TRUE | ||||||
|  | 	GIT_CONFIG fetch.parallel=${CPU_COUNT} submodule.fetchJobs=${CPU_COUNT} | ||||||
| 	GIT_SHALLOW TRUE | 	GIT_SHALLOW TRUE | ||||||
| 	FETCHCONTENT_QUIET FALSE) | ) | ||||||
| 
 | 
 | ||||||
| FetchContent_MakeAvailable(boostorg) | FetchContent_Declare( | ||||||
|  | 	dir_monitor | ||||||
|  | 	GIT_REPOSITORY https://github.com/schtobia/dir_monitor.git | ||||||
|  | 	GIT_TAG master | ||||||
|  | 	GIT_PROGRESS TRUE | ||||||
|  | 	GIT_SHALLOW TRUE | ||||||
|  | ) | ||||||
| 
 | 
 | ||||||
|  | FetchContent_Populate(boostorg) | ||||||
|  | add_subdirectory(${boostorg_SOURCE_DIR} ${boostorg_BINARY_DIR}) | ||||||
|  | 
 | ||||||
|  | FetchContent_MakeAvailable(dir_monitor) | ||||||
| 
 | 
 | ||||||
| enable_testing() | enable_testing() | ||||||
| 
 | 
 | ||||||
| configure_file(version.hpp.in ${PROJECT_SOURCE_DIR}/version.hpp) | configure_file(version.hpp.in ${PROJECT_SOURCE_DIR}/version.hpp) | ||||||
| 
 | 
 | ||||||
| add_executable(collector_test test.cpp) | add_executable(${PROJECT_NAME}_test test.cpp) | ||||||
| target_compile_options(${PROJECT_NAME}_test PUBLIC -Wall -Wextra -Wshadow | target_compile_options( | ||||||
| 													-Wnon-virtual-dtor) | 	${PROJECT_NAME}_test | ||||||
| add_test(NAME test1 COMMAND collector_test) | 	PUBLIC -Wall | ||||||
|  | 			-Wextra | ||||||
|  | 			-Wshadow | ||||||
|  | 			-Wnon-virtual-dtor | ||||||
|  | ) | ||||||
| 
 | 
 | ||||||
| target_link_libraries(collector_test PRIVATE Boost::filesystem Boost::system | target_link_libraries( | ||||||
| 												Boost::unit_test_framework) | 	${PROJECT_NAME}_test | ||||||
|  | 	PRIVATE Boost::filesystem | ||||||
|  | 			Boost::system | ||||||
|  | 			Boost::unit_test_framework | ||||||
|  | 			dir_monitor | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | add_test(NAME test1 COMMAND $[PROJECT_NAME}_test) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue