Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

clean up build system

  • Loading branch information...
commit e8956cad59e7d1ade24e7451b1460e0f91408778 1 parent c126014
@jiixyj authored
View
54 CMakeLists.txt
@@ -3,9 +3,10 @@
######################################
project(libebur128)
cmake_minimum_required(VERSION 2.6.4)
-set(CMAKE_MODULE_PATH ${${PROJECT_NAME}_SOURCE_DIR}/cmake)
-set(EXECUTABLE_OUTPUT_PATH ${${PROJECT_NAME}_BINARY_DIR})
-set(LIBRARY_OUTPUT_PATH ${${PROJECT_NAME}_BINARY_DIR})
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
+set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
+include_directories(${CMAKE_BINARY_DIR})
include_directories(libebur128)
include_directories(libinputaudio)
@@ -36,54 +37,23 @@ find_package(TAGLIB)
find_package(GStreamer)
find_package(Qt4 COMPONENTS QtGui QtSvg)
-if(SNDFILE_FOUND)
-include_directories(SYSTEM ${SNDFILE_INCLUDE_DIRS})
-endif()
-if(MPG123_FOUND)
-include_directories(SYSTEM ${MPG123_INCLUDE_DIRS})
-endif()
-if(MPCDEC_FOUND)
-include_directories(SYSTEM ${MPCDEC_INCLUDE_DIRS})
-endif()
-if(GLIB_FOUND)
-include_directories(SYSTEM ${GLIB_INCLUDE_DIRS})
-endif()
-if(GTK2_FOUND)
-include_directories(SYSTEM ${GTK2_INCLUDE_DIRS})
-endif()
-if(RSVG2_FOUND)
-include_directories(SYSTEM ${RSVG2_INCLUDE_DIRS})
-endif()
if(NOT SPEEXDSP_FOUND)
-add_definitions(-DEBUR128_USE_SPEEX_RESAMPLER=0)
+ set(EBUR128_USE_SPEEX_RESAMPLER ZERO)
endif()
-if(FFMPEG_FOUND)
-include_directories(SYSTEM ${FFMPEG_INCLUDE_DIRS})
-endif()
-if(TAGLIB_FOUND)
-include_directories(SYSTEM ${TAGLIB_INCLUDE_DIRS})
-endif()
-if(GSTREAMER_FOUND)
-if(UNIX)
+
+if(GSTREAMER_FOUND AND UNIX)
set(GSTREAMER_INPUT_STATIC TRUE)
endif()
-include_directories(SYSTEM ${GSTREAMER_INCLUDE_DIR})
-foreach(arg ${GSTREAMER_DEFINITIONS})
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${arg}")
-endforeach()
-endif()
-if(QT4_FOUND)
-include(${QT_USE_FILE})
-include_directories(SYSTEM ${QT_INCLUDES})
-endif()
set(USE_TAGLIB ${TAGLIB_FOUND} CACHE BOOL "Use taglib for ReplayGain compatible tagging")
-if(USE_TAGLIB)
- add_definitions(-DUSE_TAGLIB)
-else()
+if(NOT USE_TAGLIB)
set(TAGLIB_FOUND FALSE)
endif()
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+add_definitions(-DHAVE_CONFIG_H)
+
######################################
##### Compiler setup #####
######################################
View
5 config.h.in
@@ -0,0 +1,5 @@
+/* for ebur128.h */
+#cmakedefine EBUR128_USE_SPEEX_RESAMPLER 0
+
+/* for scanner.c */
+#cmakedefine USE_TAGLIB
View
4 libebur128/CMakeLists.txt
@@ -1,13 +1,11 @@
cmake_minimum_required(VERSION 2.6.4)
include_directories(queue)
-if(SPEEXDSP_FOUND)
- include_directories(SYSTEM ${SPEEXDSP_INCLUDE_DIRS})
-endif()
add_library(ebur128 ebur128.c)
if(SPEEXDSP_FOUND)
+ include_directories(SYSTEM ${SPEEXDSP_INCLUDE_DIRS})
target_link_libraries(ebur128 ${SPEEXDSP_LIBRARIES})
endif()
View
4 libebur128/ebur128.h
@@ -2,6 +2,10 @@
#ifndef EBUR128_H_
#define EBUR128_H_
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
#ifndef EBUR128_USE_SPEEX_RESAMPLER
/** Set this to 1 to enable true peak scanning */
#define EBUR128_USE_SPEEX_RESAMPLER 1
View
18 libinputaudio/CMakeLists.txt
@@ -1,10 +1,12 @@
cmake_minimum_required(VERSION 2.6.4)
-if(GSTREAMER_INPUT_STATIC)
- add_definitions(-DGSTREAMER_INPUT_STATIC)
-endif()
-
if(GLIB_FOUND)
+ include_directories(SYSTEM ${GLIB_INCLUDE_DIRS})
+
+ if(GSTREAMER_INPUT_STATIC)
+ add_definitions(-DGSTREAMER_INPUT_STATIC)
+ endif()
+
add_library(input input)
if(WIN32)
add_library(input_win32 input_win32)
@@ -17,26 +19,34 @@ if(GLIB_FOUND)
endif()
if(SNDFILE_FOUND)
+ include_directories(SYSTEM ${SNDFILE_INCLUDE_DIRS})
add_library(input_sndfile MODULE input_sndfile.c)
target_link_libraries(input_sndfile ${SNDFILE_LIBRARIES} ${INPUT_HELPERS})
endif()
if(MPG123_FOUND)
+ include_directories(SYSTEM ${MPG123_INCLUDE_DIRS})
add_library(input_mpg123 MODULE input_mpg123.c)
target_link_libraries(input_mpg123 ${MPG123_LIBRARIES})
endif()
if(MPCDEC_FOUND)
+ include_directories(SYSTEM ${MPCDEC_INCLUDE_DIRS})
add_library(input_musepack MODULE input_mpcdec.c)
target_link_libraries(input_musepack ${MPCDEC_LIBRARY} ${INPUT_HELPERS})
endif()
if(FFMPEG_FOUND)
+ include_directories(SYSTEM ${FFMPEG_INCLUDE_DIRS})
add_library(input_ffmpeg MODULE input_ffmpeg.c)
target_link_libraries(input_ffmpeg ${FFMPEG_LIBRARIES} ${GLIB_LIBRARIES})
endif()
if(GSTREAMER_FOUND)
+ include_directories(SYSTEM ${GSTREAMER_INCLUDE_DIR})
+ foreach(arg ${GSTREAMER_DEFINITIONS})
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${arg}")
+ endforeach()
if(GSTREAMER_INPUT_STATIC)
add_library(input_gstreamer input_gstreamer.c)
target_link_libraries(input input_gstreamer)
View
10 scanner/CMakeLists.txt
@@ -1,12 +1,15 @@
cmake_minimum_required(VERSION 2.6.4)
if(GLIB_FOUND)
+ include_directories(SYSTEM ${GLIB_INCLUDE_DIRS})
+
add_library(parse_args parse_args)
list(APPEND SCANNER_SRCS scanner.c nproc.c
scanner-scan.c scanner-dump.c
scanner-common.c)
if(TAGLIB_FOUND)
+ include_directories(SYSTEM ${TAGLIB_INCLUDE_DIRS})
list(APPEND SCANNER_SRCS scanner-tag.c rgtag.cpp)
endif()
@@ -31,6 +34,8 @@ if(GLIB_FOUND)
LIBRARY DESTINATION ${FOLDER_PLUGIN})
if(GTK2_FOUND AND RSVG2_FOUND AND TAGLIB_FOUND)
+ include_directories(SYSTEM ${GTK2_INCLUDE_DIRS})
+ include_directories(SYSTEM ${RSVG2_INCLUDE_DIRS})
add_executable(loudness-drop scanner-drop scanner-tag scanner-common nproc rgtag.cpp)
target_link_libraries(loudness-drop ebur128 input filetree parse_args ${RSVG2_LIBRARIES} ${GTK2_LIBRARIES} ${TAGLIB_LIBRARIES})
install(TARGETS loudness-drop
@@ -39,8 +44,10 @@ if(GLIB_FOUND)
endif()
if(QT4_FOUND AND TAGLIB_FOUND)
- qt4_automoc(scanner-drop-qt.cpp)
+ include(${QT_USE_FILE})
+ include_directories(SYSTEM ${QT_INCLUDES})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
+ qt4_automoc(scanner-drop-qt.cpp)
add_executable(loudness-drop-qt scanner-drop-qt scanner-tag scanner-common nproc rgtag.cpp)
target_link_libraries(loudness-drop-qt ebur128 input filetree parse_args ${GLIB_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTSVG_LIBRARY} ${TAGLIB_LIBRARIES})
install(TARGETS loudness-drop-qt
@@ -49,6 +56,7 @@ if(GLIB_FOUND)
endif()
if(SNDFILE_FOUND)
+ include_directories(SYSTEM ${SNDFILE_INCLUDE_DIRS})
add_executable(r128-minimal-example minimal_example.c)
target_link_libraries(r128-minimal-example ebur128 ${SNDFILE_LIBRARIES})
endif()
View
3  test/CMakeLists.txt
@@ -1,4 +1,5 @@
-if(GLIB_FOUND AND SNDFILE_FOUND)
+if(SNDFILE_FOUND)
+ include_directories(SYSTEM ${SNDFILE_INCLUDE_DIRS})
add_executable(r128-test-library tests.c)
target_link_libraries(r128-test-library ebur128 ${SNDFILE_LIBRARIES})
add_test(test1 ${EXECUTABLE_OUTPUT_PATH}/r128-test-library)

0 comments on commit e8956ca

Please sign in to comment.
Something went wrong with that request. Please try again.