#  Copyright (C) 2017 The authors of Py-ChemShell
#
#  This file is part of Py-ChemShell.
#
#  Py-ChemShell 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 3 of the
#  License, or (at your option) any later version.
#
#  Py-ChemShell 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 Py-ChemShell.  If not, see
#  <http://www.gnu.org/licenses/>.

# subdirectories: register your interface directories here
list(APPEND CHEMSH_INTERFACES castep
                              cp2k			      	
                              dl_poly
                              dl_field
                              dl_monte
                              gamess_uk
                              gulp
                              namd
                              nwchem
                              lsdalton
                              fhiaims)

# save filenames of linked.f90 and notlinked.f90 to be used by interfaces
get_filename_component(LINKED    ${CHEMSH_DIR}/chemsh/interfaces/linked.f90 ABSOLUTE)
get_filename_component(NOTLINKED ${CHEMSH_DIR}/chemsh/interfaces/notlinked.f90 ABSOLUTE)

foreach(CHEMSH_INTERFACE ${CHEMSH_INTERFACES})

    add_subdirectory(${CHEMSH_INTERFACE})

    # clean policy: has to embed in the foreach loop here, but it's not the case in the root CMakeLists.txt
    get_filename_component(CURRENT_DIR ${CMAKE_CURRENT_LIST_DIR}/${CHEMSH_INTERFACE} ABSOLUTE)
    set(LIB_DIR_TO_CLEAN ${CHEMSH_DIR}/build/${CHEMSH_ARCH}/lib/${CHEMSH_INTERFACE})
    include(${CHEMSH_DIR}/chemsh/utils/cmake/clean.cmake)

endforeach(CHEMSH_INTERFACE)

