use cmake defined names for jpeg, png, zlib and python libs, building on *nix with...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 25 Jan 2011 14:43:13 +0000 (14:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 25 Jan 2011 14:43:13 +0000 (14:43 +0000)
in the case of python this makes it easier to move to find_package(PythonLibs) when 3.x is supported.

23 files changed:
CMakeLists.txt
build_files/cmake/macros.cmake
doc/build_systems/cmake.txt
intern/audaspace/CMakeLists.txt
intern/elbeem/CMakeLists.txt
intern/smoke/CMakeLists.txt
source/blender/avi/CMakeLists.txt
source/blender/blenkernel/CMakeLists.txt
source/blender/blenlib/CMakeLists.txt
source/blender/blenloader/CMakeLists.txt
source/blender/editors/space_script/CMakeLists.txt
source/blender/editors/space_text/CMakeLists.txt
source/blender/imbuf/CMakeLists.txt
source/blender/modifiers/CMakeLists.txt
source/blender/nodes/CMakeLists.txt
source/blender/python/generic/CMakeLists.txt
source/blender/python/intern/CMakeLists.txt
source/blender/windowmanager/CMakeLists.txt
source/gameengine/CMakeLists.txt
source/gameengine/GamePlayer/common/CMakeLists.txt
source/gameengine/GamePlayer/ghost/CMakeLists.txt
source/gameengine/Physics/Bullet/CMakeLists.txt
source/gameengine/Rasterizer/CMakeLists.txt

index bad6b87..92c0fae 100644 (file)
@@ -166,9 +166,9 @@ TEST_SSE_SUPPORT()
 
 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
 # On Unix: 
-#   cmake -D PYTHON_LIB=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INC=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
+#   cmake -D PYTHON_LIBRARY=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INCLUDE_DIRS=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
 # On Macs: 
-#   cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/config -G Xcode ../blender
+#   cmake -D PYTHON_INCLUDE_DIRS=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/config -G Xcode ../blender
 #
 # When changing any of this remember to update the notes in doc/build_systems/cmake.txt
 
@@ -227,11 +227,11 @@ if(UNIX AND NOT APPLE)
                # find_package(PythonLibs)
                set(PYTHON /usr)
                set(PYTHON_VERSION 3.1)
-               set(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
-               mark_as_advanced(PYTHON_INC)
+               set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
+               mark_as_advanced(PYTHON_INCLUDE_DIRS)
                # set(PYTHON_BINARY python) # not used yet
-               set(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "")
-               mark_as_advanced(PYTHON_LIB)
+               set(PYTHON_LIBRARY python${PYTHON_VERSION} CACHE STRING "")
+               mark_as_advanced(PYTHON_LIBRARY)
                set(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
                mark_as_advanced(PYTHON_LIBPATH)
                # find_package(PythonInterp) # not used yet
@@ -246,6 +246,7 @@ if(UNIX AND NOT APPLE)
                mark_as_advanced(SDLMAIN_LIBRARY)
                mark_as_advanced(SDL_INCLUDE_DIR)
                mark_as_advanced(SDL_LIBRARY)
+               mark_as_advanced(SDL_LIBRARY_TEMP)
                # unset(SDLMAIN_LIBRARY CACHE)
                if(NOT SDL_FOUND)
                        set(WITH_SDL OFF)
@@ -411,12 +412,12 @@ elseif(WIN32)
        endif()
 
        set(PNG "${LIBDIR}/png")
-       set(PNG_INC "${PNG}/include")
-       set(PNG_LIBPATH ${PNG}/lib)
+       set(PNG_INCLUDE_DIR "${PNG}/include")
+       set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
 
        set(JPEG "${LIBDIR}/jpeg")
-       set(JPEG_INC "${JPEG}/include")
-       set(JPEG_LIBPATH ${JPEG}/lib)
+       set(JPEG_INCLUDE_DIR "${JPEG}/include")
+       set(JPEG_LIBPATH ${JPEG}/lib) # not cmake defined
 
        set(WINTAB_INC ${LIBDIR}/wintab/include) 
 
@@ -495,10 +496,10 @@ elseif(WIN32)
                else()
                        set(PNG_LIBRARIES libpng_st)
                endif()
-               set(JPEG_LIBRARY libjpeg)
+               set(JPEG_LIBRARIES libjpeg)
 
                set(ZLIB ${LIBDIR}/zlib)
-               set(ZLIB_INC ${ZLIB}/include)
+               set(ZLIB_INCLUDE_DIRS ${ZLIB}/include)
                set(ZLIB_LIBPATH ${ZLIB}/lib)
                if(CMAKE_CL_64)
                        set(ZLIB_LIBRARIES libz)
@@ -576,9 +577,9 @@ elseif(WIN32)
                if(WITH_PYTHON)
                        set(PYTHON ${LIBDIR}/python)
                        set(PYTHON_VERSION 3.1)
-                       set(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
+                       set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}")
                        # set(PYTHON_BINARY python) # not used yet
-                       set(PYTHON_LIB python31)
+                       set(PYTHON_LIBRARY python31)
                        set(PYTHON_LIBPATH ${PYTHON}/lib)
                endif()
 
@@ -613,11 +614,11 @@ elseif(WIN32)
                        set(GETTEXT_LIB intl)
                endif()
 
-               set(JPEG_LIBRARY libjpeg)
+               set(JPEG_LIBRARIES libjpeg)
                set(PNG_LIBRARIES png)
 
                set(ZLIB ${LIBDIR}/zlib)
-               set(ZLIB_INC ${ZLIB}/include)
+               set(ZLIB_INCLUDE_DIRS ${ZLIB}/include)
                set(ZLIB_LIBPATH ${ZLIB}/lib)
                set(ZLIB_LIBRARIES z)
 
@@ -683,9 +684,9 @@ elseif(WIN32)
                if(WITH_PYTHON)
                        set(PYTHON ${LIBDIR}/python)
                        set(PYTHON_VERSION 3.1)
-                       set(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
+                       set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}")
                        # set(PYTHON_BINARY python) # not used yet
-                       set(PYTHON_LIB python31mw)
+                       set(PYTHON_LIBRARY python31mw)
                        set(PYTHON_LIBPATH ${PYTHON}/lib)
                endif()
 
@@ -737,9 +738,9 @@ elseif(APPLE)
                # we use precompiled libraries for py 3.1 and up by default
 
                set(PYTHON ${LIBDIR}/python)
-               set(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
+               set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}")
                # set(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}") # not used yet
-               set(PYTHON_LIB python${PYTHON_VERSION})
+               set(PYTHON_LIBRARY python${PYTHON_VERSION})
                set(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}")
                # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
        else()
@@ -747,9 +748,9 @@ elseif(APPLE)
 
                set(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
                set(PYTHON_VERSION 3.1)
-               set(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}")
+               set(PYTHON_INCLUDE_DIRS "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}")
                # set(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION}) # not used yet
-               set(PYTHON_LIB "")
+               set(PYTHON_LIBRARY "")
                set(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config)
                set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
        endif()
@@ -769,10 +770,10 @@ elseif(APPLE)
        endif()
 
        set(PNG_LIBRARIES png)
-       set(JPEG_LIBRARY jpeg)
+       set(JPEG_LIBRARIES jpeg)
 
        set(ZLIB /usr)
-       set(ZLIB_INC "${ZLIB}/include")
+       set(ZLIB_INCLUDE_DIRS "${ZLIB}/include")
        set(ZLIB_LIBRARIES z bz2)
 
        set(FREETYPE ${LIBDIR}/freetype)
@@ -852,11 +853,11 @@ elseif(APPLE)
        endif()
 
        set(PNG "${LIBDIR}/png")
-       set(PNG_INC "${PNG}/include")
+       set(PNG_INCLUDE_DIR "${PNG}/include")
        set(PNG_LIBPATH ${PNG}/lib)
 
        set(JPEG "${LIBDIR}/jpeg")
-       set(JPEG_INC "${JPEG}/include")
+       set(JPEG_INCLUDE_DIR "${JPEG}/include")
        set(JPEG_LIBPATH ${JPEG}/lib)
 
        if(WITH_IMAGE_TIFF)
index 2b044e4..70380a7 100644 (file)
@@ -128,10 +128,10 @@ macro(setup_liblinks
                target_link_libraries(${target} ${PYTHON_LINKFLAGS})
 
                if(WIN32 AND NOT UNIX)
-                       target_link_libraries(${target} debug ${PYTHON_LIB}_d)
-                       target_link_libraries(${target} optimized ${PYTHON_LIB})
+                       target_link_libraries(${target} debug ${PYTHON_LIBRARY}_d)
+                       target_link_libraries(${target} optimized ${PYTHON_LIBRARY})
                else()
-                       target_link_libraries(${target} ${PYTHON_LIB})
+                       target_link_libraries(${target} ${PYTHON_LIBRARY})
                endif()
        endif()
 
index a49ff62..1ff621c 100644 (file)
@@ -132,9 +132,9 @@ $Id$
     The commandline can be used to override detected/default settings, e.g:
  
     On Unix: 
-      cmake -D PYTHON_LIB=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INC=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
+      cmake -D PYTHON_LIBRARY=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INCLUDE_DIRS=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
     On Macs: 
-      cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -G Xcode ../blender
+      cmake -D PYTHON_INCLUDE_DIRS=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -G Xcode ../blender
 
     Mote that this should only be needed once per build directory generation because it will keep the overrides in CMakeCache.txt for subsequent runs.
 
index 5748b7b..74f483e 100644 (file)
@@ -231,7 +231,7 @@ if(WITH_FFTW3 AND FALSE)
 endif()
 
 if(WITH_PYTHON)
-       list(APPEND INC Python ${PYTHON_INC})
+       list(APPEND INC Python ${PYTHON_INCLUDE_DIRS})
        set(PYTHONSRC
                Python/AUD_PyAPI.cpp
 
index 44a4eb1..dd23e85 100644 (file)
@@ -26,8 +26,8 @@
 
 set(INC
        extern
-       ${PNG_INC}
-       ${ZLIB_INC}
+       ${PNG_INCLUDE_DIR}
+       ${ZLIB_INCLUDE_DIRS}
 )
 
 set(SRC
index ec4f0d4..486ef92 100644 (file)
@@ -28,8 +28,8 @@ set(INC
        intern
        ../memutil
        ../../extern/bullet2/src
-       ${PNG_INC}
-       ${ZLIB_INC}
+       ${PNG_INCLUDE_DIR}
+       ${ZLIB_INCLUDE_DIRS}
 )
 
 set(SRC
index 5153cc5..77a43e5 100644 (file)
@@ -27,7 +27,7 @@
 set(INC 
        .
        ../../../intern/guardedalloc
-       ${JPEG_INC}
+       ${JPEG_INCLUDE_DIR}
 )
 
 set(SRC
index 672ef0b..63214f6 100644 (file)
@@ -49,7 +49,7 @@ set(INC
        ../../../intern/opennl/extern
        ../../../intern/smoke/extern
     ../../../source/blender/windowmanager # XXX - BAD LEVEL CALL WM_api.h
-       ${ZLIB_INC}
+       ${ZLIB_INCLUDE_DIRS}
 )
 
 set(SRC
@@ -273,7 +273,7 @@ if(WITH_LCMS)
 endif()
 
 if(WITH_PYTHON)
-       list(APPEND INC ../python ${PYTHON_INC})
+       list(APPEND INC ../python ${PYTHON_INCLUDE_DIRS})
        add_definitions(-DWITH_PYTHON)
 endif()
 
index 35acbe5..dc043c3 100644 (file)
@@ -31,7 +31,7 @@ set(INC
        ../gpu
        ../../../intern/ghost
        ../../../intern/guardedalloc
-       ${ZLIB_INC}
+       ${ZLIB_INCLUDE_DIRS}
        ${FREETYPE_INCLUDE_DIRS}
 )
 
index e51fb35..4d8ac9b 100644 (file)
@@ -33,7 +33,7 @@ set(INC
        ../makesrna
        ../render/extern/include
        ../../../intern/guardedalloc
-       ${ZLIB_INC}
+       ${ZLIB_INCLUDE_DIRS}
 )
 
 set(SRC
index ddfd3a6..1427e81 100644 (file)
@@ -39,7 +39,7 @@ set(SRC
 )
 
 if(WITH_PYTHON)
-       list(APPEND INC ${PYTHON_INC} ../../python)
+       list(APPEND INC ${PYTHON_INCLUDE_DIRS} ../../python)
        add_definitions(-DWITH_PYTHON)
 endif()
 
index 800a18b..8c18630 100644 (file)
@@ -41,7 +41,7 @@ set(SRC
 )
 
 if(WITH_PYTHON)
-       list(APPEND INC ${PYTHON_INC} ../../python)
+       list(APPEND INC ${PYTHON_INCLUDE_DIRS} ../../python)
        add_definitions(-DWITH_PYTHON)
 endif()
 
index c86e786..f007305 100644 (file)
@@ -32,9 +32,9 @@ set(INC
        ../makesdna
        ../../../intern/memutil
        ../../../intern/guardedalloc
-       ${JPEG_INC}
-       ${PNG_INC}
-       ${ZLIB_INC}
+       ${JPEG_INCLUDE_DIR}
+       ${PNG_INCLUDE_DIR}
+       ${ZLIB_INCLUDE_DIRS}
 )
 
 set(SRC
index 727d228..787c93f 100644 (file)
@@ -33,7 +33,7 @@ set(INC
        ../render/extern/include
        ../../../intern/guardedalloc
        ../../../intern/elbeem/extern
-       ${ZLIB_INC}
+       ${ZLIB_INCLUDE_DIRS}
 )
 
 set(SRC
index ad9f9ed..09a627b 100644 (file)
@@ -149,7 +149,7 @@ set(SRC
 )
 
 if(WITH_PYTHON)
-       set(INC ${INC} ../python ${PYTHON_INC})
+       set(INC ${INC} ../python ${PYTHON_INCLUDE_DIRS})
        add_definitions(-DWITH_PYTHON)
 endif()
 
index aef2438..58d69db 100644 (file)
@@ -25,7 +25,7 @@ set(INC
        ../../blenkernel
        ../../../../intern/guardedalloc
        ../../../../extern/glew/include
-       ${PYTHON_INC}
+       ${PYTHON_INCLUDE_DIRS}
 )
 
 set(SRC
index dc5559a..3c7804a 100644 (file)
@@ -33,7 +33,7 @@ set(INC
        ../../editors/include
        ../../../../intern/guardedalloc
        ../../../../intern/audaspace/intern
-       ${PYTHON_INC}
+       ${PYTHON_INCLUDE_DIRS}
 )
 
 set(SRC
index ecd7f3b..2be62d5 100644 (file)
@@ -96,7 +96,7 @@ if(WITH_CODEC_FFMPEG)
 endif()
 
 if(WITH_PYTHON)
-       list(APPEND INC ../python ${PYTHON_INC})
+       list(APPEND INC ../python ${PYTHON_INCLUDE_DIRS})
        add_definitions(-DWITH_PYTHON)
 endif()
 
index c3c2b95..5dece44 100644 (file)
@@ -27,7 +27,7 @@
 
 # there are too many inter-includes so best define here
 if(WITH_PYTHON)
-       blender_include_dirs("${PYTHON_INC}")
+       blender_include_dirs("${PYTHON_INCLUDE_DIRS}")
        add_definitions(-DWITH_PYTHON)
 endif()
 
index 9bab870..0bd8a0d 100644 (file)
@@ -52,9 +52,9 @@ set(INC
        ../../../../source/blender/blenloader
        ../../../../source/blender/gpu
        ../../../../extern/glew/include
-       ${PYTHON_INC}
-       ${PNG_INC}
-       ${ZLIB_INC}
+       ${PYTHON_INCLUDE_DIRS}
+       ${PNG_INCLUDE_DIR}
+       ${ZLIB_INCLUDE_DIRS}
 )
 
 set(SRC 
index e72f2d5..dc13786 100644 (file)
@@ -54,7 +54,7 @@ set(INC
        ../../../../source/blender/blenloader
        ../../../../source/blender/gpu
        ../../../../extern/glew/include
-       ${PYTHON_INC}
+       ${PYTHON_INCLUDE_DIRS}
 )
 
 set(SRC 
index 8dab519..c677685 100644 (file)
@@ -44,7 +44,7 @@ set(INC
        ../../../../source/blender/makesdna
        ../../../../source/blender/blenlib
        ../../../../source/blender/blenkernel
-       ${PYTHON_INC}
+       ${PYTHON_INCLUDE_DIRS}
 )
 
 set(SRC
index b18020a..d899fc3 100644 (file)
@@ -35,7 +35,7 @@ set(INC
        ../../../extern/glew/include
        ../../../intern/guardedalloc
        ../Expressions
-       ${PYTHON_INC}
+       ${PYTHON_INCLUDE_DIRS}
 )
 
 set(SRC