removed WIN32 definition for msvc last commit (to get mingw working)
authorCampbell Barton <ideasman42@gmail.com>
Sat, 29 May 2010 07:31:40 +0000 (07:31 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 29 May 2010 07:31:40 +0000 (07:31 +0000)
added back definition as well as checking if some options need to be set.

CMakeLists.txt

index 2206bbdf674b1e7b8e8d33eb01448fe1bb9a8b33..f859a3cc18a439dd9da39ad42ba94ad7881d9f9f 100644 (file)
@@ -162,19 +162,23 @@ IF(UNIX AND NOT APPLE)
        FIND_PACKAGE(Freetype)
        # UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
 
-       # No way to set py31. remove for now.
-       # FIND_PACKAGE(PythonLibs)
-       SET(PYTHON /usr)
-       SET(PYTHON_VERSION 3.1)
-       SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
-       # SET(PYTHON_BINARY python) # not used yet
-       SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "")
-       SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
-  
-       # FIND_PACKAGE(PythonInterp) # not used yet
-       # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
-  
-       SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
+
+       IF(WITH_PYTHON)
+               # No way to set py31. remove for now.
+               # FIND_PACKAGE(PythonLibs)
+               SET(PYTHON /usr)
+               SET(PYTHON_VERSION 3.1)
+               SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
+               # SET(PYTHON_BINARY python) # not used yet
+               SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "")
+               SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
+       
+               # FIND_PACKAGE(PythonInterp) # not used yet
+               # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
+
+               SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
+       ENDIF(WITH_PYTHON)
+
 
        IF(WITH_SDL)
                FIND_PACKAGE(SDL)
@@ -184,23 +188,27 @@ IF(UNIX AND NOT APPLE)
                ENDIF(NOT SDL_FOUND)
        ENDIF(WITH_SDL)
 
-       SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
-       FIND_PATH(OPENEXR_INC
-               ImfXdr.h
-               PATHS
-               ${OPENEXR}/include/OpenEXR
-               /usr/local/include/OpenEXR
-               /sw/include/OpenEXR
-               /opt/local/include/OpenEXR
-               /opt/csw/include/OpenEXR
-               /opt/include/OpenEXR
-       )
-       SET(OPENEXR_LIB Half IlmImf Iex Imath)
-
-       SET(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
-       SET(FFMPEG_INC ${FFMPEG}/include)
-       SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
-       SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+       IF(WITH_OPENEXR)
+               SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
+               FIND_PATH(OPENEXR_INC
+                       ImfXdr.h
+                       PATHS
+                       ${OPENEXR}/include/OpenEXR
+                       /usr/local/include/OpenEXR
+                       /sw/include/OpenEXR
+                       /opt/local/include/OpenEXR
+                       /opt/csw/include/OpenEXR
+                       /opt/include/OpenEXR
+               )
+               SET(OPENEXR_LIB Half IlmImf Iex Imath)
+       ENDIF(WITH_OPENEXR)
+
+       IF(WITH_FFMPEG)
+               SET(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
+               SET(FFMPEG_INC ${FFMPEG}/include)
+               SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
+               SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+       ENDIF(WITH_FFMPEG)
   
        IF(WITH_FFTW3)
                SET(FFTW3 /usr)
@@ -247,6 +255,10 @@ IF(UNIX AND NOT APPLE)
        IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
                # BSD's dont use libdl.so
                SET(LLIBS "${LLIBS} -ldl")
+
+               # binreloc is linux only
+               SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
+               SET(BINRELOC_INC ${BINRELOC}/include)
        ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
 
        IF(WITH_OPENMP)
@@ -267,6 +279,7 @@ IF(UNIX AND NOT APPLE)
        INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
 ENDIF(UNIX AND NOT APPLE)
 
+
 IF(WIN32)
 
        # this file is included anyway when building under Windows with cl.exe
@@ -279,48 +292,19 @@ IF(WIN32)
                message("64 bit compiler detected.")
                SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
        ENDIF(CMAKE_CL_64)
+       
+       ADD_DEFINITIONS(-DWIN32)
 
-       SET(PYTHON ${LIBDIR}/python)
-       SET(PYTHON_VERSION 3.1)
-       SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
-       # SET(PYTHON_BINARY python) # not used yet
-       SET(PYTHON_LIB python31)
-       SET(PYTHON_LIBPATH ${PYTHON}/lib)
-
-       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)
-               SET(SNDFILE_INC ${SNDFILE}/include)
-               SET(SNDFILE_LIB libsndfile-1)
-               SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
-       ENDIF(WITH_SNDFILE)
-  
        SET(ICONV ${LIBDIR}/iconv)
        SET(ICONV_INC ${ICONV}/include)
        SET(ICONV_LIB iconv)
        SET(ICONV_LIBPATH ${ICONV}/lib)
 
-       SET(QUICKTIME ${LIBDIR}/QTDevWin)
-       SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
-       SET(QUICKTIME_LIB qtmlClient)
-       SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
-
        SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
        SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
        SET(LIBSAMPLERATE_LIB libsamplerate)
        SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
 
-       SET(SDL ${LIBDIR}/sdl)
-       SET(SDL_INCLUDE_DIR ${SDL}/include)
-       SET(SDL_LIBRARY SDL)
-       SET(SDL_LIBPATH ${SDL}/lib)
-
        SET(PNG "${LIBDIR}/png")
        SET(PNG_INC "${PNG}/include")
        SET(PNG_LIBPATH ${PNG}/lib)
@@ -331,6 +315,43 @@ IF(WIN32)
 
        SET(WINTAB_INC ${LIBDIR}/wintab/include) 
 
+       IF(WITH_PYTHON)
+               SET(PYTHON ${LIBDIR}/python)
+               SET(PYTHON_VERSION 3.1)
+               SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
+               # SET(PYTHON_BINARY python) # not used yet
+               SET(PYTHON_LIB python31)
+               SET(PYTHON_LIBPATH ${PYTHON}/lib)
+       ENDIF(WITH_PYTHON)
+
+       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)
+               SET(SNDFILE_INC ${SNDFILE}/include)
+               SET(SNDFILE_LIB libsndfile-1)
+               SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
+       ENDIF(WITH_SNDFILE)
+
+       IF(WITH_SDL)
+               SET(SDL ${LIBDIR}/sdl)
+               SET(SDL_INCLUDE_DIR ${SDL}/include)
+               SET(SDL_LIBRARY SDL)
+               SET(SDL_LIBPATH ${SDL}/lib)
+       ENDIF(WITH_SDL)
+
+       IF(WITH_QUICKTIME)
+               SET(QUICKTIME ${LIBDIR}/QTDevWin)
+               SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
+               SET(QUICKTIME_LIB qtmlClient)
+               SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
+       ENDIF(WITH_QUICKTIME)
+
        IF(MSVC)
                IF(CMAKE_CL_64)
                        SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
@@ -467,7 +488,7 @@ IF(WIN32)
                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)
+               ADD_DEFINITIONS(-DFREE_WINDOWS)
                
                IF(WITH_OPENMP)
                        SET(LLIBS "${LLIBS} -lgomp")
@@ -549,6 +570,7 @@ IF(WIN32)
 
 ENDIF(WIN32)
 
+
 IF(APPLE)
        IF(WITH_LIBS10.5)
                SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
@@ -727,11 +749,6 @@ IF(APPLE)
 
 ENDIF(APPLE)
 
-IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-       SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
-       SET(BINRELOC_INC ${BINRELOC}/include)
-ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-
 
 # buildinfo
 IF(WITH_BUILDINFO)