Permalink
Browse files

Fix ms cmake build

  • Loading branch information...
1 parent 996fc9d commit be590fa441fc201253ac9461961527c65fc7c881 @szekerest szekerest committed Oct 29, 2013
Showing with 4 additions and 5 deletions.
  1. +4 −5 mapscript/csharp/CMakeLists.txt
@@ -16,6 +16,7 @@ if (WIN32)
else(CMAKE_CL_64)
set(PLATFORM_TARGET /platform:x86)
endif(CMAKE_CL_64)
+ set (KEYFILE_SPEC /keyfile:${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\mapscript.snk)
endif (NOT MSVC71)
if (MSVC10)
set(PLATFORM_TARGET ${PLATFORM_TARGET} /define:CLR4)
@@ -35,14 +36,12 @@ set_target_properties(csharpmapscript PROPERTIES OUTPUT_NAME "mapscript")
SWIG_LINK_LIBRARIES(csharpmapscript ${MAPSERVER_LIBMAPSERVER})
+
ADD_CUSTOM_COMMAND(TARGET csharpmapscript
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
POST_BUILD
-if (MSVC71)
- COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /t:library /out:mapscript_csharp.dll *.cs ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\config\\AssemblyInfo.cs
-else (MSVC71)
- COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /t:library /out:mapscript_csharp.dll /keyfile:${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\mapscript.snk *.cs ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\config\\AssemblyInfo.cs
-endif (MSVC71)
+ COMMAND copy /Y ..\\..\\..\\mapscript\\csharp\\mapscript.snk
+ COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /t:library /out:mapscript_csharp.dll ${KEYFILE_SPEC} *.cs ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\config\\AssemblyInfo.cs
COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:shpdump.exe ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\examples\\shpdump.cs
COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:drawmap.exe ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\examples\\drawmap.cs
COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:shapeinfo.exe ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\examples\\shapeinfo.cs

0 comments on commit be590fa

Please sign in to comment.