summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 07d5174704af15e31e2c8524dc09eb1d93f37063 (plain)
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
cmake_minimum_required(VERSION 3.2)
project(
	mossrose
	VERSION 0.1.0
)


option(MOSSROSE_BUILD_EXAMPLES "Build the example programs" OFF)


add_subdirectory(${CMAKE_SOURCE_DIR}/portaudio EXCLUDE_FROM_ALL)

add_library(mossrose
	${CMAKE_SOURCE_DIR}/src/mossrose.c
)
set_target_properties(mossrose PROPERTIES
	C_STANDARD 99
	CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic"
	VERSION ${PROJECT_VERSION}
	PUBLIC_HEADER src/mossrose.h
)
target_link_libraries(mossrose portaudio) 


if (MOSSROSE_BUILD_EXAMPLES)
	include_directories(${CMAKE_SOURCE_DIR}/src)
	add_custom_target(examples)
	add_subdirectory(${CMAKE_SOURCE_DIR}/examples)
endif()