openalbridge/CMakeLists.txt
author smxx
Wed, 10 Feb 2010 00:55:40 +0000
changeset 2786 85f6425a4d74
parent 2529 51e5df1c8462
permissions -rw-r--r--
Engine: * Added LUA scripting support for trainings (and maybe soon) scenarios/missions * Converted Shotgun and Bazooka Training to LUA * New dependency: LUA 5.1 * New Mission Objectives window * Extended default keybinds for non-iPhone builds * NOTE: Script function names etc. might change soon so don't work too hard on your own missions (for now)! This is experimental! Frontend: * Added support for new training maps/LUA scripts

find_package(OpenAL REQUIRED)
find_package(OggVorbis REQUIRED)
include_directories(${OPENAL_INCLUDE_DIR})
include_directories(${OGGVORBIS_INCLUDE_DIRS})

#set destination directory for library
set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})

#list of source files for libraries
set(openal_src
	openalbridge.c loaders.c wrappers.c errlib.c
)

#build a static library for human systems
set (build_type STATIC)

#visualstudio and windows in general doesn't like static linking, so we're building the library in shared mode
if(WIN32)
#workaround for visualstudio (wants headers in the source list)
	set(openal_src
		openalbridge.h loaders.h wrappers.h globals.h oggvorbis.h errlib.h ${openal_src}
	)
#deps for the shared library
	link_libraries(${VORBISFILE_LIBRARY})
	link_libraries(${VORBIS_LIBRARY})
	link_libraries(${OGG_LIBRARY})
	link_libraries(${OPENAL_LIBRARY})
#build a shared library
	set (build_type SHARED)
endif()

#compiles and links actual library
add_library (openalbridge ${build_type} ${openal_src})

if(WIN32)
if(MSVC)
	SET_TARGET_PROPERTIES(openalbridge PROPERTIES LINK_FLAGS /DEF:openalbridge.def)
endif(MSVC)
#install it in the executable directory
	install(TARGETS openalbridge DESTINATION bin)
endif(WIN32)