Skip to content

Instantly share code, notes, and snippets.

@pwl
Created October 22, 2011 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwl/1306346 to your computer and use it in GitHub Desktop.
Save pwl/1306346 to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 2.8)
project( mmpde6_harmonic Fortran )
find_program(ifort "ifort")
# message(${ifort})
set(CMAKE_Fortran_COMPILER ${ifort})
# message(${comp})
include("/usr/local/share/fpde/fpde.cmake")
file(
GLOB bins
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/*.f90)
foreach(bin ${bins})
string(REPLACE ".f90" "" bin ${bin})
add_executable(${bin} ${CMAKE_CURRENT_SOURCE_DIR}/src/${bin}.f90)
set_target_properties(${bin}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/bin)
set_target_properties(${bin}
PROPERTIES
COMPILE_FLAGS
${fpde_flags})
target_link_libraries(${bin} fpde ${fpde_libs})
endforeach(bin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment