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 bad6b878d5412b427c9eb89dc6c75389bd22d9f3..92c0fae57bd76d76f0b84aa8e6d3691b9de4165e 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 2b044e4df1f9217343747279221ed6245a34da97..70380a7c7080cbebcee00d8ea2d294f97bd2e591 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 a49ff629b5bd862b0ba868b19f3a6b5c08bd06c4..1ff621c6e96bba05f9c624f84995bcbdf48908b6 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 5748b7b03d9858c82bee5b95d6b1243ce1cf8bd3..74f483eab05c29ee9a12c4a9c44d8e042acbe5d7 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 44a4eb1f278006c491d9a6cc28d213a1681c51e2..dd23e854a2573a1876587b10274fe982270182df 100644 (file)
@@ -26,8 +26,8 @@
 
 set(INC
        extern
-       ${PNG_INC}
-       ${ZLIB_INC}
+       ${PNG_INCLUDE_DIR}
+       ${ZLIB_INCLUDE_DIRS}
 )
 
 set(SRC
index ec4f0d4ca6df2fa2d3f19ab8c24c0d96575caed4..486ef92f6381b1d2051648013bd6102ecaaf6960 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 5153cc5b68d2cd5e281b508cc5fa4f8ecfbd7598..77a43e5560e2a42e41f29b8b57690b519333f541 100644 (file)
@@ -27,7 +27,7 @@
 set(INC 
        .
        ../../../intern/guardedalloc
-       ${JPEG_INC}
+       ${JPEG_INCLUDE_DIR}
 )
 
 set(SRC
index 672ef0b64949d28f78453d6b430c264edd3ee733..63214f6ee11961c4fc7dbba891a28112c3fcc1f3 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 35acbe5e831c87da4e205d2ae0302d29fdf6c0cc..dc043c3a21e39533a625837ec93a4098c9da1930 100644 (file)
@@ -31,7 +31,7 @@ set(INC
        ../gpu
        ../../../intern/ghost
        ../../../intern/guardedalloc
-       ${ZLIB_INC}
+       ${ZLIB_INCLUDE_DIRS}
        ${FREETYPE_INCLUDE_DIRS}
 )
 
index e51fb35a4acb5d4f228260d51d09ae7e293247fe..4d8ac9bc4b648a3b8a1d97be64a02b291bb07cc6 100644 (file)
@@ -33,7 +33,7 @@ set(INC
        ../makesrna
        ../render/extern/include
        ../../../intern/guardedalloc
-       ${ZLIB_INC}
+       ${ZLIB_INCLUDE_DIRS}
 )
 
 set(SRC
index ddfd3a69d9ee636192eebc0d5ea6d7d260def421..1427e814b41484e2758452af33148b461c687f29 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 800a18b95e1ab7b536826cf74abe7f162accc9fe..8c18630ab7d60cc92a43fc495336de013e711017 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 c86e786ba1efd2cb7630eb7eda6a507ee77b84c8..f007305e14893add8f11fb5ab35d1a4411f4d016 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 727d228935469fe6e77e24821e0b80b6d50d8414..787c93f5b8a6c2ccd78faccfc7f2705de36fe41c 100644 (file)
@@ -33,7 +33,7 @@ set(INC
        ../render/extern/include
        ../../../intern/guardedalloc
        ../../../intern/elbeem/extern
-       ${ZLIB_INC}
+       ${ZLIB_INCLUDE_DIRS}
 )
 
 set(SRC
index ad9f9ed426c5c034c4789ae5835f51b63a973296..09a627b51d4dd2412a8e3874580d24b9ae42c6ed 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 aef2438c961cff0a9cb2032453e759907330c7d9..58d69db4a0eaed1a596133d411718302795051d8 100644 (file)
@@ -25,7 +25,7 @@ set(INC
        ../../blenkernel
        ../../../../intern/guardedalloc
        ../../../../extern/glew/include
-       ${PYTHON_INC}
+       ${PYTHON_INCLUDE_DIRS}
 )
 
 set(SRC
index dc5559a5b38b08968992a08254125e63de1785e4..3c7804ab7e3b80c75a6e92687192bcd97fc45a00 100644 (file)
@@ -33,7 +33,7 @@ set(INC
        ../../editors/include
        ../../../../intern/guardedalloc
        ../../../../intern/audaspace/intern
-       ${PYTHON_INC}
+       ${PYTHON_INCLUDE_DIRS}
 )
 
 set(SRC
index ecd7f3be12cdd325826511b8d5449d92017ea042..2be62d5a8b2294f48f084b68b60127f8b682bac9 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 c3c2b95c40e9bc820dde22f685775ef0eb998b7f..5dece44912061e7a1b0334731eb760df4d73ae5b 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 9bab870ccd574c3584bccd4efbe77a11ccfaaddc..0bd8a0dd9a3562a1093d7e7b34566eb7deb774e2 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 e72f2d53f77867cdeed703485cc4eddc44fa123a..dc137861745c4d19530b9e53b0008f797fb46d25 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 8dab5194619f08dc32cfeaf946666d569928b188..c677685de4953c7276686b7b13a91f9cf80497b9 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 b18020ab17e733d109576d3f31057a1a9a83409c..d899fc38162ad84dd88437650a9ba7cf49d826d5 100644 (file)
@@ -35,7 +35,7 @@ set(INC
        ../../../extern/glew/include
        ../../../intern/guardedalloc
        ../Expressions
-       ${PYTHON_INC}
+       ${PYTHON_INCLUDE_DIRS}
 )
 
 set(SRC