PROJECT(phonon-sharp)

IF (NOT QT4_FOUND)
	FIND_PACKAGE(Qt4 REQUIRED)
ENDIF (NOT QT4_FOUND)

IF (NOT PHONON_FOUND)
	FIND_PACKAGE(Phonon REQUIRED)
ENDIF (NOT PHONON_FOUND)

SET(SRC_CPP src/phonon.cpp src/phononhandlers.cpp)

SET(SRC_CS src/PhononBinding.cs
	src/AssemblyInfo.cs
	phonon/*.cs)

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/smoke 
	${CMAKE_CURRENT_SOURCE_DIR}/../qyoto/src ${QT_INCLUDES} ${PHONON_INCLUDES})
LINK_DIRECTORIES (${LIBRARY_OUTPUT_PATH})
ADD_LIBRARY(phonon-sharp SHARED ${SRC_CPP})
TARGET_LINK_LIBRARIES(phonon-sharp smokephonon qyoto ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${PHONON_LIBS})

CSHARP_ADD_LIBRARY(phonon "${SRC_CS}" REFERENCES qt-dotnet COMPILE_FLAGS /warn:0 /keyfile:${KEYFILE})
ADD_DEPENDENCIES(phonon qt-dotnet phonon-sharp smokephonon)

INSTALL(TARGETS phonon-sharp LIBRARY DESTINATION ${LIB_INSTALL_DIR})
INSTALL_ASSEMBLY(phonon DESTINATION ${LIB_INSTALL_DIR} PACKAGE qyoto)
