author | Xeli |
Sun, 21 Aug 2011 22:18:54 +0200 | |
branch | hedgeroid |
changeset 5641 | 06558ee35f51 |
parent 3529 | 0e968ba12a84 |
child 8044 | 796f2653f21d |
child 8146 | 1fba650c2aa4 |
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) |
|
33 |
SET_TARGET_PROPERTIES(openalbridge PROPERTIES LINK_FLAGS /DEF:openalbridge.def) |
|
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 |