File: CheckGeneratorSupport.cmake

package info (click to toggle)
lammps 20250204%2Bdfsg.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 474,368 kB
  • sloc: cpp: 1,060,070; python: 27,785; ansic: 8,956; f90: 7,254; sh: 6,044; perl: 4,171; fortran: 2,442; xml: 1,714; makefile: 1,352; objc: 238; lisp: 188; yacc: 58; csh: 16; awk: 14; tcl: 6; javascript: 2
file content (21 lines) | stat: -rw-r--r-- 864 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# ninja-build<1.10 does not support fortran.
if(CMAKE_GENERATOR STREQUAL "Ninja")
  set(CMAKE_GENERATOR_SUPPORT_FORTRAN FALSE)
  execute_process(COMMAND "${CMAKE_MAKE_PROGRAM}" --version
    OUTPUT_VARIABLE NINJA_VERSION
    OUTPUT_STRIP_TRAILING_WHITESPACE
    RESULT_VARIABLE _Ninja_version_result
  )
  if(_Ninja_version_result)
    message(WARNING "Unable to determine ninja version: ${_Ninja_version_result}, assuming fortran isn't supported")
  elseif(NINJA_VERSION VERSION_LESS "1.10")
    message(WARNING "Ninja build tool too old, to compile Fortran code, please install ninja-1.10 or newer")
  else()
    set(CMAKE_GENERATOR_SUPPORT_FORTRAN TRUE)
  endif()
else()
  set(CMAKE_GENERATOR_SUPPORT_FORTRAN TRUE)
  if(NOT CMAKE_GENERATOR STREQUAL "Unix Makefiles")
    message(WARNING "Assuming fortran is supported for ${CMAKE_GENERATOR}")
  endif()
endif()