diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index c9fabb6..2ae0bc6 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -2,9 +2,11 @@ include(CTest) include_directories(${CMAKE_Fortran_MODULE_DIRECTORY}) +add_library(helpers OBJECT testing_helpers.f90) + function(make_example example_name) add_test(NAME ${example_name} COMMAND ${example_name} ${CMAKE_CURRENT_SOURCE_DIR}) - add_executable(${example_name} ${example_name}.f90 testing_helpers.f90) + add_executable(${example_name} ${example_name}.f90 $) target_link_libraries(${example_name} ${bmi_name}) endfunction(make_example) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 463b8e4..53daa32 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,9 +2,11 @@ include(CTest) include_directories(${CMAKE_Fortran_MODULE_DIRECTORY}) +add_library(fixtures OBJECT fixtures.f90) + function(make_test test_name) add_test(NAME ${test_name} COMMAND ${test_name} "${CMAKE_CURRENT_SOURCE_DIR}/sample.cfg") - add_executable(${test_name} ${test_name}.f90 fixtures.f90) + add_executable(${test_name} ${test_name}.f90 $) target_link_libraries(${test_name} ${bmi_name}) endfunction(make_test)