# This file is generated by the configuration process. DO NOT EDIT!
# It provides information for linking to the skywalker library from other
# codes using CMake.

set(SKYWALKER_PREFIX "@CMAKE_INSTALL_PREFIX@")
set(SKYWALKER_SOURCE_DIR "@PROJECT_SOURCE_DIR@")

if (NOT PROJECT_SOURCE_DIR STREQUAL SKYWALKER_SOURCE_DIR)
  # Library targets
  add_library(skywalker STATIC IMPORTED GLOBAL)
  set_target_properties(skywalker PROPERTIES IMPORTED_LOCATION "${SKYWALKER_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libskywalker_@SKYWALKER_PRECISION@.a")

  if (ENABLE_FORTRAN)
    add_library(skywalker_f90 STATIC IMPORTED GLOBAL)
    set_target_properties(skywalker_f90 PROPERTIES IMPORTED_LOCATION "${SKYWALKER_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libskywalker_f90_@SKYWALKER_PRECISION@.a")
  endif()
endif()

# Use this function to create a simple Skywalker driver program in C or Fortran.
function(add_skywalker_driver driver_name)
  add_executable(${driver_name} ${ARGN})
  # Is it a C or Fortran program?
  set(is_fortran FALSE)
  foreach(source ${ARGN})
    if (${source} MATCHES "[fF]90$")
      set(is_fortran TRUE)
      break()
    endif()
  endforeach()
  if (is_fortran)
    if (NOT ENABLE_FORTRAN)
      message(FATAL_ERROR "Cannot build Fortran driver--Skywalker Fortran support is not enabled!")
    endif()
    set(driver_libs skywalker_f90;skywalker)
  else()
    set(driver_libs skywalker)
  endif()
  if (NOT WIN32)
    list(APPEND driver_libs m)
  endif()
  target_link_libraries(${driver_name} ${driver_libs})
endfunction()

