summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/csharp/CMakeLists.txt19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/csharp/CMakeLists.txt b/src/csharp/CMakeLists.txt
index 10193ab..1698bcf 100644
--- a/src/csharp/CMakeLists.txt
+++ b/src/csharp/CMakeLists.txt
@@ -11,22 +11,22 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${KOLAB_SWIG_CSHARP_SOURCE
)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${KOLAB_SWIG_CSHARP_SOURCE_FILE} PROPERTIES GENERATED 1)
-ADD_CUSTOM_TARGET(generate_CSHARP_bindings ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${KOLAB_SWIG_CSHARP_SOURCE_FILE})
# Compile CSHARP Bindings
-find_program(GMCS gmcs /usr/bin)
+find_program(GMCS NAMES gmcs HINTS /usr/bin/)
-if (GMCS_FOUND)
+if (GMCS)
add_custom_command(OUTPUT kolabformat.dll
COMMAND ${GMCS} --target:library kolabformat.cs *.cs
COMMENT "Compiling C# library"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS kolabxml charpbindings
+ DEPENDS kolabxml
VERBATIM
)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/kolabformat.dll PROPERTIES GENERATED 1)
- ADD_CUSTOM_TARGET(generate_CSHARP_bindings ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.dll)
+ #One custom target is enough, no need for one per command
+ ADD_CUSTOM_TARGET(generate_CSHARP_bindings ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.dll ${CMAKE_CURRENT_BINARY_DIR}/${KOLAB_SWIG_CSHARP_SOURCE_FILE})
if (KOLAB_CSHARP_INSTALL_DIR)
set(CSHARP_INSTALL_DIR ${KOLAB_CSHARP_INSTALL_DIR})
@@ -34,7 +34,10 @@ if (GMCS_FOUND)
set(CSHARP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/csharpbindings)
endif (KOLAB_CSHARP_INSTALL_DIR)
- install(TARGETS csharpbindings LIBRARY DESTINATION ${CSHARP_INCLUDE_DIR})
+ #there is no target "csharpbindings" so you can't install it, just install plain files.
+# install(TARGETS csharpbindings LIBRARY DESTINATION ${CSHARP_INCLUDE_DIR})
+ #not sure about the LIBRARY here, but might work
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.dll LIBRARY DESTINATION ${CSHARP_INSTALL_DIR})
-
-endif (GMCS_FOUND)
+else(GMCS)
+ message("gmcs not found, not building csharp bindings")
+endif (GMCS)