Descriptions for some of curve operators
[blender.git] / CMakeLists.txt
index 0f84d61361f61ff6255429b20014d03bab39c2c6..b2243e6bd747a3493644d6a516292228a569417d 100644 (file)
@@ -67,12 +67,12 @@ include(build_files/cmake/macros.cmake)
 get_blender_version()
 
 # Blender internal features
-option(WITH_INTERNATIONAL "Enable I18N   (International fonts and text)" ON)
-option(WITH_PYTHON        "Enable Embedded Python API" ON)
-option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency)." OFF)
-option(WITH_PYTHON_MODULE "Enable building as a python module (experemental)" OFF)
-option(WITH_BUILDINFO     "Include extra build details" ON)
-option(WITH_IK_ITASC      "Enable ITASC IK solver" ON)
+option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
+option(WITH_PYTHON        "Enable Embedded Python API  (only disable for development)" ON)
+option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
+option(WITH_PYTHON_MODULE "Enable building as a python module (experemental, only enable for development)" OFF)
+option(WITH_BUILDINFO     "Include extra build details (only disable for development & faster builds)" ON)
+option(WITH_IK_ITASC      "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
 option(WITH_FFTW3         "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
 option(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
 option(WITH_GAMEENGINE    "Enable Game Engine" ON)
@@ -84,6 +84,10 @@ else()
        option(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" OFF)
 endif()
 
+if(UNIX AND NOT APPLE)
+       option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support)"     ON)
+endif()
+
 # Modifiers
 option(WITH_MOD_FLUID          "Enable Elbeem Modifier (Fluid Simulation)" ON)
 option(WITH_MOD_DECIMATE               "Enable Decimate Modifier" ON)
@@ -107,11 +111,7 @@ endif()
 
 # 3D format support
 # disable opencollada on non-apple unix because opencollada has no package for debian
-if(UNIX AND NOT APPLE)
-       option(WITH_OPENCOLLADA         "Enable OpenCollada Support (http://www.opencollada.org)"       OFF)
-else()
-       option(WITH_OPENCOLLADA         "Enable OpenCollada Support (http://www.opencollada.org)"       OFF)
-endif()
+option(WITH_OPENCOLLADA                "Enable OpenCollada Support (http://www.opencollada.org)"       OFF)
 
 # Sound output
 option(WITH_SDL           "Enable SDL for sound and joystick support" ON)
@@ -125,14 +125,13 @@ option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)"
 
 # Misc
 option(WITH_RAYOPTIMIZATION    "Enable use of SIMD (SSE) optimizations for the raytracer" ON) 
-option(WITH_INSTALL       "Install accompanying scripts and language files needed to run blender" ON)
 if(UNIX AND NOT APPLE)
        option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
 endif()
 option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
 
 # Debug
-option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking" OFF)
+option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
 mark_as_advanced(WITH_CXX_GUARDEDALLOC)
 
 option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
@@ -161,10 +160,6 @@ if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
        message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
 endif()
 
-if(NOT WITH_INSTALL AND WITH_PYTHON_INSTALL)
-       message("WARNING: WITH_PYTHON_INSTALL requires WITH_INSTALL")
-endif()
-
 if(NOT WITH_SAMPLERATE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK))
        message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK require WITH_SAMPLERATE")
 endif()
@@ -182,6 +177,9 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
        message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
 endif()
 
+# remove old vars
+unset(WITH_INSTALL CACHE)
+
 TEST_SSE_SUPPORT()
 
 #-----------------------------------------------------------------------------
@@ -218,6 +216,11 @@ set(CXX_WARNINGS "")
 #Platform specifics
 
 if(UNIX AND NOT APPLE)
+       
+       # needed for ubuntu 11.04
+       if(EXISTS "/usr/lib/x86_64-linux-gnu")
+               set(CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu;${CMAKE_LIBRARY_PATH}")
+       endif()
 
        if(WITH_OPENAL)
                find_package(OpenAL)
@@ -265,43 +268,19 @@ if(UNIX AND NOT APPLE)
 
 
        if(WITH_PYTHON)
-               # No way to set py31. remove for now.
+               # No way to set py32. remove for now.
                # find_package(PythonLibs)
-               # set(PYTHON_BINARY python) # not used yet
-
-               set(PYTHON /usr)
 
-               # ABI can be any of these chars in this order 'dmu', debug/pymalloc/unicode
-               # TODO, detect available ABI's, may want to make this a module and detect this better
-               if(CMAKE_BUILD_TYPE STREQUAL Debug)
-                       set(PYTHON_ABI_FLAGS "d")
-               else()
-                       set(PYTHON_ABI_FLAGS "m")
-               endif()
+               # defines...
+               
+               #  PYTHON_VERSION
+               #  PYTHON_INCLUDE_DIRS
+               #  PYTHON_LIBRARY
+               #  PYTHON_LIBPATH
+               #  PYTHON_LINKFLAGS
 
-               set(PYTHON_VERSION 3.2 CACHE STRING "")
-               mark_as_advanced(PYTHON_VERSION)
-               set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
-               mark_as_advanced(PYTHON_INCLUDE_DIRS)
-               set(PYTHON_LIBRARY "python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" 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
-               # set(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
-
-               set(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
-               mark_as_advanced(PYTHON_LINKFLAGS)
-
-               find_file(
-                       _Found_PYTHON_H
-                       Python.h
-                       ${PYTHON_INCLUDE_DIRS}
-               )
+               include(build_files/cmake/FindPythonLibsUnix.cmake)
 
-               if(NOT _Found_PYTHON_H)
-                       message(FATAL_ERROR "Python.h not found in  ${PYTHON_INCLUDE_DIRS}")
-               endif()
        endif()
 
        if(WITH_SDL)
@@ -405,7 +384,11 @@ if(UNIX AND NOT APPLE)
        mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
 
        # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
-       set(LLIBS "-lutil -lc -lm -lpthread -lstdc++ ${X11_X11_LIB} ${X11_Xinput_LIB}")
+       set(LLIBS "-lutil -lc -lm -lpthread -lstdc++ ${X11_X11_LIB}")
+
+       if(WITH_X11_XINPUT)
+               list(APPEND LLIBS ${X11_Xinput_LIB})
+       endif()
 
        if(CMAKE_SYSTEM_NAME MATCHES "Linux")
                if(NOT WITH_PYTHON_MODULE)
@@ -660,9 +643,9 @@ elseif(WIN32)
 
                # MSVC only, Mingw doesnt need
                if(CMAKE_CL_64)
-                       set(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib ")
+                       set(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib /STACK:2097152 ")
                else()
-                       set(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
+                       set(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib /STACK:2097152 ")
                endif()
 
                set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
@@ -765,6 +748,8 @@ elseif(WIN32)
                        set(PYTHON_LIBPATH ${PYTHON}/lib)
                endif()
 
+               set(PLATFORM_LINKFLAGS "--stack,2097152")
+
        endif()
 
        # used in many places so include globally, like OpenGL
@@ -1035,6 +1020,13 @@ if(WITH_OPENMP)
        mark_as_advanced(OpenMP_CXX_FLAGS)
 endif() 
 
+#-----------------------------------------------------------------------------
+# Configure Python.
+
+if(WITH_PYTHON_MODULE)
+       add_definitions(-DPy_ENABLE_SHARED)
+endif() 
+
 #-----------------------------------------------------------------------------
 # Extra compile flags
 
@@ -1060,12 +1052,16 @@ if(CMAKE_COMPILER_IS_GNUCC)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type)
-       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_STRICT_PROTOTYPES -Werror=strict-prototypes)
+       # system headers sometimes do this, disable for now, was: -Werror=strict-prototypes
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_STRICT_PROTOTYPES -Wstrict-prototypes)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)
+       # disable because it gives warnings for printf() & friends.
+       # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
 
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
@@ -1083,6 +1079,13 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
 
 endif()
 
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+       if(WITH_IK_ITASC OR WITH_MOD_FLUID)
+               message(WARNING "Using Clang as CXX compiler: disabling WITH_IK_ITASC and WITH_MOD_FLUID, these features will be missing.")
+               set(WITH_IK_ITASC OFF)
+               set(WITH_MOD_FLUID OFF)
+       endif()
+endif()
 
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")