author | nemo |
Sun, 28 Jun 2009 18:47:55 +0000 | |
changeset 2204 | 526f8165acce |
parent 2203 | 6bd39d75e0dd |
child 2212 | 6b5da1a2765a |
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 flag configuration for build type |
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
7 |
set(CMAKE_C_FLAGS "-Wall -pipe") |
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
8 |
set(CMAKE_C_FLAGS_RELEASE "-w -O2 -fomit-frame-pointer") |
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
9 |
set(CMAKE_C_FLAGS_DEBUG "-O0 -g -DDEBUG") |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
10 |
|
2203
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
11 |
#set destination directory for library |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
12 |
set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH}) |
2203
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
13 |
|
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
14 |
#list of source files for libraries |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
15 |
set(openal_src |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
16 |
openalwrap.c loaders.c endianness.c wrappers.c |
2191 | 17 |
) |
18 |
||
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
19 |
#build a static library for human systems |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
20 |
set (build_type STATIC) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
21 |
|
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
22 |
if(WIN32) |
2203
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
23 |
#workaround for visualstudio (wants headers in the source list) |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
24 |
set(openal_src |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
25 |
openalwrap.h loaders.h endianness.h wrappers.h winstdint.h ${openal_src} |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
26 |
) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
27 |
#deps for the shared library |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
28 |
link_libraries(${OPENAL_LIBRARY}) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
29 |
link_libraries(${OGG_LIBRARY}) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
30 |
link_libraries(${VORBIS_LIBRARY}) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
31 |
link_libraries(${VORBISFILE_LIBRARY}) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
32 |
#build a shared library |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
33 |
set (build_type SHARED) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
34 |
endif(WIN32) |
2191 | 35 |
|
2203
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2200
diff
changeset
|
36 |
#compiles and links actual library |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
37 |
add_library (openalbridge ${build_type} ${openal_src}) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
38 |
|
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
39 |
if(WIN32) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
40 |
SET_TARGET_PROPERTIES(openalbridge PROPERTIES LINK_FLAGS /DEF:openalbridge.def) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
41 |
#install it in the executable directory |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
42 |
install(TARGETS openalbridge DESTINATION bin) |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2194
diff
changeset
|
43 |
endif(WIN32) |