# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we ask that before distributing modifed
# versions of this software, you first contact the authors at
# oof_manager@nist.gov.


# This file was created by oof2-setup-extension from the
# CMakeLists.txt template in OOF2/EXTENSION_TEMPLATES.

cmake_minimum_required(VERSION 3.18)

# You may want to change the version number in the following line.
project(%MODULENAME% VERSION 0.0.0)

# Set the default values of OOF2_PYTHON_VERSION.  Setting it here,
# *before* loading oofbuildtools.cmake, sets the default value to the
# one from the oof2 build, transferred here when oof2-extension-setup
# replaced the template strings.
set(OOF2_PYTHON3_VERSION %PYTHON% CACHE STRING "Use this version of Python")

include("%OOF2PREFIX%/share/oof2/tools/oofbuildtools.cmake")

find_library(OOF2COMMON oof2common %OOF2PREFIX%/lib)
find_library(OOF2ENGINE oof2engine %OOF2PREFIX%/lib)
mark_as_advanced(OOF2COMMON OOF2ENGINE)

# Install the __init__.py file in the top directory of the extension
install(
  FILES
  ${PROJECT_SOURCE_DIR}/__init__.py
  DESTINATION ${CMAKE_INSTALL_PREFIX}/%MODULENAME%)

# Install all python files from the source directory in the top
# directory of the extension.  Subdirectories of source will be
# installed as subdirectories.
install(
  DIRECTORY source/
  DESTINATION ${CMAKE_INSTALL_PREFIX}/%MODULENAME%
  FILES_MATCHING
  PATTERN "*.py")


add_subdirectory("source") # This does all the real work
