[#21842] Beta patch to restore cmake MinGW compilation
authorCampbell Barton <ideasman42@gmail.com>
Fri, 28 May 2010 21:25:23 +0000 (21:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 28 May 2010 21:25:23 +0000 (21:25 +0000)
from Riakiotakis Antonis (psy-fi)

with modifications.

notes:
- needed to remove quotes around filepaths for copying.
- WITH_JACK, doesnt link
- WITH_FFMPEG, doesnt build
- WITH_RAYOPTIMIZATION, gave an error for me. (no mmx support)

CMakeLists.txt
source/blender/windowmanager/intern/wm.c
source/creator/CMakeLists.txt

index 81a0f1eeaf7591c9510b453f62f2287c63461a36..2206bbdf674b1e7b8e8d33eb01448fe1bb9a8b33 100644 (file)
@@ -1,4 +1,4 @@
- # $Id$
+# $Id$
 # ***** BEGIN GPL LICENSE BLOCK *****
 #
 # This program is free software; you can redistribute it and/or
@@ -287,17 +287,12 @@ IF(WIN32)
        SET(PYTHON_LIB python31)
        SET(PYTHON_LIBPATH ${PYTHON}/lib)
 
-       SET(OPENAL ${LIBDIR}/openal)
-       SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
-       SET(OPENAL_LIBRARY wrap_oal)
-       SET(OPENAL_LIBPATH ${OPENAL}/lib)
-
-       IF(WITH_JACK)
-               SET(JACK ${LIBDIR}/jack)
-               SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
-               SET(JACK_LIB libjack)
-               SET(JACK_LIBPATH ${JACK}/lib)
-       ENDIF(WITH_JACK)
+       IF(WITH_OPENAL)
+               SET(OPENAL ${LIBDIR}/openal)
+               SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
+               SET(OPENAL_LIBRARY wrap_oal)
+               SET(OPENAL_LIBPATH ${OPENAL}/lib)
+       ENDIF(WITH_OPENAL)
 
        IF(WITH_SNDFILE)
                SET(SNDFILE ${LIBDIR}/sndfile)
@@ -305,102 +300,22 @@ IF(WIN32)
                SET(SNDFILE_LIB libsndfile-1)
                SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
        ENDIF(WITH_SNDFILE)
-
-       IF(CMAKE_CL_64)
-               SET(PNG_LIBRARIES libpng)
-       ELSE(CMAKE_CL_64)
-               SET(PNG_LIBRARIES libpng_st)
-       ENDIF(CMAKE_CL_64)
-       SET(JPEG_LIBRARY libjpeg)
-
-       SET(ZLIB ${LIBDIR}/zlib)
-       SET(ZLIB_INC ${ZLIB}/include)
-       IF(CMAKE_CL_64)
-               SET(ZLIB_LIBRARIES libz)
-       ELSE(CMAKE_CL_64)
-               SET(ZLIB_LIBRARIES zlib)
-       ENDIF(CMAKE_CL_64)
-       SET(ZLIB_LIBPATH ${ZLIB}/lib)
-  
-       SET(PTHREADS ${LIBDIR}/pthreads)
-       SET(PTHREADS_INC ${PTHREADS}/include)
-       SET(PTHREADS_LIB pthreadVC2)
-       SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
   
        SET(ICONV ${LIBDIR}/iconv)
        SET(ICONV_INC ${ICONV}/include)
        SET(ICONV_LIB iconv)
        SET(ICONV_LIBPATH ${ICONV}/lib)
-  
-       IF(WITH_FFTW3)
-               SET(FFTW3 ${LIBDIR}/fftw3)
-               SET(FFTW3_INC ${FFTW3}/include)
-               SET(FFTW3_LIB libfftw)
-               SET(FFTW3_LIBPATH ${FFTW3}/lib)
-       ENDIF(WITH_FFTW3)
-  
-       SET(GETTEXT ${LIBDIR}/gettext)
-       SET(GETTEXT_INC ${GETTEXT}/include)
-       IF(CMAKE_CL_64)
-               SET(GETTEXT_LIB gettext)
-       ELSE(CMAKE_CL_64)
-               SET(GETTEXT_LIB gnu_gettext)
-       ENDIF(CMAKE_CL_64)
-       SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
-
-       SET(FREETYPE ${LIBDIR}/freetype)
-       SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
-       SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
-       SET(FREETYPE_LIBRARY freetype2ST)
-  
-       SET(OPENEXR ${LIBDIR}/openexr)
-       SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
-       SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
-       IF (MSVC80)
-               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
-       ELSE (MSVC80)
-               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
-       ENDIF(MSVC80)
-       IF (MSVC90)
-               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
-       ENDIF(MSVC90)
 
-  
        SET(QUICKTIME ${LIBDIR}/QTDevWin)
        SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
        SET(QUICKTIME_LIB qtmlClient)
        SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
 
-       SET(FFMPEG ${LIBDIR}/ffmpeg)
-       SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
-       SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
-       SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
-
        SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
        SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
        SET(LIBSAMPLERATE_LIB libsamplerate)
        SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
 
-       IF(CMAKE_CL_64)
-               SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
-       ELSE(CMAKE_CL_64)
-               SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
-       ENDIF(CMAKE_CL_64)
-
-       SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_CXX_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_CXX_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_C_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_C_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_C_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
-
-       IF(WITH_OPENMP)
-               SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
-               SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
-       ENDIF(WITH_OPENMP)
-
        SET(SDL ${LIBDIR}/sdl)
        SET(SDL_INCLUDE_DIR ${SDL}/include)
        SET(SDL_LIBRARY SDL)
@@ -414,30 +329,224 @@ IF(WIN32)
        SET(JPEG_INC "${JPEG}/include")
        SET(JPEG_LIBPATH ${JPEG}/lib)
 
-       SET(TIFF ${LIBDIR}/tiff)
-       SET(TIFF_INCLUDE_DIR ${TIFF}/include)
-       SET(TIFF_LIBRARY libtiff)
-       SET(TIFF_LIBPATH ${TIFF}/lib)
-  
        SET(WINTAB_INC ${LIBDIR}/wintab/include) 
 
-       SET(OPENCOLLADA ${LIBDIR}/opencollada)
-       SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
-       SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
-       SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa)
-       #pcre is bundled with openCollada
-       #SET(PCRE ${LIBDIR}/pcre)
-       #SET(PCRE_LIBPATH ${PCRE}/lib)
-       SET(PCRE_LIB pcre)
-
+       IF(MSVC)
+               IF(CMAKE_CL_64)
+                       SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
+               ELSE(CMAKE_CL_64)
+                       SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
+               ENDIF(CMAKE_CL_64)
+               
+               SET(CMAKE_CXX_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305" CACHE STRING "MSVC MT C++ flags " FORCE)
+               SET(CMAKE_C_FLAGS   "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305" CACHE STRING "MSVC MT C++ flags " FORCE)
+
+               SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_CXX_FLAGS_MINSIZEREL "/O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_C_FLAGS_MINSIZEREL "/O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
+               
+               IF(WITH_OPENMP)
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
+                       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
+               ENDIF(WITH_OPENMP)
+               
+               SET(GETTEXT ${LIBDIR}/gettext)
+               SET(GETTEXT_INC ${GETTEXT}/include)
+               SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
+               IF(CMAKE_CL_64)
+                       SET(GETTEXT_LIB gettext)
+               ELSE(CMAKE_CL_64)
+                       SET(GETTEXT_LIB gnu_gettext)
+               ENDIF(CMAKE_CL_64)
+
+               IF(CMAKE_CL_64)
+                       SET(PNG_LIBRARIES libpng)
+               ELSE(CMAKE_CL_64)
+                       SET(PNG_LIBRARIES libpng_st)
+               ENDIF(CMAKE_CL_64)
+               SET(JPEG_LIBRARY libjpeg)
+
+               SET(ZLIB ${LIBDIR}/zlib)
+               SET(ZLIB_INC ${ZLIB}/include)
+               SET(ZLIB_LIBPATH ${ZLIB}/lib)
+               IF(CMAKE_CL_64)
+                       SET(ZLIB_LIBRARIES libz)
+               ELSE(CMAKE_CL_64)
+                       SET(ZLIB_LIBRARIES zlib)
+               ENDIF(CMAKE_CL_64)
+
+               SET(PTHREADS ${LIBDIR}/pthreads)
+               SET(PTHREADS_INC ${PTHREADS}/include)
+               SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
+               SET(PTHREADS_LIB pthreadVC2)
+               
+               SET(FREETYPE ${LIBDIR}/freetype)
+               SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
+               SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
+               SET(FREETYPE_LIBRARY freetype2ST)
+
+               IF(WITH_FFTW3)
+                       SET(FFTW3 ${LIBDIR}/fftw3)
+                       SET(FFTW3_LIB libfftw)
+                       SET(FFTW3_INC ${FFTW3}/include)
+                       SET(FFTW3_LIBPATH ${FFTW3}/lib)
+               ENDIF(WITH_FFTW3)
+
+               IF(WITH_OPENCOLLADA)
+                       SET(OPENCOLLADA ${LIBDIR}/opencollada)
+                       SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
+                       SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
+                       SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa)
+                       #pcre is bundled with openCollada
+                       #SET(PCRE ${LIBDIR}/pcre)
+                       #SET(PCRE_LIBPATH ${PCRE}/lib)
+                       SET(PCRE_LIB pcre)
+               ENDIF(WITH_OPENCOLLADA)
+               
+               IF(WITH_FFMPEG)
+                       SET(FFMPEG ${LIBDIR}/ffmpeg)
+                       SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
+                       SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
+                       SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+               ENDIF(WITH_FFMPEG)
+
+               IF(WITH_OPENEXR)
+                       SET(OPENEXR ${LIBDIR}/openexr)
+                       SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
+                       SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
+                       IF (MSVC80)
+                               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
+                       ELSE (MSVC80)
+                               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
+                       ENDIF(MSVC80)
+                       IF (MSVC90)
+                               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
+                       ENDIF(MSVC90)
+               ENDIF(WITH_OPENEXR)
+
+               IF(WITH_TIFF)
+                       SET(TIFF ${LIBDIR}/tiff)
+                       SET(TIFF_LIBRARY libtiff)
+                       SET(TIFF_INCLUDE_DIR ${TIFF}/include)
+                       SET(TIFF_LIBPATH ${TIFF}/lib)
+               ENDIF(WITH_TIFF)
+
+               IF(WITH_JACK)
+                       SET(JACK ${LIBDIR}/jack)
+                       SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
+                       SET(JACK_LIB libjack)
+                       SET(JACK_LIBPATH ${JACK}/lib)
+               ENDIF(WITH_JACK)
+
+               # MSVC only, Mingw doesnt need
+               IF(CMAKE_CL_64)
+                       SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
+               ELSE(CMAKE_CL_64)
+                       SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
+               ENDIF(CMAKE_CL_64)
+         
+               SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
+
+       ELSE(MSVC) # MINGW
+               SET(LLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid")
+
+               SET(CMAKE_CXX_FLAGS                "-pipe -funsigned-char -fno-strict-aliasing -mwindows" CACHE STRING "Mingw C++ flags " FORCE)
+               SET(CMAKE_C_FLAGS                  "-pipe -funsigned-char -fno-strict-aliasing" CACHE STRING "Mingw C flags " FORCE)
+
+               SET(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g" CACHE STRING "Mingw debug C++ flags " FORCE)
+               SET(CMAKE_CXX_FLAGS_RELEASE        "   -O2" CACHE STRING "Mingw release C++ flags " FORCE)
+               SET(CMAKE_CXX_FLAGS_MINSIZEREL     "   -Os" CACHE STRING "Mingw minsize release C++ flags " FORCE)
+               SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Mingw release, debug C++ flags " FORCE)
+
+               SET(CMAKE_C_FLAGS_DEBUG            "-O0 -g" CACHE STRING "Mingw debug C flags " FORCE)
+               SET(CMAKE_C_FLAGS_RELEASE          "-O2"    CACHE STRING "Mingw release C flags " FORCE)
+               SET(CMAKE_C_FLAGS_MINSIZEREL       "-Os"    CACHE STRING "Mingw minsize release C flags " FORCE)
+               SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g" CACHE STRING "Mingw release, debug C++ flags " FORCE)
+               ADD_DEFINITIONS(-DFREE_WINDOWS -DWIN32)
+               
+               IF(WITH_OPENMP)
+                       SET(LLIBS "${LLIBS} -lgomp")
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
+                       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
+               ENDIF(WITH_OPENMP)
+
+               SET(GETTEXT ${LIBDIR}/gcc/gettext)
+               SET(GETTEXT_INC ${GETTEXT}/include)
+               SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
+               SET(GETTEXT_LIB intl)
+
+               SET(JPEG_LIBRARY jpeg)
+               SET(PNG_LIBRARIES png)
+
+               SET(ZLIB ${LIBDIR}/zlib)
+               SET(ZLIB_INC ${ZLIB}/include)
+               SET(ZLIB_LIBPATH ${ZLIB}/lib)
+               SET(ZLIB_LIBRARIES z)
+
+               SET(PTHREADS ${LIBDIR}/pthreads)
+               SET(PTHREADS_INC ${PTHREADS}/include)
+               SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
+               SET(PTHREADS_LIB pthreadGC2)
+               
+               SET(FREETYPE ${LIBDIR}/gcc/freetype)
+               SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
+               SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
+               SET(FREETYPE_LIBRARY freetype)
+
+               IF(WITH_FFTW3)
+                       SET(FFTW3 ${LIBDIR}/gcc/fftw3)
+                       SET(FFTW3_LIB fftw3)
+                       SET(FFTW3_INC ${FFTW3}/include)
+                       SET(FFTW3_LIBPATH ${FFTW3}/lib)
+               ENDIF(WITH_FFTW3)
+
+               IF(WITH_OPENCOLLADA)
+                       SET(OPENCOLLADA ${LIBDIR}/gcc/opencollada)
+                       SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
+                       SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
+                       SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
+                       #pcre is bundled with openCollada
+                       #SET(PCRE ${LIBDIR}/pcre)
+                       #SET(PCRE_LIBPATH ${PCRE}/lib)
+                       SET(PCRE_LIB pcre)
+               ENDIF(WITH_OPENCOLLADA)
+               
+               IF(WITH_FFMPEG)
+                       # TODO
+                       SET(WITH_FFMPEG OFF)
+               ENDIF(WITH_FFMPEG)
+
+               IF(WITH_OPENEXR)
+                       SET(OPENEXR ${LIBDIR}/gcc/openexr)
+                       SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/OpenEXR)
+                       SET(OPENEXR_LIB Half IlmImf Iex)
+                       SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
+               ENDIF(WITH_OPENEXR)
+
+               IF(WITH_TIFF)
+                       SET(TIFF ${LIBDIR}/gcc/tiff)
+                       SET(TIFF_LIBRARY tiff)
+                       SET(TIFF_INCLUDE_DIR ${TIFF}/include)
+                       SET(TIFF_LIBPATH ${TIFF}/lib)
+               ENDIF(WITH_TIFF)
+
+               IF(WITH_JACK)
+                       SET(JACK ${LIBDIR}/jack)
+                       SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
+                       SET(JACK_LIB jack)
+                       SET(JACK_LIBPATH ${JACK}/lib)
+                       
+                       # TODO, gives linking errors, force off
+                       SET(WITH_JACK OFF)
+               ENDIF(WITH_JACK)
+
+       ENDIF(MSVC)
 
-       IF(CMAKE_CL_64)
-               SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
-       ELSE(CMAKE_CL_64)
-               SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
-       ENDIF(CMAKE_CL_64)
-  
-       SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
 ENDIF(WIN32)
 
 IF(APPLE)
index 39c5e69d9824d3db8f2d44acc8de3eb8041f7e5d..452c37dbe77011d538e8cb93cfcc400b878a90f4 100644 (file)
@@ -30,8 +30,6 @@
 
 #include "DNA_windowmanager_types.h"
 
-#include "MEM_guardedalloc.h"
-
 #include "GHOST_C-api.h"
 
 #include "BLI_blenlib.h"
@@ -53,6 +51,8 @@
 #include "wm_draw.h"
 #include "wm.h"
 
+#include "MEM_guardedalloc.h"
+
 #include "ED_screen.h"
 #include "BPY_extern.h"
 
index d170e2374a834f500fdfac1fe0a0bacdc133d337..4c0ab567290ba4239d195130ff2495dc9fc0c01e 100644 (file)
@@ -254,8 +254,6 @@ IF(WITH_INSTALL)
        ENDIF(APPLE)
 
        IF(WIN32)
-               FILE(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} WIN_SOURCE_DIR)
-    
                ADD_CUSTOM_COMMAND(TARGET blender
                        POST_BUILD
                        MAIN_DEPENDENCY blender
@@ -263,38 +261,36 @@ IF(WITH_INSTALL)
                        COMMAND if not exist \"${TARGETDIR}\\.blender\\locale\" mkdir \"${TARGETDIR}\\.blender\\locale\"
                        COMMAND if not exist \"${TARGETDIR}\\.blender\\scripts\" mkdir \"${TARGETDIR}\\.blender\\scripts\"
                        COMMAND if not exist \"${TARGETDIR}\\plugins\" mkdir \"${TARGETDIR}\\plugins\"
-                       COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\" 
-                       COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\"
-                       COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\"
-                       COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\"
-                       COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\"
-                       COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\"
+                       COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\" 
+                       COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\"
+                       COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\"
+                       COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\"
+                       COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\"
+                       COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\"
                        # TODO, copy python bundle
-                       # COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python31.zip\" \"${TARGETDIR}\\\"
+                       # COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\windows\\extra\\python31.zip\" \"${TARGETDIR}\\\"
                )
     
-               FILE(TO_NATIVE_PATH "${LIBDIR}" WIN_LIBDIR)
-    
                ADD_CUSTOM_COMMAND(TARGET blender
                        POST_BUILD
                        MAIN_DEPENDENCY blender
-                       COMMAND copy /Y \"${WIN_LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\"
-                       COMMAND copy /Y \"${WIN_LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\python31_d.zip\"
-                       COMMAND copy /Y \"${WIN_LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\"
-                       COMMAND copy /Y \"${WIN_LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\"
-                       COMMAND copy /Y \"${WIN_LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\"
-                       COMMAND copy /Y \"${WIN_LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
-                       COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
-                       COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
-                       COMMAND copy /Y \"${WIN_LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\"
-                       COMMAND copy /Y \"${WIN_LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\"
+                       COMMAND copy /Y \"${LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\"
+                       COMMAND copy /Y \"${LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\python31_d.zip\"
+                       COMMAND copy /Y \"${LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\"
+                       COMMAND copy /Y \"${LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\"
+                       COMMAND copy /Y \"${LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\"
+                       COMMAND copy /Y \"${LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
+                       COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
+                       COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
+                       COMMAND copy /Y \"${LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\"
+                       # COMMAND copy /Y \"${LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\"
                )
 
                IF(WITH_INTERNATIONAL)
                        ADD_CUSTOM_COMMAND(TARGET blender
                                POST_BUILD
                                MAIN_DEPENDENCY blender
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\"
                        )
                ENDIF(WITH_INTERNATIONAL)
 
@@ -302,16 +298,16 @@ IF(WITH_INSTALL)
                        ADD_CUSTOM_COMMAND(TARGET blender
                                POST_BUILD
                                MAIN_DEPENDENCY blender
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
                        )
                ENDIF(WITH_FFMPEG)
 
@@ -319,7 +315,7 @@ IF(WITH_INSTALL)
                        ADD_CUSTOM_COMMAND(TARGET blender
                                POST_BUILD
                                MAIN_DEPENDENCY blender
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\"
                        )
                ENDIF(WITH_SNDFILE)
 
@@ -327,7 +323,7 @@ IF(WITH_INSTALL)
                        ADD_CUSTOM_COMMAND(TARGET blender
                                POST_BUILD
                                MAIN_DEPENDENCY blender
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\"
                        )
                ENDIF(WITH_JACK)
 
@@ -335,8 +331,8 @@ IF(WITH_INSTALL)
                        ADD_CUSTOM_COMMAND(TARGET blender
                                POST_BUILD
                                MAIN_DEPENDENCY blender
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\"
+                               COMMAND copy /Y \"${LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\"
 
                        )
                ENDIF(WITH_OPENAL)