File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,19 @@ cmake_minimum_required(VERSION 3.10)
1515#
1616# project information
1717#
18- project ("test" LANGUAGES C Fortran)
18+ project ("test" LANGUAGES C)
19+
20+ #
21+ # check for fortran support
22+ #
23+ include (CheckLanguage)
24+ check_language(Fortran)
25+ if (CMAKE_Fortran_COMPILER)
26+ enable_language (Fortran)
27+ message (STATUS "Fortran compiler found: ${CMAKE_Fortran_COMPILER} " )
28+ else ()
29+ message (STATUS "No Fortran support, will be disabled." )
30+ endif ()
1931
2032
2133#
Original file line number Diff line number Diff line change 1313add_subdirectory (libfoo)
1414add_subdirectory (bar)
1515add_subdirectory (libheader)
16- add_subdirectory (fortran)
16+
17+ if (CMAKE_Fortran_COMPILER)
18+ add_subdirectory (fortran)
19+ endif ()
You can’t perform that action at this time.
0 commit comments