-
Notifications
You must be signed in to change notification settings - Fork 30
/
CMakeLists.txt
70 lines (51 loc) · 1.62 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# loudgain CMakeLists.txt
# Copyright (C) 2014 Alessandro Ghedini <alessandro@ghedini.me>
# This file is released under the 2 clause BSD license, see COPYING
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(loudgain C CXX)
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH})
SET(VERSION_MAJOR 0)
SET(VERSION_MINOR 1)
SET(loudgain_VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
SET(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(LAVC libavcodec REQUIRED)
PKG_CHECK_MODULES(LAVF libavformat REQUIRED)
PKG_CHECK_MODULES(LAVR libavresample REQUIRED)
PKG_CHECK_MODULES(LAVU libavutil REQUIRED)
PKG_CHECK_MODULES(LTAG taglib REQUIRED)
FIND_PACKAGE(EBUR128)
IF (NOT EBUR128_FOUND)
MESSAGE(FATAL_ERROR "libebur128 not found.")
ENDIF (NOT EBUR128_FOUND)
FILE(GLOB SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "src/*.cc" "src/*.c")
ADD_EXECUTABLE(loudgain ${SOURCES})
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/src
${EBUR128_INCLUDE_DIRS}
${LAVC_INCLUDE_DIRS}
${LAVF_INCLUDE_DIRS}
${LAVR_INCLUDE_DIRS}
${LAVU_INCLUDE_DIRS}
${LTAG_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
)
SET(LIBS )
TARGET_LINK_LIBRARIES(loudgain
${EBUR128_LIBRARY}
${LAVC_LIBRARIES}
${LAVF_LIBRARIES}
${LAVR_LIBRARIES}
${LAVU_LIBRARIES}
${LTAG_LIBRARIES}
)
SET_TARGET_PROPERTIES(loudgain PROPERTIES
COMPILE_FLAGS "-Wall -pedantic -g"
)
SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
INSTALL(FILES
${PROJECT_SOURCE_DIR}/docs/loudgain.1
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
)