Skip to content

Commit 2c463d8

Browse files
Add CMake support for Use-Cases code snippets
1 parent 50ca2b2 commit 2c463d8

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Use-Cases/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
cmake_minimum_required(VERSION 3.20)
2+
project(Use-Cases LANGUAGES C Fortran)
3+
4+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
5+
6+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -c -cpp -Wall -Wuninitialized -Wmaybe-uninitialized")
7+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -c -Wall -Wuninitialized -Wmaybe-uninitialized")
8+
9+
file(GLOB F90_SRCS "*.f90")
10+
file(GLOB C_SRCS "*.c")
11+
12+
foreach(src ${F90_SRCS})
13+
get_filename_component(prog ${src} NAME_WE)
14+
add_executable(${prog} ${src})
15+
endforeach()
16+
17+
foreach(src ${C_SRCS})
18+
get_filename_component(prog ${src} NAME_WE)
19+
add_executable(${prog} ${src})
20+
endforeach()

0 commit comments

Comments
 (0)