misc/libopenalbridge/CMakeLists.txt
changeset 3529 0e968ba12a84
parent 3514 59dbd31e9953
child 8044 796f2653f21d
child 8146 1fba650c2aa4
equal deleted inserted replaced
3516:a8c673657b79 3529:0e968ba12a84
     5 
     5 
     6 #set destination directory for library
     6 #set destination directory for library
     7 set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
     7 set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
     8 
     8 
     9 #list of source files for libraries
     9 #list of source files for libraries
    10 set(openal_src
    10 set(openal_src openalbridge.c loaders.c wrappers.c commands.c)
    11 	openalbridge.c loaders.c wrappers.c errlib.c
       
    12 )
       
    13 
    11 
    14 #build a static library for human systems
    12 #build a static library for human systems
    15 set (build_type STATIC)
    13 set (build_type STATIC)
    16 
    14 
    17 #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
    18 if(WIN32)
    16 if(WIN32)
    19 #workaround for visualstudio (wants headers in the source list)
    17 #workaround for visualstudio (wants headers in the source list)
    20 	set(openal_src
    18 	set(openal_src *.h ${openal_src})
    21 		openalbridge.h openalbridge_t.h loaders.h wrappers.h globals.h oggvorbis.h errlib.h ${openal_src}
       
    22 	)
       
    23 #deps for the shared library
    19 #deps for the shared library
    24 	link_libraries(${VORBISFILE_LIBRARY})
    20 	link_libraries(${VORBISFILE_LIBRARY})
    25 	link_libraries(${VORBIS_LIBRARY})
    21 	link_libraries(${VORBIS_LIBRARY})
    26 	link_libraries(${OGG_LIBRARY})
    22 	link_libraries(${OGG_LIBRARY})
    27 	link_libraries(${OPENAL_LIBRARY})
    23 	link_libraries(${OPENAL_LIBRARY})
    37 	SET_TARGET_PROPERTIES(openalbridge PROPERTIES LINK_FLAGS /DEF:openalbridge.def)
    33 	SET_TARGET_PROPERTIES(openalbridge PROPERTIES LINK_FLAGS /DEF:openalbridge.def)
    38 endif(MSVC)
    34 endif(MSVC)
    39 #install it in the executable directory
    35 #install it in the executable directory
    40 	install(TARGETS openalbridge DESTINATION bin)
    36 	install(TARGETS openalbridge DESTINATION bin)
    41 endif(WIN32)
    37 endif(WIN32)
       
    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