]> git.jsancho.org Git - lugaru.git/commitdiff
Added support for compiling Windows *.rc files included into the CMake scripts
authorNeal Gompa <ngompa13@gmail.com>
Wed, 12 May 2010 04:10:02 +0000 (23:10 -0500)
committerNeal Gompa <ngompa13@gmail.com>
Wed, 12 May 2010 04:10:02 +0000 (23:10 -0500)
Source/CMakeLists.txt

index 0e8e9bacbf561274a3fa8e8e130d1d004af7c84b..b0c4cabd05e392ae61350554dae42dd785b83d94 100644 (file)
@@ -111,7 +111,42 @@ if(CMAKE_HOST_APPLE)
                CarbonStdCLib.h)
 endif(CMAKE_HOST_APPLE)
 
+if(WIN32)
+  if(CMAKE_CROSSCOMPILING)\r
+    ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj\r
+                                                 COMMAND i686-pc-mingw32-windres\r
+                                                         -I${CMAKE_CURRENT_SOURCE_DIR}/res\r
+                                                         -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj\r
+                                                         -i${CMAKE_CURRENT_SOURCE_DIR}/res/lugaru.rc\r
+                                             DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/lugaru.rc\r
+                                                 )\r
+  endif(CMAKE_CROSSCOMPILING)\r
+  if(NOT CMAKE_CROSSCOMPILING)\r
+    ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj\r
+                                                 COMMAND windres\r
+                                                         -I${CMAKE_CURRENT_SOURCE_DIR}/res\r
+                                                         -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj\r
+                                                         -i${CMAKE_CURRENT_SOURCE_DIR}/res/lugaru.rc\r
+                                             DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/lugaru.rc\r
+                                                 )\r
+  endif(NOT CMAKE_CROSSCOMPILING)
+
+  set(LUGARU_H
+       ${LUGARU_H}
+       res/lugaru.h)
+endif(WIN32)
+
+if(WIN32)
+add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H} lugaru_resource.obj)
+else(WIN32)
 add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H})
+endif(WIN32)
+
 target_link_libraries(lugaru ${LUGARU_LIBS})
 
-add_definitions(-DPLATFORM_LINUX=1 -DPLATFORM_UNIX=1 -DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=<stdint.h>)
+if(WIN32)
+       add_definitions(-DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=<stdint.h>)
+else(WIN32)
+       add_definitions(-DPLATFORM_LINUX=1 -DPLATFORM_UNIX=1 -DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=<stdint.h>)
+endif(WIN32)
+