WITH_SAMPLERATE option for cmake, without this playback wont behave right so this...
[blender-staging.git] / CMakeLists.txt
index b50d49d80111e0814cb0e2c379c624f2b1a26883..6a4e063d1ea2b42042bf81dce3e7b9ea9793feca 100644 (file)
@@ -112,6 +112,7 @@ ENDIF()
 OPTION(WITH_SDL           "Enable SDL for sound and joystick support" ON)
 OPTION(WITH_OPENAL        "Enable OpenAL Support (http://www.openal.org)" ON)
 OPTION(WITH_JACK          "Enable Jack Support (http://www.jackaudio.org)" OFF)
+OPTION(WITH_SAMPLERATE    "Enable samplerate conversion" ON)
 
 # Compression
 OPTION(WITH_LZO           "Enable fast LZO compression (used for pointcache)" ON)
@@ -279,10 +280,12 @@ IF(UNIX AND NOT APPLE)
                SET(FFTW3_LIBPATH ${FFTW3}/lib)
        ENDIF(WITH_FFTW3)
 
-       SET(LIBSAMPLERATE /usr)
-       SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
-       SET(LIBSAMPLERATE_LIB samplerate)
-       SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
+       IF(WITH_SAMPLERATE)
+               SET(LIBSAMPLERATE /usr)
+               SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
+               SET(LIBSAMPLERATE_LIB samplerate)
+               SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
+       ENDIF(WITH_SAMPLERATE)
 
        IF (WITH_OPENCOLLADA)
                SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
@@ -375,10 +378,12 @@ ELSEIF(WIN32)
                SET(ICONV_LIBPATH ${ICONV}/lib)
        ENDIF(WITH_INTERNATIONAL)
 
-       SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
-       SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
-       SET(LIBSAMPLERATE_LIB libsamplerate)
-       SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
+       IF(WITH_SAMPLERATE)
+               SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
+               SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
+               SET(LIBSAMPLERATE_LIB libsamplerate)
+               SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
+       ENDIF(WITH_SAMPLERATE)
 
        SET(PNG "${LIBDIR}/png")
        SET(PNG_INC "${PNG}/include")
@@ -776,10 +781,12 @@ ELSEIF(APPLE)
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
        ENDIF(WITH_FFMPEG)
 
-       SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
-       SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
-       SET(LIBSAMPLERATE_LIB samplerate)
-       SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
+       IF(WITH_SAMPLERATE)
+               SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
+               SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
+               SET(LIBSAMPLERATE_LIB samplerate)
+               SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
+       ENDIF(WITH_SAMPLERATE)
 
        SET(LLIBS stdc++ SystemStubs)