-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
32 lines (24 loc) · 823 Bytes
/
Copy pathCMakeLists.txt
File metadata and controls
32 lines (24 loc) · 823 Bytes
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
cmake_minimum_required(VERSION 3.22)
project(DATA_STRUCTURE&&ALGORITHM)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include_directories(include)
file(GLOB C_FILES CONFIGURE_DEPENDS
src/*/*.c
)
file(GLOB CXX_FILES CONFIGURE_DEPENDS
src/*/*.cpp
)
foreach(src_file IN LISTS C_FILES)
get_filename_component(filename ${src_file} NAME_WE)
add_executable(${filename} ${src_file})
set_source_files_properties(${src_file} PROPERTIES LANGUAGE C)
endforeach()
foreach(src_file IN LISTS CXX_FILES)
get_filename_component(filename ${src_file} NAME_WE)
add_executable(${filename} ${src_file})
set_source_files_properties(${src_file} PROPERTIES LANGUAGE CXX)
endforeach()