author | smxx |
Fri, 26 Mar 2010 12:16:12 +0000 | |
changeset 3074 | 271cfcb2bcda |
parent 2529 | 51e5df1c8462 |
permissions | -rw-r--r-- |
2191 | 1 |
find_package(OpenAL REQUIRED) |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
2 |
find_package(OggVorbis REQUIRED) |
2191 | 3 |
include_directories(${OPENAL_INCLUDE_DIR}) |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
4 |
include_directories(${OGGVORBIS_INCLUDE_DIRS}) |
2191 | 5 |
|
2203
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
6 |
#set destination directory for library |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
7 |
set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH}) |
2203
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
8 |
|
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
9 |
#list of source files for libraries |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
10 |
set(openal_src |
2529 | 11 |
openalbridge.c loaders.c wrappers.c errlib.c |
2191 | 12 |
) |
13 |
||
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
14 |
#build a static library for human systems |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
15 |
set (build_type STATIC) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
16 |
|
2230
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2216
diff
changeset
|
17 |
#visualstudio and windows in general doesn't like static linking, so we're building the library in shared mode |
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2216
diff
changeset
|
18 |
if(WIN32) |
2203
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
19 |
#workaround for visualstudio (wants headers in the source list) |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
20 |
set(openal_src |
2529 | 21 |
openalbridge.h loaders.h wrappers.h globals.h oggvorbis.h errlib.h ${openal_src} |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
22 |
) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
23 |
#deps for the shared library |
2350 | 24 |
link_libraries(${VORBISFILE_LIBRARY}) |
25 |
link_libraries(${VORBIS_LIBRARY}) |
|
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
26 |
link_libraries(${OGG_LIBRARY}) |
2350 | 27 |
link_libraries(${OPENAL_LIBRARY}) |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
28 |
#build a shared library |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
29 |
set (build_type SHARED) |
2230
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2216
diff
changeset
|
30 |
endif() |
2191 | 31 |
|
2203
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
32 |
#compiles and links actual library |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
33 |
add_library (openalbridge ${build_type} ${openal_src}) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
34 |
|
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
35 |
if(WIN32) |
2231 | 36 |
if(MSVC) |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
37 |
SET_TARGET_PROPERTIES(openalbridge PROPERTIES LINK_FLAGS /DEF:openalbridge.def) |
2231 | 38 |
endif(MSVC) |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
39 |
#install it in the executable directory |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
40 |
install(TARGETS openalbridge DESTINATION bin) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
41 |
endif(WIN32) |