Mercurial > aopp
changeset 11:9f0ed655b46c tip
Simple player added.
Doesn't work right, though. There's lots of static. Is it because I'm in a VM?
author | Eris Caffee <discordia@eldalin.com> |
---|---|
date | Tue, 31 Mar 2015 17:58:33 -0500 |
parents | d51a735106c2 |
children | |
files | CMakeLists.txt src/AODriver.cpp |
diffstat | 2 files changed, 99 insertions(+), 31 deletions(-) [+] |
line diff
1.1 --- a/CMakeLists.txt Thu Mar 26 16:17:33 2015 -0500 1.2 +++ b/CMakeLists.txt Tue Mar 31 17:58:33 2015 -0500 1.3 @@ -1,10 +1,10 @@ 1.4 cmake_minimum_required (VERSION 2.6 FATAL_ERROR) 1.5 #set (CMAKE_VERBOSE_MAKEFILE ON) 1.6 1.7 -set (App_Name "libaocpp") 1.8 -project (${App_Name}) 1.9 +set (Proj_Name "libaocpp") 1.10 +project (${Proj_Name}) 1.11 1.12 -set (App_Description "Object Oriented wrapper around libao.") 1.13 +set (Proj_Description "Object Oriented wrapper around libao.") 1.14 1.15 1.16 ################################################################################ 1.17 @@ -60,6 +60,50 @@ 1.18 1.19 1.20 ################################################################################ 1.21 + 1.22 +find_path(AO_INCLUDE_DIR ao/ao.h) 1.23 +find_library(AO_LIBRARY NAMES ao) 1.24 + 1.25 +if (AO_INCLUDE_DIR AND AO_LIBRARY) 1.26 + include_directories( 1.27 + ${AO_INCLUDE_DIR} 1.28 + ${INCLUDE_DIRECTORIES} 1.29 + ) 1.30 +else () 1.31 + message (FATAL_ERROR "AO not found") 1.32 +endif() 1.33 + 1.34 + 1.35 +find_path(VORBISFILE_INCLUDE_DIR vorbis/vorbisfile.h) 1.36 +find_library(VORBISFILE_LIBRARY NAMES vorbisfile) 1.37 + 1.38 +if (VORBISFILE_INCLUDE_DIR AND VORBISFILE_LIBRARY) 1.39 + include_directories( 1.40 + ${VORBISFILE_INCLUDE_DIR} 1.41 + ${INCLUDE_DIRECTORIES} 1.42 + ) 1.43 +else () 1.44 + message (FATAL_ERROR "VorbisFile not found") 1.45 +endif() 1.46 + 1.47 +find_library(VORBIS_LIBRARY NAMES vorbis) 1.48 +find_path(VORBISFILE_INCLUDE_DIR vorbis/vorbisfile.h) 1.49 +find_library(VORBISFILE_LIBRARY NAMES vorbisfile) 1.50 + 1.51 +if (VORBISFILE_INCLUDE_DIR AND VORBISFILE_LIBRARY AND VORBIS_LIBRARY) 1.52 + include_directories( 1.53 + ${VORBISFILE_INCLUDE_DIR} 1.54 + ${INCLUDE_DIRECTORIES} 1.55 + ) 1.56 +else () 1.57 + message (FATAL_ERROR "VorbisFile not found") 1.58 +endif() 1.59 + 1.60 +message (STATUS "VORBISFILE_INCLUDE_DIR ${VORBISFILE_INCLUDE_DIR}") 1.61 +message (STATUS "VORBISFILE_LIBRARY ${VORBISFILE_LIBRARY}") 1.62 +message (STATUS "VORBIS_LIBRARY ${VORBIS_LIBRARY}") 1.63 + 1.64 +################################################################################ 1.65 # The core project files 1.66 1.67 set (LIB_SRCS 1.68 @@ -70,6 +114,10 @@ 1.69 src/aopp.hpp 1.70 ) 1.71 1.72 +######################################## 1.73 + 1.74 +set (TEST_APP_NAME "aopp_system_info") 1.75 + 1.76 set ( AOPP_SYSTEM_INFO_SRCS 1.77 src/aopp_system_info.cpp 1.78 ) 1.79 @@ -79,7 +127,6 @@ 1.80 link_directories ( 1.81 ) 1.82 1.83 -set (TEST_APP_NAME "aopp_system_info") 1.84 1.85 # Define the executable program file we are creating. We must list all of 1.86 # the source files. 1.87 @@ -90,9 +137,55 @@ 1.88 1.89 # Although we listed the library directories above, we also need to list the 1.90 # individual libraries we will be linking against. 1.91 -target_link_libraries (${TEST_APP_NAME} 1.92 +target_link_libraries(${TEST_APP_NAME} 1.93 + ${AO_LIBRARY} 1.94 + ${TARGET_LINK_LIBRARIES} 1.95 + ) 1.96 + 1.97 + 1.98 +######################################## 1.99 + 1.100 +set (PLAYOGG_APP_NAME "playogg") 1.101 + 1.102 +set ( PLAYOGG_SRCS 1.103 +src/playogg.cpp 1.104 ) 1.105 1.106 +# The directories that contain the libraries we will be linking against. 1.107 +# This must come before the ADD_EXECUTABLE directive. 1.108 +link_directories ( 1.109 + ) 1.110 + 1.111 + 1.112 +# Define the executable program file we are creating. We must list all of 1.113 +# the source files. 1.114 +add_executable ( ${PLAYOGG_APP_NAME} 1.115 + ${PLAYOGG_SRCS} 1.116 + ${LIB_SRCS} 1.117 + ) 1.118 + 1.119 +# Although we listed the library directories above, we also need to list the 1.120 +# individual libraries we will be linking against. 1.121 +target_link_libraries(${PLAYOGG_APP_NAME} 1.122 + ${AO_LIBRARY} 1.123 + ${VORBIS_LIBRARY} 1.124 + ${VORBISFILE_LIBRARY} 1.125 + ${TARGET_LINK_LIBRARIES} 1.126 + ) 1.127 + 1.128 + 1.129 + 1.130 + 1.131 + 1.132 + 1.133 + 1.134 + 1.135 + 1.136 + 1.137 + 1.138 + 1.139 + 1.140 + 1.141 1.142 # Example to build a linux library with a test driver. 1.143 1.144 @@ -186,28 +279,3 @@ 1.145 endif () 1.146 1.147 ################################################################################ 1.148 - 1.149 -option(Option_AO_Dev "Build a libao Application." ON) 1.150 - 1.151 -if (Option_AO_Dev) 1.152 - 1.153 - find_path(AO_INCLUDE_DIR ao/ao.h) 1.154 - find_library(AO_LIBRARY NAMES ao) 1.155 - 1.156 - if (AO_INCLUDE_DIR AND AO_LIBRARY) 1.157 - include_directories( 1.158 - ${AO_INCLUDE_DIR} 1.159 - ${INCLUDE_DIRECTORIES} 1.160 - ) 1.161 - 1.162 - target_link_libraries(${TEST_APP_NAME} 1.163 - ${AO_LIBRARY} 1.164 - ${TARGET_LINK_LIBRARIES} 1.165 - ) 1.166 - else () 1.167 - message (FATAL_ERROR "AO not found") 1.168 - endif() 1.169 - 1.170 -endif () 1.171 - 1.172 -################################################################################