-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
63 lines (49 loc) · 1.53 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
cmake_minimum_required(VERSION 3.22...3.32)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Please use out of source build like:
cmake -Bbuild")
endif()
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
# This project isn't using C++ modules; avoid bugs in module scanning CMake 3.28, 3.29 with GCC 14.1 on WIndows
project(FilesystemConcepts LANGUAGES C CXX)
enable_testing()
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 20)
include(options.cmake)
if(fortran)
enable_language(Fortran)
endif()
include(cmake/compilers.cmake)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
# CPPcheck
if(cppcheck)
find_program(cppcheck_exe NAMES cppcheck REQUIRED)
set(cppcheck_opts --enable=all --inline-suppr --quiet --suppressions-list=${PROJECT_SOURCE_DIR}/cppcheck.supp)
set(CMAKE_C_CPPCHECK ${cppcheck_exe} --std=c11 ${cppcheck_opts})
set(CMAKE_CXX_CPPCHECK ${cppcheck_exe} --std=c++20 ${cppcheck_opts})
endif()
# utilities
add_subdirectory(src)
set(satest canonical chdir copytree
file_parts file_types filesystem_type
find_file
home_dir
is_dir
is_exe
iterdir lib_dir mkdtemp
memory
space_avail symlink syscall path_type
strcpy_s
wide
)
if(WIN32)
list(APPEND satest case_sensitive maximums short_path unc)
elseif(CYGWIN)
list(APPEND satest cygpath)
endif()
foreach(d IN LISTS satest)
add_subdirectory(test/${d})
endforeach()
file(GENERATE OUTPUT .gitignore CONTENT "*")