-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
91 lines (76 loc) · 2.72 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
project (ealayer3)
cmake_minimum_required (VERSION 2.8)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
enable_testing ()
# Set our version number
set (ealayer3_VERSION_MAJOR 0)
set (ealayer3_VERSION_MINOR 7)
set (ealayer3_VERSION_PATCH 0)
# Find boost and include it
find_package (Boost 1.68.0 REQUIRED)
include_directories (${Boost_INCLUDE_DIRS})
# Find mpg123 and include it
find_package (MPG123 1.25.8 REQUIRED)
include_directories (${MPG123_INCLUDE_DIRS})
# Configure our version file
configure_file ("${PROJECT_SOURCE_DIR}/src/Version.h.in"
"${PROJECT_BINARY_DIR}/Version.h"
)
# Make sure that we can include it
include_directories("${PROJECT_BINARY_DIR}")
# The list of source files
set (SOURCE_FILES
src/Main.cpp
src/FileDecoder.cpp
src/BlockLoader.cpp
src/Parser.cpp
src/MpegGenerator.cpp
src/OutputStream.cpp
src/MpegOutputStream.cpp
src/PcmOutputStream.cpp
src/WaveWriter.cpp
src/AllFormats.cpp
src/MpegParser.cpp
src/Generator.cpp
src/BlockWriter.cpp
src/Loaders/HeaderlessLoader.cpp
src/Loaders/SingleBlockLoader.cpp
src/Loaders/SCxLoader.cpp
src/Loaders/AsfGstrLoader.cpp
src/Loaders/AsfPtLoader.cpp
src/Loaders/HeaderBLoader.cpp
src/Parsers/ParserForSCx.cpp
src/Parsers/ParserVersion6.cpp
src/Writers/HeaderlessWriter.cpp
src/Writers/SingleBlockWriter.cpp
src/Writers/HeaderBWriter.cpp
)
add_executable (ealayer3 ${SOURCE_FILES})
target_link_libraries (ealayer3 ${MPG123_LIBRARIES})
# Add support for tests
file (GLOB FILES_TO_TEST files/*)
set (TEST_SOURCE_FILES ${SOURCE_FILES} src/TestDriver.cpp)
list (REMOVE_ITEM TEST_SOURCE_FILES src/Main.cpp)
add_executable (ealayer3testdriver ${TEST_SOURCE_FILES})
target_link_libraries (ealayer3testdriver ${MPG123_LIBRARIES})
foreach (TEST_FILE ${FILES_TO_TEST})
get_filename_component (TEST_NAME ${TEST_FILE} NAME)
add_test (${TEST_NAME} ealayer3testdriver ${TEST_FILE})
endforeach (TEST_FILE)
# Install targets
if (WIN32)
install (TARGETS ealayer3 DESTINATION .)
install (FILES "${PROJECT_SOURCE_DIR}/license.txt" DESTINATION .)
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/libmpg123.dll" DESTINATION .)
install (FILES "${PROJECT_SOURCE_DIR}/mpg123license.txt" DESTINATION .)
else (WIN32)
include (InstallRequiredSystemLibraries)
install (TARGETS ealayer3 DESTINATION bin)
endif (WIN32)
# CPack
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/license.txt")
set (CPACK_PACKAGE_VERSION_MAJOR "${ealayer3_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${ealayer3_VERSION_MINOR}")
set (CPACK_PACKAGE_VERSION_PATCH "${ealayer3_VERSION_PATCH}")
set (CPACK_GENERATOR "ZIP")
include (CPack)