[vlmc-devel] commit: cmake: add the icon into the resources (mingw only) ( Ludovic Fauvet )
git at videolan.org
git at videolan.org
Fri Apr 16 15:55:50 CEST 2010
vlmc | branch: master | Ludovic Fauvet <etix at l0cal.com> | Fri Apr 16 15:39:29 2010 +0200| [6f0c878501a9d8991e56da19d52b309d63e5ceb9] | committer: Ludovic Fauvet
cmake: add the icon into the resources (mingw only)
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=6f0c878501a9d8991e56da19d52b309d63e5ceb9
---
cmake/icon.rc | 1 +
cmake/toolchain-win32.cmake | 2 ++
src/CMakeLists.txt | 9 +++++++++
3 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/cmake/icon.rc b/cmake/icon.rc
new file mode 100644
index 0000000..07a2921
--- /dev/null
+++ b/cmake/icon.rc
@@ -0,0 +1 @@
+IDI_ICON1 ICON DISCARDABLE "share/vlmc.ico"
diff --git a/cmake/toolchain-win32.cmake b/cmake/toolchain-win32.cmake
index 0242631..e14e374 100644
--- a/cmake/toolchain-win32.cmake
+++ b/cmake/toolchain-win32.cmake
@@ -11,6 +11,8 @@ SET(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
SET(CMAKE_C_COMPILER i486-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i486-mingw32-g++)
+SET(CMAKE_WINDRES i486-mingw32-windres)
+
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/contribs)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9e387f2..aa53c07 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -274,6 +274,15 @@ ELSE(NOT WITH_GUI)
QT4_ADD_RESOURCES(VLMC_RCC_SRCS ${VLMC_RCC})
QT4_WRAP_CPP(VLMC_MOC_SRCS ${VLMC_HDRS})
+ IF(MINGW)
+ # resource compilation for MinGW
+ ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
+ COMMAND ${CMAKE_WINDRES} -I${CMAKE_SOURCE_DIR} -i${CMAKE_SOURCE_DIR}/cmake/icon.rc
+ -o ${CMAKE_CURRENT_BINARY_DIR}/icon.o )
+ SET(VLMC_SRCS ${VLMC_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
+ SET(LINK_FLAGS -Wl,-subsystem,windows)
+ ENDIF(MINGW)
+
IF(WIN32)
SET( GUI_TYPE WIN32 )
ENDIF( WIN32 )
More information about the Vlmc-devel
mailing list