diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 113 |
1 files changed, 81 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d4489a8c76b..cf083b87bc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,6 +179,7 @@ option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON) # Misc +option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON) option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON) if(UNIX AND NOT APPLE) option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON) @@ -452,6 +453,19 @@ if(UNIX AND NOT APPLE) endif() endif() + if (WITH_INPUT_NDOF) + find_package(Spacenav) + if(NOT SPACENAV_FOUND) + set(WITH_INPUT_NDOF OFF) + endif() + + # use generic names within blenders buildsystem. + if(SPACENAV_FOUND) + set(NDOF_INCLUDE_DIRS ${SPACENAV_INCLUDE_DIRS}) + set(NDOF_LIBRARIES ${SPACENAV_LIBRARIES}) + endif() + endif() + # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++") @@ -896,28 +910,15 @@ elseif(APPLE) endif() if(WITH_PYTHON) - set(PYTHON_VERSION 3.2) - if(PYTHON_VERSION MATCHES 3.2) - # we use precompiled libraries for py 3.2 and up by default + # we use precompiled libraries for py 3.2 and up by default - # normally cached but not since we include them with blender - set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}") - # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet - set(PYTHON_LIBRARY python${PYTHON_VERSION}) - set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}") - # set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled - else() - # otherwise, use custom system framework - # *not used but maintained incase some dev wants to* - - set(PYTHON "/System/Library/Frameworks/Python.framework/Versions/" CACHE PATH) - set(PYTHON_INCLUDE_DIR "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE PATH) - # set(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION}) # not used yet - set(PYTHON_LIBRARY "" CACHE FILEPATH) - set(PYTHON_LIBPATH "${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config" CACHE PATH) - set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python" CACHE STRING) - unset(PYTHON) - endif() + # normally cached but not since we include them with blender + set(PYTHON_VERSION 3.2) + set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}") + # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet + set(PYTHON_LIBRARY python${PYTHON_VERSION}) + set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}") + # set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled # uncached vars set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}") @@ -972,7 +973,17 @@ elseif(APPLE) set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib) endif() - set(PLATFORM_LINKLIBS stdc++ SystemStubs) + find_library(SYSTEMSTUBS_LIBRARY + NAMES + SystemStubs + PATHS + ) + mark_as_advanced(SYSTEMSTUBS_LIBRARY) + if(SYSTEMSTUBS_LIBRARY) + set(PLATFORM_LINKLIBS stdc++ SystemStubs) + else() + set(PLATFORM_LINKLIBS stdc++) + endif() if(WITH_COCOA) set(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA") @@ -987,9 +998,28 @@ elseif(APPLE) elseif(WITH_CODEC_QUICKTIME) set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime") endif() + + # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED! + # ALSO SHOULD BE MOVED INTO OWN MODULE WHEN FUNCTIONAL + if(WITH_INPUT_NDOF) + # This thread it *should* work and check the framework - campbell + # http://www.cmake.org/pipermail/cmake/2005-December/007740.html + find_library(3D_CONNEXION_CLIENT_LIBRARY + NAMES 3DconnexionClient + ) + if(NOT 3D_CONNEXION_CLIENT_LIBRARY) + set(WITH_INPUT_NDOF OFF) + endif() + + if(WITH_INPUT_NDOF) + set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -weak_framework 3DconnexionClient") + endif() + endif() + else() set(PLATFORM_CFLAGS "-pipe -funsigned-char") set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime") + set(WITH_INPUT_NDOF OFF) # unsupported endif() if(WITH_OPENCOLLADA) @@ -1029,6 +1059,10 @@ elseif(APPLE) set(TIFF_LIBPATH ${TIFF}/lib) endif() + if (WITH_INPUT_NDOF) + # linker needs "-weak_framework 3DconnexionClient" + endif() + set(EXETYPE MACOSX_BUNDLE) set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g") @@ -1054,20 +1088,34 @@ if(APPLE OR WIN32) endif() endif() +# See TEST_SSE_SUPPORT() for how this is defined. + if(WITH_RAYOPTIMIZATION) if(CMAKE_COMPILER_IS_GNUCC) - if(SUPPORT_SSE_BUILD) - set(PLATFORM_CFLAGS " -msse ${PLATFORM_CFLAGS}") - add_definitions(-D__SSE__ -D__MMX__) - endif() - if(SUPPORT_SSE2_BUILD) - set(PLATFORM_CFLAGS " -msse2 ${PLATFORM_CFLAGS}") - add_definitions(-D__SSE2__) - if(NOT SUPPORT_SSE_BUILD) # dont double up - add_definitions(-D__MMX__) - endif() + set(_sse "-msse") + set(_sse2 "-msse2") + elseif(MSVC) + set(_sse "/arch:SSE") + set(_sse2 "/arch:SSE2") + else() + message(WARNING "SSE flags for this compiler not known") + set(_sse) + set(_sse2) + endif() + + if(SUPPORT_SSE_BUILD) + set(PLATFORM_CFLAGS " ${_sse} ${PLATFORM_CFLAGS}") + add_definitions(-D__SSE__ -D__MMX__) + endif() + if(SUPPORT_SSE2_BUILD) + set(PLATFORM_CFLAGS " ${_sse2} ${PLATFORM_CFLAGS}") + add_definitions(-D__SSE2__) + if(NOT SUPPORT_SSE_BUILD) # dont double up + add_definitions(-D__MMX__) endif() endif() + unset(_sse) + unset(_sse2) endif() if(WITH_IMAGE_OPENJPEG) @@ -1306,6 +1354,7 @@ if(FIRST_RUN) info_cfg_option(WITH_OPENCOLLADA) info_cfg_option(WITH_FFTW3) info_cfg_option(WITH_INTERNATIONAL) + info_cfg_option(WITH_INPUT_NDOF) info_cfg_text("Compiler Options:") info_cfg_option(WITH_BUILDINFO) |