# Copyright (C) 2020 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # set(RESTRICTED_ROOT_DIR $ENV{RESTRICTED_ROOT_DIR} CACHE PATH "Path to the restricted repository") # get all restricted HDF tests set(hdfFilesRestr "") if (EXISTS ${RESTRICTED_ROOT_DIR}) file(GLOB hdfFilesRestr "${RESTRICTED_ROOT_DIR}/SHAPER/test.hdfs/*.hdf") endif() # get all HDF tests from the current drectory file(GLOB hdfFilesCur "${CMAKE_CURRENT_SOURCE_DIR}/*.hdf") set(hdfFilesRestr ${hdfFilesCur} ${hdfFilesRestr}) # collect test names set(TEST_NAMES "") foreach(eachFilePath ${hdfFilesRestr}) # Strip the ".hdf" suffix get_filename_component(aTestName ${eachFilePath} NAME_WE) # Check corresponding ".py" file with reference data exists if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${aTestName}.py") set(TEST_NAMES ${aTestName} ${TEST_NAMES}) else() message(WARNING "File ${aTestName}.py containing reference data for ${aTestName}.hdf does not exist") endif() endforeach() # return full path to HDF file related to the given test name function(GET_HDF hdfFullPath testName) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${testName}.hdf") set(${hdfFullPath} "${CMAKE_CURRENT_SOURCE_DIR}/${testName}.hdf" PARENT_SCOPE) elseif(EXISTS "${RESTRICTED_ROOT_DIR}/SHAPER/test.hdfs/${testName}.hdf") set(${hdfFullPath} "${RESTRICTED_ROOT_DIR}/SHAPER/test.hdfs/${testName}.hdf" PARENT_SCOPE) endif() endfunction(GET_HDF)