[Kde-bindings] KDE/kdebindings
Arno Rehn
kde at arnorehn.de
Mon Jun 18 20:20:20 UTC 2007
SVN commit 677281 by arnorehn:
* Update CSharpMacros.cmake to work currectly with relative paths and improved
the build-comments a bit.
CCMAIL: kde-bindings at kde.org
M +45 -16 cmake/modules/CSharpMacros.cmake
M +16 -13 csharp/qyoto/CMakeLists.txt
M +5 -0 csharp/qyoto/ChangeLog
--- trunk/KDE/kdebindings/cmake/modules/CSharpMacros.cmake #677280:677281
@@ -3,6 +3,7 @@
#
# ADD_CS_LIBRARY (<target> <source> [ALL])
# ADD_CS_EXECUTABLE (<target> <source> [ALL])
+# INSTALL_GAC (<target>)
#
# Note that the order of the arguments is important (including "ALL").
# It is recommended that you quote the arguments, especially <source>, if
@@ -14,50 +15,78 @@
# after the target was added so you don't have to care about that.
#
-MACRO(ADD_CS_LIBRARY target source)
+# ----- support macros -----
+MACRO(GET_CS_LIBRARY_TARGET_DIR)
IF (NOT LIBRARY_OUTPUT_PATH)
SET(CS_LIBRARY_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
ELSE (NOT LIBRARY_OUTPUT_PATH)
SET(CS_LIBRARY_TARGET_DIR ${LIBRARY_OUTPUT_PATH})
ENDIF (NOT LIBRARY_OUTPUT_PATH)
+ENDMACRO(GET_CS_LIBRARY_TARGET_DIR)
+
+MACRO(GET_CS_EXECUTABLE_TARGET_DIR)
+ IF (NOT EXECUTABLE_OUTPUT_PATH)
+ SET(CS_EXECUTABLE_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ ELSE (NOT EXECUTABLE_OUTPUT_PATH)
+ SET(CS_EXECUTABLE_TARGET_DIR ${EXECUTABLE_OUTPUT_PATH})
+ ENDIF (NOT EXECUTABLE_OUTPUT_PATH)
+ENDMACRO(GET_CS_EXECUTABLE_TARGET_DIR)
+
+MACRO(MAKE_PROPER_FILE_LIST source)
+ FOREACH(file ${source})
+ # first assume it's a relative path
+ FILE(GLOB globbed ${CMAKE_CURRENT_SOURCE_DIR}/${file})
+ IF(globbed)
+ FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${file} native)
+ ELSE(globbed)
+ FILE(TO_NATIVE_PATH ${file} native)
+ ENDIF(globbed)
+ SET(proper_file_list ${proper_file_list} ${native})
+ SET(native "")
+ ENDFOREACH(file)
+ENDMACRO(MAKE_PROPER_FILE_LIST)
+# ----- end support macros -----
+
+MACRO(ADD_CS_LIBRARY target source)
+ GET_CS_LIBRARY_TARGET_DIR()
SET(target_DLL "${CS_LIBRARY_TARGET_DIR}/${target}.dll")
+ MAKE_PROPER_FILE_LIST("${source}")
+ FILE(RELATIVE_PATH relative_path ${CMAKE_BINARY_DIR} ${target_DLL})
ADD_CUSTOM_COMMAND (OUTPUT ${target_DLL}
- COMMAND ${GMCS_EXECUTABLE} ${CS_FLAGS} -out:${target_DLL} -target:library ${source}
+ COMMAND ${GMCS_EXECUTABLE} ${CS_FLAGS} -out:${target_DLL} -target:library ${proper_file_list}
DEPENDS ${source}
- COMMENT "Building ${target_DLL}")
+ COMMENT "Building ${relative_path}")
ADD_CUSTOM_TARGET (${target} ${ARGV2} DEPENDS ${target_DLL})
+ SET(relative_path "")
+ SET(proper_file_list "")
SET(CS_FLAGS "")
ENDMACRO(ADD_CS_LIBRARY)
MACRO(ADD_CS_EXECUTABLE target source)
- IF (NOT EXECUTABLE_OUTPUT_PATH)
- SET(CS_EXECUTABLE_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
- ELSE (NOT EXECUTABLE_OUTPUT_PATH)
- SET(CS_EXECUTABLE_TARGET_DIR ${EXECUTABLE_OUTPUT_PATH})
- ENDIF (NOT EXECUTABLE_OUTPUT_PATH)
+ GET_CS_EXECUTABLE_TARGET_DIR()
# FIXME:
# Seems like cmake doesn't like the ".exe" ending for custom commands.
# If we call it ${target}.exe, 'make' will later complain about a missing rule.
# mono doesn't care about endings, so temporarily add ".monoexe".
SET(target_EXE "${CS_EXECUTABLE_TARGET_DIR}/${target}.monoexe")
+ MAKE_PROPER_FILE_LIST("${source}")
+ FILE(RELATIVE_PATH relative_path ${CMAKE_BINARY_DIR} ${target_EXE})
ADD_CUSTOM_COMMAND (OUTPUT "${target_EXE}"
- COMMAND ${GMCS_EXECUTABLE} ${CS_FLAGS} -out:${target_EXE} ${source}
+ COMMAND ${GMCS_EXECUTABLE} ${CS_FLAGS} -out:${target_EXE} ${proper_file_list}
DEPENDS ${source}
- COMMENT "Building ${target_EXE}")
+ COMMENT "Building ${relative_path}")
ADD_CUSTOM_TARGET ("${target}" "${ARGV2}" DEPENDS "${target_EXE}")
+ SET(relative_path "")
+ SET(proper_file_list "")
SET(CS_FLAGS "")
ENDMACRO(ADD_CS_EXECUTABLE)
MACRO(INSTALL_GAC target)
- IF (NOT LIBRARY_OUTPUT_PATH)
- SET(CS_LIBRARY_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
- ELSE (NOT LIBRARY_OUTPUT_PATH)
- SET(CS_LIBRARY_TARGET_DIR ${LIBRARY_OUTPUT_PATH})
- ENDIF (NOT LIBRARY_OUTPUT_PATH)
-
+ GET_CS_LIBRARY_TARGET_DIR()
+
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${GACUTIL_EXECUTABLE} -i ${CS_LIBRARY_TARGET_DIR}/${target}.dll)")
ENDMACRO(INSTALL_GAC target)
--- trunk/KDE/kdebindings/csharp/qyoto/CMakeLists.txt #677280:677281
@@ -6,19 +6,19 @@
SET(SRC_CPP src/qyoto.cpp
src/handlers.cpp)
-SET(SRC_CS ${CMAKE_CURRENT_SOURCE_DIR}/src/SmokeInvocation.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/src/SmokeMarshallers.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/src/Qyoto.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/src/QyotoMetaData.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/src/AssemblyInfo.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/core/*.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/gui/*.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/network/*.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/sql/*.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/xml/*.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/svg/*.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/opengl/*.cs
- ${CMAKE_CURRENT_SOURCE_DIR}/qdbus/*.cs)
+SET(SRC_CS src/SmokeInvocation.cs
+ src/SmokeMarshallers.cs
+ src/Qyoto.cs
+ src/QyotoMetaData.cs
+ src/AssemblyInfo.cs
+ core/*.cs
+ gui/*.cs
+ network/*.cs
+ sql/*.cs
+ xml/*.cs
+ svg/*.cs
+ opengl/*.cs
+ qdbus/*.cs)
SET(KEYFILE ${CMAKE_CURRENT_SOURCE_DIR}/key.snk)
@@ -42,5 +42,8 @@
INSTALL(TARGETS qyoto LIBRARY DESTINATION lib)
INSTALL_GAC(qt-dotnet)
+# MAKE_PROPER_FILE_LIST("${SRC_CS2}")
+# MESSAGE(${proper_file_list})
+
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(examples)
--- trunk/KDE/kdebindings/csharp/qyoto/ChangeLog #677280:677281
@@ -1,3 +1,8 @@
+2007-06-18 Arno Rehn <arno at arnorehn.de>
+
+ * Update CSharpMacros.cmake to work currectly with relative paths and improved
+ the build-comments a bit.
+
2007-06-18 Richard Dale <rdale at foton.es>
* Removed the various commented out QAbstractItemModel methods as they
More information about the Kde-bindings
mailing list