13 set (build_type STATIC) |
13 set (build_type STATIC) |
14 |
14 |
15 #visualstudio and windows in general don't like static linking, so we're building the library in shared mode |
15 #visualstudio and windows in general don't like static linking, so we're building the library in shared mode |
16 if(WIN32) |
16 if(WIN32) |
17 #workaround for visualstudio (wants headers in the source list) |
17 #workaround for visualstudio (wants headers in the source list) |
18 set(openal_src *.h ${openal_src}) |
18 set(openal_src *.h ${openal_src}) |
19 #deps for the shared library |
19 #deps for the shared library |
20 link_libraries(${VORBISFILE_LIBRARY}) |
20 link_libraries(${VORBISFILE_LIBRARY}) |
21 link_libraries(${VORBIS_LIBRARY}) |
21 link_libraries(${VORBIS_LIBRARY}) |
22 link_libraries(${OGG_LIBRARY}) |
22 link_libraries(${OGG_LIBRARY}) |
23 link_libraries(${OPENAL_LIBRARY}) |
23 link_libraries(${OPENAL_LIBRARY}) |
24 #build a shared library |
24 #build a shared library |
25 set (build_type SHARED) |
25 set (build_type SHARED) |
26 endif() |
26 endif() |
27 |
27 |
28 #compiles and links actual library |
28 #compiles and links actual library |
29 add_library (openalbridge ${build_type} ${openal_src}) |
29 add_library (openalbridge ${build_type} ${openal_src}) |
30 |
30 |
31 if(WIN32) |
31 if(WIN32) |
32 if(MSVC) |
32 if(MSVC) |
33 SET_TARGET_PROPERTIES(openalbridge PROPERTIES LINK_FLAGS /DEF:openalbridge.def) |
33 set_target_properties(openalbridge PROPERTIES LINK_FLAGS /DEF:openalbridge.def) |
34 endif(MSVC) |
34 endif(MSVC) |
35 #install it in the executable directory |
35 #install it in the executable directory |
36 install(TARGETS openalbridge DESTINATION bin) |
36 install(TARGETS openalbridge DESTINATION bin) |
37 endif(WIN32) |
37 endif(WIN32) |
38 |
38 |
39 #type make openalbridge_test to get a small executable test |
39 #type make openalbridge_test to get a small executable test |
40 add_executable(openalbridge_test "${CMAKE_SOURCE_DIR}/misc/libopenalbridge/tester.c") |
40 add_executable(openalbridge_test "${CMAKE_SOURCE_DIR}/misc/libopenalbridge/tester.c") |
41 target_link_libraries(openalbridge_test openalbridge ${OPENAL_LIBRARY} ${OGGVORBIS_LIBRARIES}) |
41 target_link_libraries(openalbridge_test openalbridge ${OPENAL_LIBRARY} ${OGGVORBIS_LIBRARIES}) |