@@ -7,45 +7,17 @@ set(fppFiles
7
7
stdlib_experimental_stats_mean.fypp
8
8
)
9
9
10
- # Pre-process
11
- foreach (infileName IN LISTS fppFiles)
12
-
13
- # Generate output file name
14
- string (REGEX REPLACE ".fypp\$ " ".f90" outfileName "${infileName} " )
15
-
16
- # Create the full path for the new file
17
- set (outfile "${CMAKE_CURRENT_BINARY_DIR} /${outfileName} " )
18
-
19
- # Generate input file name
20
- set (infile "${CMAKE_CURRENT_SOURCE_DIR} /${infileName} " )
21
-
22
- # Custom command to do the processing
23
- if (DEFINED CMAKE_MAXIMUM_RANK)
24
- add_custom_command (
25
- OUTPUT "${outfile} "
26
- COMMAND fypp -DMAXRANK=${CMAKE_MAXIMUM_RANK} "${infile} " "${outfile} "
27
- MAIN_DEPENDENCY "${infile} "
28
- VERBATIM )
29
- elseif (f03rank)
30
- add_custom_command (
31
- OUTPUT "${outfile} "
32
- COMMAND fypp "${infile} " "${outfile} "
33
- MAIN_DEPENDENCY "${infile} "
34
- VERBATIM )
35
- else ()
36
- add_custom_command (
37
- OUTPUT "${outfile} "
38
- COMMAND fypp -DVERSION90 "${infile} " "${outfile} "
39
- MAIN_DEPENDENCY "${infile} "
40
- VERBATIM )
41
- endif ()
42
-
43
- # Finally add output file to a list
44
- set (outFiles ${outFiles} "${outfile} " )
45
-
46
- endforeach (infileName)
47
10
11
+ # Custom preprocessor flags
12
+ if (DEFINED CMAKE_MAXIMUM_RANK)
13
+ set (fyppFlags "-DMAXRANK=${CMAKE_MAXIMUM_RANK} " )
14
+ elseif (f03rank)
15
+ set (fyppFlags)
16
+ else ()
17
+ set (fyppFlags "-DVERSION90" )
18
+ endif ()
48
19
20
+ fypp_f90("${fyppFlags} " "${fppFiles} " outFiles)
49
21
50
22
set (SRC
51
23
stdlib_experimental_ascii.f90
0 commit comments