aboutsummaryrefslogtreecommitdiffstats
path: root/app/unisono/CMakeLists.txt
blob: 67bf8e02fcd0d32a52477d8c571abc915f805b1d (plain) (blame)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
cmake_minimum_required(VERSION 3.12)

project(unisono)
set (CMAKE_C_STANDARD 99)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fsanitize=address -fno-omit-frame-pointer")

find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
	pkg_check_modules(LIBSNDFILE_PKGCONF sndfile)
endif(PKG_CONFIG_FOUND)

find_path(LIBSNDFILE_INCLUDE_DIR
	NAMES sndfile.h
	PATHS ${LIBSNDFILE_PKGCONF_INCLUDE_DIRS}
)

find_library(LIBSNDFILE_LIBRARY
	NAMES sndfile libsndfile-1
	PATHS ${LIBSNDFILE_PKGCONF_LIBRARY_DIRS}
)

message(STATUS "sndfile include dirs path: ${LIBSNDFILE_INCLUDE_DIR}")
message(STATUS "sndfile libs path: ${LIBSNDFILE_LIBRARY}")

if(LIBFSHIFT_BUILD_PUB_HEADER)
	message(STATUS "use libfshift include path: ${LIBFSHIFT_BUILD_PUB_HEADER}")
	include_directories(${LIBFSHIFT_BUILD_PUB_HEADER})
endif()

add_executable(unisono "main.c")

if(LIBFSHIFT_BUILD_LIB_PATH)
	message(STATUS "use libfshift lib path: ${LIBFSHIFT_BUILD_LIB_PATH}")
	target_link_libraries(unisono PRIVATE ${LIBFSHIFT_BUILD_LIB_PATH})
endif()

include_directories(${LIBSNDFILE_INCLUDE_DIRS})
target_link_libraries(unisono PRIVATE ${LIBSNDFILE_LIBRARY} m)