author | koda |
Tue, 04 Dec 2012 03:25:31 +0100 | |
branch | flibqtfrontend |
changeset 8214 | 8edc37cdcfbf |
parent 8146 | 1fba650c2aa4 |
child 8330 | aaefa587e277 |
permissions | -rw-r--r-- |
3353 | 1 |
find_package(OpenAL REQUIRED) |
2 |
find_package(OggVorbis REQUIRED) |
|
3 |
include_directories(${OPENAL_INCLUDE_DIR}) |
|
4 |
include_directories(${OGGVORBIS_INCLUDE_DIRS}) |
|
5 |
||
6 |
#set destination directory for library |
|
7 |
set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH}) |
|
8 |
||
9 |
#list of source files for libraries |
|
3529 | 10 |
set(openal_src openalbridge.c loaders.c wrappers.c commands.c) |
3353 | 11 |
|
12 |
#build a static library for human systems |
|
13 |
set (build_type STATIC) |
|
14 |
||
3362
8d3b4d19ce27
in reprocessing openalbridge, a lot of code cleanup and simplification
koda
parents:
3353
diff
changeset
|
15 |
#visualstudio and windows in general don't like static linking, so we're building the library in shared mode |
3353 | 16 |
if(WIN32) |
17 |
#workaround for visualstudio (wants headers in the source list) |
|
3529 | 18 |
set(openal_src *.h ${openal_src}) |
3353 | 19 |
#deps for the shared library |
20 |
link_libraries(${VORBISFILE_LIBRARY}) |
|
21 |
link_libraries(${VORBIS_LIBRARY}) |
|
22 |
link_libraries(${OGG_LIBRARY}) |
|
23 |
link_libraries(${OPENAL_LIBRARY}) |
|
24 |
#build a shared library |
|
25 |
set (build_type SHARED) |
|
26 |
endif() |
|
27 |
||
28 |
#compiles and links actual library |
|
29 |
add_library (openalbridge ${build_type} ${openal_src}) |
|
30 |
||
31 |
if(WIN32) |
|
32 |
if(MSVC) |
|
8146 | 33 |
set_target_properties(openalbridge PROPERTIES LINK_FLAGS /DEF:openalbridge.def) |
3353 | 34 |
endif(MSVC) |
35 |
#install it in the executable directory |
|
36 |
install(TARGETS openalbridge DESTINATION bin) |
|
37 |
endif(WIN32) |
|
3529 | 38 |
|
39 |
#type make openalbridge_test to get a small executable test |
|
40 |
add_executable(openalbridge_test "${hedgewars_SOURCE_DIR}/misc/libopenalbridge/tester.c") |
|
41 |
target_link_libraries(openalbridge_test openalbridge ${OPENAL_LIBRARY} ${OGGVORBIS_LIBRARIES}) |
|
42 |