[vlmc-devel] commit: Win32 compilation (Jean-Baptiste Kempf )

git at videolan.org git at videolan.org
Mon Sep 6 18:23:57 CEST 2010


vlmc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Sep  6 16:58:14 2010 +0200| [ed075a2ac195b287c3a891173bbbc00633684ac3] | committer: Hugo Beauzée-Luyssen 

Win32 compilation

Signed-off-by: Hugo Beauzée-Luyssen <beauze.h at gmail.com>

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=ed075a2ac195b287c3a891173bbbc00633684ac3
---

 CMakeLists.txt              |   24 ++++++++++++++++++++----
 cmake/FindLIBVLC.cmake      |    8 +++++---
 cmake/toolchain-win32.cmake |   11 ++++++-----
 3 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 569cf6f..554e1c8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,12 +87,27 @@ INCLUDE_DIRECTORIES(${FREI0R_INCLUDE_DIR})
 
 # search for Qt4
 IF (WITH_GUI)
-    FIND_PACKAGE (Qt4 4.5.1 COMPONENTS QtCore QtGui QtNetwork QtXml REQUIRED)
+    IF(WIN32)
+        #FindQt4.cmake is so brain-dead when Xcompiling
+        SET(QT_LIBRARY_DIR "/usr/win32/lib")
+        SET(QT_INCLUDE_DIR "/usr/win32/include/qt4")
+        ADD_DEFINITIONS( -I/usr/win32/include/qt4/QtCore)
+        ADD_DEFINITIONS( -I/usr/win32/include/qt4/QtGui)
+        ADD_DEFINITIONS( -I/usr/win32/include/qt4/QtXml)
+        ADD_DEFINITIONS( -I/usr/win32/include/qt4/QtNetwork)
+        ADD_DEFINITIONS( -I/usr/win32/include/qt4/)
+        ADD_DEFINITIONS( -DQT_NO_OPENSSL)
+        FIND_PACKAGE(Qt4 4.5.1 COMPONENTS QtCore QtXml QtGui QtNetwork REQUIRED )
+    ELSE(WIN32)
+        FIND_PACKAGE(Qt4 4.5.1 COMPONENTS QtCore QtXml QtGui QtNetwork REQUIRED )
+    ENDIF(WIN32)
 ELSE(WITH_GUI)
     FIND_PACKAGE (Qt4 4.5.1 COMPONENTS QtCore QtNetwork QtXml REQUIRED)
 ENDIF(WITH_GUI)
 
-SET (VLMC_LIBS ${QT_QTCORE_LIBRARY}
+IF (NOT WIN32)
+    #FindQt4.cmake is so brain-dead when Xcompiling
+    SET (VLMC_LIBS ${QT_QTCORE_LIBRARY}
           ${QT_QTGUI_LIBRARY}
           ${QT_QTNETWORK_LIBRARY}
           ${QT_QTSVG_LIBRARY}
@@ -100,8 +115,9 @@ SET (VLMC_LIBS ${QT_QTCORE_LIBRARY}
           ${LIBVLC_LIBRARY}
           ${LIBVLCCORE_LIBRARY})
 
-INCLUDE(${QT_USE_FILE})
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+    INCLUDE(${QT_USE_FILE})
+    ADD_DEFINITIONS(${QT_DEFINITIONS})
+ENDIF(NOT WIN32)
 
 # layout of VLMC installation
 # (default values are platform-specific)
diff --git a/cmake/FindLIBVLC.cmake b/cmake/FindLIBVLC.cmake
index 29a9660..609fda4 100644
--- a/cmake/FindLIBVLC.cmake
+++ b/cmake/FindLIBVLC.cmake
@@ -20,15 +20,17 @@
 FIND_PATH(LIBVLC_INCLUDE_DIR vlc/vlc.h
   HINTS "$ENV{LIBVLC_INCLUDE_PATH}"
   PATHS
+    #Mac OS and Contribs
+    "${CMAKE_CURRENT_SOURCE_DIR}/contribs/include"
+    "${CMAKE_CURRENT_SOURCE_DIR}/contribs/include/vlc"
+    # Env
     "$ENV{LIB_DIR}/include"
     "$ENV{LIB_DIR}/include/vlc"
+    #
     "/usr/include"
     "/usr/include/vlc"
     "/usr/local/include"
     "/usr/local/include/vlc"
-    #Mac OS
-    "${CMAKE_CURRENT_SOURCE_DIR}/contribs/include"
-    "${CMAKE_CURRENT_SOURCE_DIR}/contribs/include/vlc"
     #mingw
     c:/msys/local/include
   )
diff --git a/cmake/toolchain-win32.cmake b/cmake/toolchain-win32.cmake
index e14e374..bc7fe61 100644
--- a/cmake/toolchain-win32.cmake
+++ b/cmake/toolchain-win32.cmake
@@ -9,9 +9,9 @@ SET(CMAKE_SYSTEM_NAME Windows)
 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)
+SET(CMAKE_C_COMPILER   i586-mingw32msvc-gcc)
+SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
+SET(CMAKE_WINDRES      i586-mingw32msvc-windres)
 
 
 # where is the target environment 
@@ -20,5 +20,6 @@ SET(CMAKE_FIND_ROOT_PATH  ${CMAKE_SOURCE_DIR}/contribs)
 # search for programs in the build host directories
 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 # for libraries and headers in the target directories
-SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ALWAYS)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ALWAYS)
+SET(CMAKE_INCLUDE_PATH ${CMAKE_SOURCE_DIR}/contribs/include)



More information about the Vlmc-devel mailing list