author | koda |
Fri, 18 Jun 2010 14:45:05 +0200 | |
changeset 3516 | a8c673657b79 |
parent 3514 | 59dbd31e9953 |
child 3529 | 0e968ba12a84 |
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 |
|
10 |
set(openal_src |
|
11 |
openalbridge.c loaders.c wrappers.c errlib.c |
|
12 |
) |
|
13 |
||
14 |
#build a static library for human systems |
|
15 |
set (build_type STATIC) |
|
16 |
||
3362
8d3b4d19ce27
in reprocessing openalbridge, a lot of code cleanup and simplification
koda
parents:
3353
diff
changeset
|
17 |
#visualstudio and windows in general don't like static linking, so we're building the library in shared mode |
3353 | 18 |
if(WIN32) |
19 |
#workaround for visualstudio (wants headers in the source list) |
|
20 |
set(openal_src |
|
3362
8d3b4d19ce27
in reprocessing openalbridge, a lot of code cleanup and simplification
koda
parents:
3353
diff
changeset
|
21 |
openalbridge.h openalbridge_t.h loaders.h wrappers.h globals.h oggvorbis.h errlib.h ${openal_src} |
3353 | 22 |
) |
23 |
#deps for the shared library |
|
24 |
link_libraries(${VORBISFILE_LIBRARY}) |
|
25 |
link_libraries(${VORBIS_LIBRARY}) |
|
26 |
link_libraries(${OGG_LIBRARY}) |
|
27 |
link_libraries(${OPENAL_LIBRARY}) |
|
28 |
#build a shared library |
|
29 |
set (build_type SHARED) |
|
30 |
endif() |
|
31 |
||
32 |
#compiles and links actual library |
|
33 |
add_library (openalbridge ${build_type} ${openal_src}) |
|
34 |
||
35 |
if(WIN32) |
|
36 |
if(MSVC) |
|
37 |
SET_TARGET_PROPERTIES(openalbridge PROPERTIES LINK_FLAGS /DEF:openalbridge.def) |
|
38 |
endif(MSVC) |
|
39 |
#install it in the executable directory |
|
40 |
install(TARGETS openalbridge DESTINATION bin) |
|
41 |
endif(WIN32) |