# The autodiff example, ported to C via Elara Math's C bindings

# To build on Windows, use Developer Powershell for VS Studio
# (make sure you install VS build tools first)
# then run:
# 
#   mkdir build
#   cd build
#   cmake ..
#   msbuild elara-math-demo.sln
#
# On Unix systems, make sure you have
# a C compiler (GCC/clang) and then run:
# 
#   mkdir build && cd build
#   cmake ..
#   make
#

cmake_minimum_required (VERSION 3.5)
project (elara-math-demo C)

set( LEARN_CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
set( LEARN_CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} )
set( LEARN_CMAKE_SOURCES 
  autograd.c
)

# Header file path
include_directories( "${CMAKE_SOURCE_DIR}/../bindings" )
# Library path
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/target/debug" )

add_executable( ${PROJECT_NAME} ${LEARN_CMAKE_SOURCES} )

# Link the libraries
target_link_libraries( ${PROJECT_NAME} ${LIBS} m )
