set(OSCCTRL false)
cmake_minimum_required(VERSION 3.4.1)

# including libsndfile
include_directories( lib/libsndfile/include )
add_library( libsndfile SHARED IMPORTED )
set_target_properties( libsndfile PROPERTIES IMPORTED_LOCATION ../../../../lib/libsndfile/lib/${ANDROID_ABI}/libsndfile.so )

# including OSClib
if(OSCCTRL)
add_library( libOSCFaust SHARED IMPORTED )
set_target_properties( libOSCFaust PROPERTIES IMPORTED_LOCATION /usr/local/share/faust/osclib/android/libs/${ANDROID_ABI}/libOSCFaust.so )
endif(OSCCTRL)

# activate android code
if(OSCCTRL)
add_definitions(-DANDROID_DRIVER -DSOUNDFILE -DOSCCTRL)
elseif(NOT OSCCTRL)
add_definitions(-DANDROID_DRIVER -DSOUNDFILE)
endif(OSCCTRL)

# add other libs
add_library( dsp_faust SHARED src/main/cpp/java_interface_wrap.cpp src/main/cpp/DspFaust.cpp )
find_library( log-lib log )

# Set the path to the Oboe directory.
set (OBOE_DIR oboe)

# Add the Oboe library as a subdirectory in your project.
add_subdirectory (${OBOE_DIR} ./oboe)

# Specify the path to the Oboe header files.
include_directories (${OBOE_DIR}/include)

# linking
if(OSCCTRL)
target_link_libraries( dsp_faust libOSCFaust oboe libsndfile ${log-lib} )
elseif(NOT OSCCTRL)
target_link_libraries( dsp_faust oboe libsndfile ${log-lib} )
endif(OSCCTRL)
