PROJECT(soprano-sharp)

FIND_PACKAGE(Soprano REQUIRED)

IF (NOT SOPRANO_FOUND)
	FIND_PACKAGE(Soprano REQUIRED)
ENDIF (NOT SOPRANO_FOUND)

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

SET(SRC_CPP src/soprano.cpp src/sopranohandlers.cpp)

SET(SRC_CS src/AssemblyInfo.cs 
 src/Soprano.cs 
soprano/*.cs)

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/smoke 
	${CMAKE_CURRENT_SOURCE_DIR}/../qyoto/src ${QT_INCLUDES})
LINK_DIRECTORIES (${LIBRARY_OUTPUT_PATH})
ADD_LIBRARY(soprano-sharp SHARED ${SRC_CPP})
ADD_DEPENDENCIES(soprano-sharp smokesoprano)
TARGET_LINK_LIBRARIES(soprano-sharp smokesoprano qyoto ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${SOPRANO_LIBRARIES} ${SOPRANO_INDEX_LIBRARIES}
	${SOPRANO_CLIENT_LIBRARIES} ${SOPRANO_SERVER_LIBRARIES})

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

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