diff --git a/advect/CMakeLists.txt b/advect/CMakeLists.txt index 2b5dc31e..a49d3027 100644 --- a/advect/CMakeLists.txt +++ b/advect/CMakeLists.txt @@ -3,12 +3,14 @@ if (IPHREEQC_FORTRAN_TESTING AND IPHREEQC_ENABLE_MODULE) project(example_advect_f90 Fortran) configure_file(phreeqc.dat phreeqc.dat COPYONLY) - - configure_file(ic ic COPYONLY) + configure_file(ic ic COPYONLY) endif() +configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY) + # files SET(FORTRAN_Advect_Files +${IPhreeqc_BINARY_DIR}/examples/fortran/advect/CMakeLists.txt advect.F90 ic phreeqc.dat diff --git a/advect/CMakeLists.txt.in b/advect/CMakeLists.txt.in new file mode 100644 index 00000000..723ab453 --- /dev/null +++ b/advect/CMakeLists.txt.in @@ -0,0 +1,24 @@ +# set minimum cmake version +cmake_minimum_required(VERSION 3.10) + +# set project name along with language +# iphreeqc requires CXX +project(advect_f90 CXX Fortran) + +# copy necessary files into build directory +configure_file(phreeqc.dat phreeqc.dat COPYONLY) +configure_file(ic ic COPYONLY) + +# find IPhreeqc export package +# set CMAKE_PREFIX_PATH or IPhreeqc_DIR to the +# location of the IPhreeqcConfig.cmake file +find_package(IPhreeqc 3 REQUIRED) + +# add executable target +add_executable(advect_f90 advect.F90) + +# add source for iphreeqc fortran module +target_sources(advect_f90 PRIVATE ../../../src/IPhreeqc_interface.F90) + +# set link libraries as well as include paths +target_link_libraries(advect_f90 IPhreeqc::IPhreeqc)