Permalink
Browse files

CMAKE CSharp: Specify platform target, compile sample apps

  • Loading branch information...
1 parent 7337f79 commit cebedd50f50b6174303561a16edde7a26ab2eec2 @szekerest szekerest committed Mar 31, 2013
Showing with 19 additions and 2 deletions.
  1. +19 −2 mapscript/csharp/CMakeLists.txt
@@ -9,6 +9,14 @@ ELSE (CSHARP_COMPILER)
MESSAGE(FATAL_ERROR "Could not find csharp compiler")
ENDIF (CSHARP_COMPILER)
+if (WIN32)
+ if (CMAKE_CL_64)
+ set(PLATFORM_TARGET /platform:anycpu)
+ else(CMAKE_CL_64)
+ set(PLATFORM_TARGET /platform:x86)
+ endif(CMAKE_CL_64)
+endif(WIN32)
+
MARK_AS_ADVANCED(CSHARP_COMPILER)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/swiginc)
@@ -23,8 +31,17 @@ SWIG_LINK_LIBRARIES(csharpmapscript ${MAPSERVER_LIBMAPSERVER})
ADD_CUSTOM_COMMAND(TARGET csharpmapscript
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
POST_BUILD
- COMMAND ${CSHARP_COMPILER} /t:library /out:mapscript_csharp.dll *.cs config\\AssemblyInfo.cs
- COMMENT "Compiling c# source files, creating mapscript_csharp.dll"
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /t:library /out:mapscript_csharp.dll *.cs config\\AssemblyInfo.cs
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:shpdump.exe examples\\shpdump.cs
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:drawmap.exe examples\\drawmap.cs
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:shapeinfo.exe examples\shapeinfo.cs
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:drawquery.exe examples\drawquery.cs
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /r:System.Drawing.dll /out:getbytes.exe examples\getbytes.cs
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:HTMLtemplate.exe examples\HTMLtemplate.cs
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:RFC24.exe examples\RFC24.cs
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /r:System.Drawing.dll /out:drawmapDirect.exe examples\drawmapDirect.cs
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /r:System.Drawing.dll /out:drawmapDirectPrint.exe examples\drawmapDirectPrint.cs
+ COMMENT "Compiling c# source files"
)
get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_csharpmapscript_REAL_NAME} LOCATION)

0 comments on commit cebedd5

Please sign in to comment.