Skip to content

Instantly share code, notes, and snippets.

@scivision
Last active August 23, 2024 17:43
Show Gist options
  • Save scivision/5450e6c2152d8694d2738f9cd470c3bc to your computer and use it in GitHub Desktop.
Save scivision/5450e6c2152d8694d2738f9cd470c3bc to your computer and use it in GitHub Desktop.
Show CMake detecting change in Fortran module code
FC=ifx cmake -Bbuild -G "Unix Makefiles"
cmake --build build
touch modb.f90
# should rebuild here
cmake --build build
cmake_minimum_required (VERSION 3.20)
project(detectChange LANGUAGES Fortran)
add_executable(main.x main.f90 moda.f90 modb.f90)
program main
use a
implicit none
print '(i0)', i
end program
module a
use b
implicit none
end module
module b
integer, parameter :: i = 123
end module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment