forked from karlstav/cava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·25 lines (24 loc) · 1.07 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# This is only for the cavacore lib, see CAVACORE.md for details
# to build cava don't use this, use the automake stuff
cmake_minimum_required(VERSION 3.13.0)
project(cavacore)
if (ANDROID)
add_library(cavacore SHARED cavacore.c)
if (NOT DEFINED FFTW_DIR)
message(FATAL_ERROR "FFTW_DIR not set, required by android, see cavandroid/README.md")
endif()
if (NOT EXISTS ${FFTW_DIR})
message(FATAL_ERROR "given FFTW_DIR: ${FFTW_DIR} does not exist")
endif()
if (NOT EXISTS "${FFTW_DIR}/jni/fftw3/api/")
message(FATAL_ERROR "given fftw include dir: ${FFTW_DIR}/jni/fftw3/api/ does not exist")
endif()
if (NOT EXISTS "${FFTW_DIR}/obj/local/${CMAKE_ANDROID_ARCH_ABI}/")
message(FATAL_ERROR "given lib dir: ${FFTW_DIR}/obj/local/${CMAKE_ANDROID_ARCH_ABI}/ does not exist, did you build it? See cavandroid/README.md")
endif()
target_include_directories(cavacore PRIVATE "${FFTW_DIR}/jni/fftw3/api/")
target_link_directories(cavacore PRIVATE "${FFTW_DIR}/obj/local/${CMAKE_ANDROID_ARCH_ABI}/")
target_link_libraries(cavacore fftw3)
else()
add_library(cavacore STATIC cavacore.c)
endif()