## ## Configure files ## # tests/ex2 configure_file ( "ex2.in" "ex2" ) # tests/phreeqc.dat configure_file ( "phreeqc.dat.in" "phreeqc.dat" ) ## ## Test C ## project(test_c C) # source SET(test_c_SOURCES test_c.c ) # test executable add_executable(test_c ${test_c_SOURCES}) # library dependencies SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc) # link target_link_libraries(test_c ${EXTRA_LIBS}) # test compile and run add_test(TestCompileAndRunC test_c) if (MSVC AND BUILD_SHARED_LIBS) # copy dll add_custom_command(TARGET test_c POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ $ ) endif() ## ## Test CXX ## project(test_cxx CXX) # source SET(test_cxx_SOURCES test_cxx.cxx ) # test executable add_executable(test_cxx ${test_cxx_SOURCES}) # library dependencies SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc) # link target_link_libraries(test_cxx ${EXTRA_LIBS}) # test compile and run add_test(TestCompileAndRunCXX test_cxx) if (MSVC AND BUILD_SHARED_LIBS) # copy dll add_custom_command(TARGET test_cxx POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ $ ) endif() ## ## Test Fortran ## if (IPHREEQC_BUILD_FORTRAN) project(test_f90 Fortran) # source SET(test_f90_SOURCES ../src/IPhreeqc_interface.F90 main.f90 test_f90.f90 ) # test executable add_executable(test_f90 ${test_f90_SOURCES}) # library dependencies SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc) # link target_link_libraries(test_f90 ${EXTRA_LIBS}) # test compile and run add_test(TestCompileAndRunFortran test_f90) if (MSVC AND BUILD_SHARED_LIBS) # copy dll add_custom_command(TARGET test_f90 POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ $ ) endif() endif()