#
#@BEGIN LICENSE
#
# @plugin@ by Psi4 Developer, a plugin to:
#
# PSI4: an ab initio quantum chemistry software package
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#@END LICENSE
#

#Sources for your plugin go here
set(SRC @plugin@.cc )

#This is where the library will truly live (don't move it)
set(@plugin@HOME ${PROJECT_BINARY_DIR}/lib)

#These commands make your plugin a shared library, tell Psi about it, declare
#libplugin.a to be a dependency of your library (needed for linking correctly)
#and finally make a symbolic link so we don't break the old plugin system
add_library( @plugin@ SHARED ${SRC})
set_target_properties( @plugin@ PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${@plugin@HOME})
set(PLUGINS ${PLUGINS} lib@plugin@ PARENT_SCOPE)
target_link_libraries(@plugin@ plugin)
ADD_CUSTOM_COMMAND(
   TARGET @plugin@ POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_BINARY_DIR}/lib/lib@plugin@.so ${CMAKE_CURRENT_SOURCE_DIR}/@plugin@.so
)
