# build tests file(GLOB testcodes *.f) foreach(testsource ${testcodes}) GET_FILENAME_COMPONENT(filename ${testsource} NAME_WE) add_executable(${filename} ${filename}.f) target_link_libraries(${filename} apfel) add_test(${filename} ${filename}) endforeach() file(GLOB testcodes *.cc) foreach(testsource ${testcodes}) GET_FILENAME_COMPONENT(filename ${testsource} NAME_WE) add_executable(${filename} ${filename}.cc) target_link_libraries(${filename} apfel) add_test(${filename} ${filename}) endforeach()