From 0cf02d0dfb3a65f45b284c0026e6c0985c72b40c Mon Sep 17 00:00:00 2001 From: Ludovic Fauvet Date: Tue, 12 Jan 2010 00:58:12 +0100 Subject: [PATCH] Cross compiling for Windows works ! --- .gitignore | 5 +++-- CMakeLists.txt | 15 +++------------ INSTALL | 2 +- INSTALL.win32 | 11 +++++++++++ cmake/toolchain-win32.cmake | 17 +++++++++++++++++ 5 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 INSTALL.win32 create mode 100644 cmake/toolchain-win32.cmake diff --git a/.gitignore b/.gitignore index bf9448213..bb05a7b84 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ Makefile* *.pro.user moc_*.cpp +moc_*.cxx* ui_*.h .*.swp *~ @@ -16,5 +17,5 @@ ui_*.h qrc_ressources.cpp CMakeCache.txt CMakeFiles -*.cmake - +cmake_install.cmake +CPack*.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 15f263d29..0f7854b92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,18 +33,9 @@ FIND_PACKAGE(LIBVLC) INCLUDE_DIRECTORIES(${LIBVLC_INCLUDE_DIR}) # search for Qt4 -FIND_PACKAGE(Qt4 REQUIRED) - -SET( QT_USE_QTXML TRUE ) -SET( QT_USE_QTNETWORK TRUE ) -SET( QT_USE_QTSVG TRUE ) -SET( QT_USE_QTXML TRUE ) -IF (ENABLE_TESTS) - SET( QT_USE_QTTEST TRUE ) - ENABLE_TESTING() -ENDIF (ENABLE_TESTS) - -INCLUDE( ${QT_USE_FILE} ) +FIND_PACKAGE(Qt4 4.5.1 COMPONENTS QtCore QtGui QtSvg QtXml REQUIRED ) + +INCLUDE(${QT_USE_FILE}) ADD_DEFINITIONS(${QT_DEFINITIONS}) # layout of VLMC installation diff --git a/INSTALL b/INSTALL index 46b35021a..00aa7736c 100644 --- a/INSTALL +++ b/INSTALL @@ -20,7 +20,7 @@ Building VLMC A typical way to build VLMC is: - qmake + cmake . make Running VLMC diff --git a/INSTALL.win32 b/INSTALL.win32 new file mode 100644 index 000000000..9aaad4011 --- /dev/null +++ b/INSTALL.win32 @@ -0,0 +1,11 @@ + +Cross-compilation (from Unix) +============================= + +Download contribs from: +http://vlmc.org/~etix/contribs/ + +To be continued... + +---------------------------------------------------------- +cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-win32.cmake . diff --git a/cmake/toolchain-win32.cmake b/cmake/toolchain-win32.cmake new file mode 100644 index 000000000..e37ca1d79 --- /dev/null +++ b/cmake/toolchain-win32.cmake @@ -0,0 +1,17 @@ +# this one is important +SET(CMAKE_SYSTEM_NAME Windows) +#this one not so much +SET(CMAKE_SYSTEM_VERSION 1) + +# specify the cross compiler +SET(CMAKE_C_COMPILER /usr/bin/i486-mingw32-gcc) +SET(CMAKE_CXX_COMPILER /usr/bin/i486-mingw32-g++) + +# where is the target environment +SET(CMAKE_FIND_ROOT_PATH 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) -- GitLab