Make 'WITH_OPENAL' a configurable option. This is mostly cosmetic
authorChris Want <cwant@ualberta.ca>
Wed, 13 Dec 2006 18:31:54 +0000 (18:31 +0000)
committerChris Want <cwant@ualberta.ca>
Wed, 13 Dec 2006 18:31:54 +0000 (18:31 +0000)
because it gets set to one value or another on most platforms.
On windows, only link to DirectX if WITH_OPENAL is set to ON
(it isn't needed otherwise). This OpenAL stuff is pretty confusing!

CMakeLists.txt

index 1f5b4d308412b1456cf3284eebddaa501ba3bb59..b273cfda90401b6eff6675c8b3e5ef0db45948a6 100644 (file)
@@ -65,6 +65,7 @@ OPTION(WITH_ELBEEM            "Enable Elbeem (Fluid Simulation)"                      ON)
 OPTION(WITH_QUICKTIME          "Enable Quicktime Support"                              OFF)
 OPTION(WITH_OPENEXR            "Enable OpenEXR Support (http://www.openexr.com)"       OFF)
 OPTION(WITH_FFMPEG             "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
+OPTION(WITH_OPENAL             "Enable OpenAL Support (http://www.openal.org)" ON)
 
 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
   MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
@@ -200,7 +201,7 @@ IF(WIN32)
   SET(PYTHON_LIB python24)
   SET(PYTHON_LIBPATH ${PYTHON}/lib)
 
-  SET(WITH_OPENAL ON)
+  #SET(WITH_OPENAL ON)
   SET(OPENAL ${LIBDIR}/openal)
   SET(OPENAL_INC ${OPENAL}/include ${OPENAL}/include/AL)
   SET(OPENAL_LIB openal_static)
@@ -249,7 +250,10 @@ IF(WIN32)
   SET(FFMPEG_LIB avcodec-51 avformat-51 avutil-49)
   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
 
-  SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm dxguid)
+  SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
+  IF(WITH_OPENAL)
+    SET(LLIBS ${LLIBS} dxguid)
+  ENDIF(WITH_OPENAL)
 
   SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
   SET(CMAKE_CXX_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)