added CMakeLists.txt to examples

This commit is contained in:
Charlton, Scott R 2020-10-28 17:29:24 -06:00
parent 23fa9771e8
commit e1f78666d0
2 changed files with 23 additions and 4 deletions

View File

@ -2,11 +2,12 @@
project(example_advect_c C)
configure_file(phreeqc.dat phreeqc.dat COPYONLY)
configure_file(ic ic COPYONLY)
configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY)
# files
SET(C_Advect_Files
${IPhreeqc_BINARY_DIR}/examples/c/advect/CMakeLists.txt
advect.c
ic
phreeqc.dat
@ -31,6 +32,3 @@ SET(C_Advect_Dir ${EXAMPLES_DIR}/c/advect)
# install
install(FILES ${C_Advect_Files} DESTINATION ${C_Advect_Dir})

21
advect/CMakeLists.txt.in Normal file
View File

@ -0,0 +1,21 @@
# set minimum cmake version
cmake_minimum_required(VERSION 3.10)
# set project name along with language
# iphreeqc requires CXX
project(advect_c CXX C)
# 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_c advect.c)
# set link libraries as well as include paths
target_link_libraries(advect_c IPhreeqc::IPhreeqc)