From ebc0be26aac40832e9452f540ea3bf7e4a100da2 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Tue, 19 Feb 2013 23:28:44 +0100 Subject: [PATCH] Make sure that datafiles are copied when tests are made That way, if someone runs `make test`, the datafiles will be there if the testing programs are there, and the tests won't fail (because of that). --- cmake/Modules/OpmSatellites.cmake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/OpmSatellites.cmake b/cmake/Modules/OpmSatellites.cmake index e8e6347a..e29b2296 100644 --- a/cmake/Modules/OpmSatellites.cmake +++ b/cmake/Modules/OpmSatellites.cmake @@ -39,13 +39,21 @@ # opm_compile_satellites (opm-core test "" "^test_([^/]*)$") # macro (opm_compile_satellites opm satellite excl_all test_regexp) + # if we are going to build the tests always, then make sure that + # the datafiles are present too + if (NOT (${excl_all} MATCHES "EXCLUDE_ALL")) + set (_incl_all "ALL") + else (NOT (${excl_all} MATCHES "EXCLUDE_ALL")) + set (_incl_all "") + endif (NOT (${excl_all} MATCHES "EXCLUDE_ALL")) + # if a set of datafiles has been setup, pull those in if (${satellite}_DATAFILES) - add_custom_target (${satellite} DEPENDS ${${satellite}_DATAFILES}) + add_custom_target (${satellite} ${_incl_all} DEPENDS ${${satellite}_DATAFILES}) else (${satellite}_DATAFILES) - add_custom_target (${satellite}) + add_custom_target (${satellite} ${_incl_all}) endif (${satellite}_DATAFILES) - + # compile each of these separately foreach (_sat_FILE IN LISTS ${satellite}_SOURCES) get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)