From 02913d28b3d9cc8805537afcbe4375fa21c313f3 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 28 Sep 2010 03:01:40 +0200 Subject: RED-552: VWR-12838: NDOF is assumed to exist, even with --standalone. See http://redmine.imprudenceviewer.org/issues/552 Add FindNDOF.cmake and treat it like every other library (on standalone). --- linden/indra/cmake/FindNDOF.cmake | 39 +++++++++++++++++++++++++++++++++++++++ linden/indra/cmake/NDOF.cmake | 32 +++++++++++++++++++++++--------- 2 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 linden/indra/cmake/FindNDOF.cmake (limited to 'linden/indra/cmake') diff --git a/linden/indra/cmake/FindNDOF.cmake b/linden/indra/cmake/FindNDOF.cmake new file mode 100644 index 0000000..f980e34 --- /dev/null +++ b/linden/indra/cmake/FindNDOF.cmake @@ -0,0 +1,39 @@ +# -*- cmake -*- + +# - Find NDOF +# Find the NDOF includes and library +# This module defines +# NDOF_INCLUDE_DIR, where to find ndofdev_external.h, etc. +# NDOF_LIBRARY, the library needed to use NDOF. +# NDOF_FOUND, If false, do not try to use NDOF. + +find_path(NDOF_INCLUDE_DIR ndofdev_external.h + PATH_SUFFIXES ndofdev + ) + +set(NDOF_NAMES ${NDOF_NAMES} ndofdev libndofdev) +find_library(NDOF_LIBRARY + NAMES ${NDOF_NAMES} + ) + +if (NDOF_LIBRARY AND NDOF_INCLUDE_DIR) + set(NDOF_FOUND "YES") +else (NDOF_LIBRARY AND NDOF_INCLUDE_DIR) + set(NDOF_FOUND "NO") +endif (NDOF_LIBRARY AND NDOF_INCLUDE_DIR) + + +if (NDOF_FOUND) + if (NOT NDOF_FIND_QUIETLY) + message(STATUS "Found NDOF: Library in '${NDOF_LIBRARY}' and header in '${NDOF_INCLUDE_DIR}' ") + endif (NOT NDOF_FIND_QUIETLY) +else (NDOF_FOUND) + if (NDOF_FIND_REQUIRED) + message(FATAL_ERROR "Could not find NDOF library!") + endif (NDOF_FIND_REQUIRED) +endif (NDOF_FOUND) + +mark_as_advanced( + NDOF_LIBRARY + NDOF_INCLUDE_DIR + ) diff --git a/linden/indra/cmake/NDOF.cmake b/linden/indra/cmake/NDOF.cmake index dad74e9..bdf5db1 100644 --- a/linden/indra/cmake/NDOF.cmake +++ b/linden/indra/cmake/NDOF.cmake @@ -1,14 +1,28 @@ # -*- cmake -*- include(Prebuilt) -use_prebuilt_binary(ndofdev) +if (STANDALONE) + include(FindNDOF) + if(NOT NDOF_FOUND) + message(STATUS "Building without N-DoF joystick support") + endif(NOT NDOF_FOUND) +else (STANDALONE) + use_prebuilt_binary(ndofdev) -if (WINDOWS OR DARWIN OR LINUX) - add_definitions(-DLIB_NDOF=1) -endif (WINDOWS OR DARWIN OR LINUX) + if (WINDOWS) + set(NDOF_LIBRARY libndofdev) + elseif (DARWIN OR LINUX) + set(NDOF_LIBRARY ndofdev) + endif (WINDOWS) + + set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev) + set(NDOF_FOUND 1) +endif (STANDALONE) -if (WINDOWS) - set(NDOF_LIBRARY libndofdev) -elseif (DARWIN OR LINUX) - set(NDOF_LIBRARY ndofdev) -endif (WINDOWS) +if (NDOF_FOUND) + add_definitions(-DLIB_NDOF=1) + include_directories(${NDOF_INCLUDE_DIR}) +else (NDOF_FOUND) + set(NDOF_INCLUDE_DIR "") + set(NDOF_LIBRARY "") +endif (NDOF_FOUND) -- cgit v1.1 From e71d3ea2fad63fa2ec81685a9b09c1bed6b493be Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 28 Sep 2010 03:09:06 +0200 Subject: RED-560: Imprudence doesn't compile when configured with --standalone See http://redmine.imprudenceviewer.org/issues/560 --- linden/indra/cmake/GStreamer.cmake | 18 +++++- linden/indra/cmake/LLMedia.cmake | 1 + linden/indra/cmake/OPENAL.cmake | 123 ++++++------------------------------- 3 files changed, 35 insertions(+), 107 deletions(-) (limited to 'linden/indra/cmake') diff --git a/linden/indra/cmake/GStreamer.cmake b/linden/indra/cmake/GStreamer.cmake index f5f9c03..9c5e9f7 100644 --- a/linden/indra/cmake/GStreamer.cmake +++ b/linden/indra/cmake/GStreamer.cmake @@ -1,12 +1,22 @@ # -*- cmake -*- include(Prebuilt) - # Maybe libxml and glib should have their own .cmake files +if (STANDALONE) + include(FindPkgConfig) + + pkg_check_modules(GSTREAMER REQUIRED gstreamer-0.10) + pkg_check_modules(GSTREAMER_PLUGINS_BASE REQUIRED gstreamer-plugins-base-0.10) + pkg_check_modules(GSTREAMER_VIDEO REQUIRED gstreamer-video-0.10) + +else (STANDALONE) + + # libxml and glib should have their own .cmake files use_prebuilt_binary(libxml) use_prebuilt_binary(glib) set(GSTREAMER_FOUND ON FORCE BOOL) set(GSTREAMER_PLUGINS_BASE_FOUND ON FORCE BOOL) + set(GSTREAMER_VIDEO_FOUND ON FORCE BOOL) use_prebuilt_binary(gstreamer) use_prebuilt_binary(gstreamer-plugins) @@ -105,9 +115,11 @@ else (WINDOWS) endif (WINDOWS) -if (GSTREAMER_FOUND AND GSTREAMER_PLUGINS_BASE_FOUND) +endif (STANDALONE) + +if (GSTREAMER_FOUND AND GSTREAMER_PLUGINS_BASE_FOUND AND GSTREAMER_VIDEO_FOUND) set(GSTREAMER ON CACHE BOOL "Build with GStreamer streaming media support.") -endif (GSTREAMER_FOUND AND GSTREAMER_PLUGINS_BASE_FOUND) +endif (GSTREAMER_FOUND AND GSTREAMER_PLUGINS_BASE_FOUND AND GSTREAMER_VIDEO_FOUND) if (GSTREAMER) add_definitions(-DLL_GSTREAMER_ENABLED=1) diff --git a/linden/indra/cmake/LLMedia.cmake b/linden/indra/cmake/LLMedia.cmake index 8a36a69..e7769db 100644 --- a/linden/indra/cmake/LLMedia.cmake +++ b/linden/indra/cmake/LLMedia.cmake @@ -10,4 +10,5 @@ set(LLMEDIA_LIBRARIES llmedia ${GSTREAMER_LIBRARIES} ${GSTREAMER_PLUGINS_BASE_LIBRARIES} + ${GSTREAMER_VIDEO_LIBRARIES} ) diff --git a/linden/indra/cmake/OPENAL.cmake b/linden/indra/cmake/OPENAL.cmake index 4f0e0cc..98c7ddc 100644 --- a/linden/indra/cmake/OPENAL.cmake +++ b/linden/indra/cmake/OPENAL.cmake @@ -1,113 +1,28 @@ # -*- cmake -*- - -include(Variables) include(Linking) +include(Prebuilt) -set(OPENAL ON CACHE BOOL "Enable OpenAL") - +if (LINUX) + set(OPENAL ON CACHE BOOL "Enable OpenAL") +else (LINUX) + set(OPENAL OFF CACHE BOOL "Enable OpenAL") +endif (LINUX) if (OPENAL) - - # message(STATUS "Building with OpenAL audio support") - - # OPENAL_LIB - use_prebuilt_binary(openal) - - if (WINDOWS) - set(OPENAL_LIB - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libOpenAL32.dll.a.lib - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libOpenAL32.dll.a.lib - ) - - elseif (DARWIN) - # Look for for system's OpenAL.framework - # Nemu: This code has never looked for the system's OpenAL.framework - # Nemu: should it? - set(OPENAL_LIB ${ARCH_PREBUILT_DIRS_RELEASE}/libopenal.1.dylib) - else (WINDOWS) - set(OPENAL_LIB openal) - endif (WINDOWS) - - if (NOT OPENAL_LIB) - message(FATAL_ERROR "OpenAL not found!") - else (NOT OPENAL_LIB) - # message(STATUS "OpenAL found: ${OPENAL_LIB}") - endif (NOT OPENAL_LIB) - - - - # OPENAL_INCLUDE_DIR - - if (DARWIN) - set(OPENAL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/AL) - else (DARWIN) - find_path(OPENAL_INCLUDE_DIR - NAMES al.h - PATHS ${LIBS_PREBUILT_DIR}/include/AL - ) - endif (DARWIN) - - if (NOT OPENAL_INCLUDE_DIR) - message(FATAL_ERROR "al.h not found!") - else (NOT OPENAL_INCLUDE_DIR) - # message(STATUS "al.h found in: ${OPENAL_INCLUDE_DIR}") - endif (NOT OPENAL_INCLUDE_DIR) - - - - # ALUT_LIB - - if (WINDOWS) - set(ALUT_LIB - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/alut.lib - debug ${ARCH_PREBUILT_DIRS_DEBUG}/alut.lib - ) - elseif (DARWIN) - find_library( ALUT_LIB - NAMES alut.0 - PATHS ${ARCH_PREBUILT_DIRS_RELEASE} - NO_DEFAULT_PATH - ) - else (WINDOWS) - set(ALUT_LIB alut) - endif (WINDOWS) - - if (NOT ALUT_LIB) - message(FATAL_ERROR "ALUT not found!") - else (NOT ALUT_LIB) - # message(STATUS "ALUT found: ${ALUT_LIB}") - endif (NOT ALUT_LIB) - - - - # ALUT_INCLUDE_DIR - - find_path(ALUT_INCLUDE_DIR - NAMES alut.h - PATHS ${OPENAL_INCLUDE_DIR} - ) - - if (NOT ALUT_INCLUDE_DIR) - message(FATAL_ERROR "alut.h not found!") - else (NOT ALUT_INCLUDE_DIR) - # message(STATUS "alut.h found in: ${ALUT_INCLUDE_DIR}") - endif (NOT ALUT_INCLUDE_DIR) - - - + if (STANDALONE) + include(FindPkgConfig) + include(FindOpenAL) + pkg_check_modules(OPENAL_LIB REQUIRED openal) + pkg_check_modules(FREEALUT_LIB REQUIRED freealut) + else (STANDALONE) + use_prebuilt_binary(openal-soft) + endif (STANDALONE) set(OPENAL_LIBRARIES - ${OPENAL_LIB} - ${ALUT_LIB} - ) - - set(OPENAL_INCLUDE_DIRS - ${OPENAL_INCLUDE_DIR} - ${ALUT_INCLUDE_DIR} - ) - - - set(OPENAL_FOUND TRUE CACHE BOOL - "Found OpenAL and ALUT libraries successfully" + openal + alut ) +endif (OPENAL) +if (OPENAL) + message(STATUS "Building with OpenAL audio support") endif (OPENAL) -- cgit v1.1 From cb0ee0e71f8b72d3898c439b56fa0e8a43752f86 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 28 Sep 2010 03:12:54 +0200 Subject: RED-561: Optimization flags used during --Type=Debug (linux x86_64) See http://redmine.imprudenceviewer.org/issues/561 Fixed erroneous use of optimization flags when not compiling Release. Also removed -DLL_VECTORIZE from compile options: that is set in a header file (llv4math.h), not on the commandline. Patch affects only 64 bit linux. --- linden/indra/cmake/00-Common.cmake | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'linden/indra/cmake') diff --git a/linden/indra/cmake/00-Common.cmake b/linden/indra/cmake/00-Common.cmake index d1f379c..3497ec9 100644 --- a/linden/indra/cmake/00-Common.cmake +++ b/linden/indra/cmake/00-Common.cmake @@ -169,23 +169,10 @@ if (LINUX) add_definitions(-fno-stack-protector) endif (NOT STANDALONE) if (${ARCH} STREQUAL "x86_64") - add_definitions( -DLINUX64=1 - #this rather needs to be done elsewhere - #anyway these are the flags for the 64bit releases: - -DLL_VECTORIZE=1 - -O2 - -fomit-frame-pointer - -pipe - -mmmx - -msse - -mfpmath=sse - -msse2 - -ffast-math - -ftree-vectorize - -fweb -fexpensive-optimizations - -frename-registers - ) - + # This rather needs to be done elsewhere + # anyway these are the flags for the 64bit releases: + add_definitions(-DLINUX64=1 -pipe) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers") endif (${ARCH} STREQUAL "x86_64") endif (VIEWER) -- cgit v1.1 From d2e914c92e851ce3e0cc349dd3d707751d3abfc1 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Thu, 30 Sep 2010 15:03:40 +0200 Subject: RED-573: FindTut.cmake is missing: tut.h is not searched for. This patch only affects --standalone. It was basically ported from Snowglobe with the following change: If LL_TESTS is not set, then tut.h is not required (this is an improvement, because if LL_TESTS is not set no tests should be created or run). I tested it with -DLL_TESTS:BOOL=ON, -DLL_TESTS:BOOL=OFF and no -DLL_TESTS* at all, with and without tut installed, internally and externally. Things worked as expected. Most notably, with tut.h installed in libraries/include/, it is NOT found. This is necessary because using -Ilibraries/include for standalone is a no no: prebuilt stuff might be downloaded, but we don't want to use it! That directory contains potentially many other libraries. --- linden/indra/cmake/FindTut.cmake | 33 +++++++++++++++++++++++++++++++++ linden/indra/cmake/Tut.cmake | 15 +++++++++++++-- 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 linden/indra/cmake/FindTut.cmake (limited to 'linden/indra/cmake') diff --git a/linden/indra/cmake/FindTut.cmake b/linden/indra/cmake/FindTut.cmake new file mode 100644 index 0000000..5ac7ec0 --- /dev/null +++ b/linden/indra/cmake/FindTut.cmake @@ -0,0 +1,33 @@ +# -*- cmake -*- + +# - Find Tut +# Find the Tut unit test framework includes and library +# This module defines +# TUT_INCLUDE_DIR, where to find tut/tut.hpp, etc. +# TUT_FOUND, If false, do not try to use Tut. + +find_path(TUT_INCLUDE_DIR tut/tut.hpp + NO_SYSTEM_ENVIRONMENT_PATH +) + +IF (TUT_INCLUDE_DIR) + SET(TUT_FOUND "YES") +ELSE (TUT_INCLUDE_DIR) + SET(TUT_FOUND "NO") +ENDIF (TUT_INCLUDE_DIR) + +IF (TUT_FOUND) + IF (NOT TUT_FIND_QUIETLY) + MESSAGE(STATUS "Found Tut: ${TUT_INCLUDE_DIR}") + SET(TUT_FIND_QUIETLY TRUE) # Only alert us the first time + ENDIF (NOT TUT_FIND_QUIETLY) +ELSE (TUT_FOUND) + IF (TUT_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Tut") + ENDIF (TUT_FIND_REQUIRED) +ENDIF (TUT_FOUND) + +MARK_AS_ADVANCED( + TUT_INCLUDE_DIR +) + diff --git a/linden/indra/cmake/Tut.cmake b/linden/indra/cmake/Tut.cmake index 7488e9d..118c72e 100644 --- a/linden/indra/cmake/Tut.cmake +++ b/linden/indra/cmake/Tut.cmake @@ -1,6 +1,17 @@ # -*- cmake -*- include(Prebuilt) -if (NOT STANDALONE) +SET(TUT_FIND_REQUIRED FALSE) +SET(TUT_FIND_QUIETLY TRUE) + +if (STANDALONE) + if (LL_TESTS) + SET(TUT_FIND_REQUIRED TRUE) + endif (LL_TESTS) + include(FindTut) + if (TUT_FOUND) + include_directories(${TUT_INCLUDE_DIR}) + endif (TUT_FOUND) +else (STANDALONE) use_prebuilt_binary(tut) -endif(NOT STANDALONE) +endif(STANDALONE) -- cgit v1.1 From a74fe93ffdb4f821cbf8189ba473d8df795f57a9 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Thu, 30 Sep 2010 15:55:13 +0200 Subject: RED-579: SNOW-751: 'configure' with cmake 2.8 is extremely slow. Note that indra/cmake/CMakeLists.txt is missing on imprudence, so I couldn't add 'FindZLIB.cmake' to the list of source files (see http://svn.secondlife.com/trac/linden/browser/projects/2009/snowglobe/trunk/indra/cmake/CMakeLists.txt) I added a comment to http://github.com/mccabe/imprudence/commit/39f625963e408ec5dd394e202506700259b9b508 that adds an empty indra/cmake/CMakeLists.txt If Jacek follows up and copies snowglobe's CMakeLists.txt then she'll have to remove the FindZLIB.cmake from it if she tests it before merging with THIS commit. In that case it has to be added back when merging that commit with this one. Tested on imprudence with cmake 2.8.2: * Without patch, 'configure' takes 100 seconds. * With patch, 'configure' takes 4 seconds. --- linden/indra/cmake/FindZLIB.cmake | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 linden/indra/cmake/FindZLIB.cmake (limited to 'linden/indra/cmake') diff --git a/linden/indra/cmake/FindZLIB.cmake b/linden/indra/cmake/FindZLIB.cmake new file mode 100644 index 0000000..6d630f1 --- /dev/null +++ b/linden/indra/cmake/FindZLIB.cmake @@ -0,0 +1,46 @@ +# -*- cmake -*- + +# - Find zlib +# Find the ZLIB includes and library +# This module defines +# ZLIB_INCLUDE_DIRS, where to find zlib.h, etc. +# ZLIB_LIBRARIES, the libraries needed to use zlib. +# ZLIB_FOUND, If false, do not try to use zlib. +# +# This FindZLIB is about 43 times as fast the one provided with cmake (2.8.x), +# because it doesn't look up the version of zlib, resulting in a dramatic +# speed up for configure (from 4 minutes 22 seconds to 6 seconds). +# +# Note: Since this file is only used for standalone, the windows +# specific parts were left out. + +FIND_PATH(ZLIB_INCLUDE_DIR zlib.h + NO_SYSTEM_ENVIRONMENT_PATH + ) + +FIND_LIBRARY(ZLIB_LIBRARY z) + +if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) + SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) + SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + SET(ZLIB_FOUND "YES") +else (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) + SET(ZLIB_FOUND "NO") +endif (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) + +if (ZLIB_FOUND) + if (NOT ZLIB_FIND_QUIETLY) + message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES}") + SET(ZLIB_FIND_QUIETLY TRUE) + endif (NOT ZLIB_FIND_QUIETLY) +else (ZLIB_FOUND) + if (ZLIB_FIND_REQUIRED) + message(FATAL_ERROR "Could not find ZLIB library") + endif (ZLIB_FIND_REQUIRED) +endif (ZLIB_FOUND) + +mark_as_advanced( + ZLIB_LIBRARY + ZLIB_INCLUDE_DIR + ) + -- cgit v1.1 From 8cfce63b3a97ea33db95072bc3cf561a066fca1f Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 2 Oct 2010 15:46:15 +0200 Subject: RED-560: Revert changes to indra/cmake/OPENAL.cmake Revert the changes introduced in http://github.com/AlericInglewood/imprudence/commit/e71d3ea2fad63fa2ec81685a9b09c1bed6b493be --- linden/indra/cmake/OPENAL.cmake | 123 +++++++++++++++++++++++++++++++++------- 1 file changed, 104 insertions(+), 19 deletions(-) (limited to 'linden/indra/cmake') diff --git a/linden/indra/cmake/OPENAL.cmake b/linden/indra/cmake/OPENAL.cmake index 98c7ddc..4f0e0cc 100644 --- a/linden/indra/cmake/OPENAL.cmake +++ b/linden/indra/cmake/OPENAL.cmake @@ -1,28 +1,113 @@ # -*- cmake -*- + +include(Variables) include(Linking) -include(Prebuilt) -if (LINUX) - set(OPENAL ON CACHE BOOL "Enable OpenAL") -else (LINUX) - set(OPENAL OFF CACHE BOOL "Enable OpenAL") -endif (LINUX) +set(OPENAL ON CACHE BOOL "Enable OpenAL") + if (OPENAL) - if (STANDALONE) - include(FindPkgConfig) - include(FindOpenAL) - pkg_check_modules(OPENAL_LIB REQUIRED openal) - pkg_check_modules(FREEALUT_LIB REQUIRED freealut) - else (STANDALONE) - use_prebuilt_binary(openal-soft) - endif (STANDALONE) + + # message(STATUS "Building with OpenAL audio support") + + # OPENAL_LIB + use_prebuilt_binary(openal) + + if (WINDOWS) + set(OPENAL_LIB + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libOpenAL32.dll.a.lib + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libOpenAL32.dll.a.lib + ) + + elseif (DARWIN) + # Look for for system's OpenAL.framework + # Nemu: This code has never looked for the system's OpenAL.framework + # Nemu: should it? + set(OPENAL_LIB ${ARCH_PREBUILT_DIRS_RELEASE}/libopenal.1.dylib) + else (WINDOWS) + set(OPENAL_LIB openal) + endif (WINDOWS) + + if (NOT OPENAL_LIB) + message(FATAL_ERROR "OpenAL not found!") + else (NOT OPENAL_LIB) + # message(STATUS "OpenAL found: ${OPENAL_LIB}") + endif (NOT OPENAL_LIB) + + + + # OPENAL_INCLUDE_DIR + + if (DARWIN) + set(OPENAL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/AL) + else (DARWIN) + find_path(OPENAL_INCLUDE_DIR + NAMES al.h + PATHS ${LIBS_PREBUILT_DIR}/include/AL + ) + endif (DARWIN) + + if (NOT OPENAL_INCLUDE_DIR) + message(FATAL_ERROR "al.h not found!") + else (NOT OPENAL_INCLUDE_DIR) + # message(STATUS "al.h found in: ${OPENAL_INCLUDE_DIR}") + endif (NOT OPENAL_INCLUDE_DIR) + + + + # ALUT_LIB + + if (WINDOWS) + set(ALUT_LIB + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/alut.lib + debug ${ARCH_PREBUILT_DIRS_DEBUG}/alut.lib + ) + elseif (DARWIN) + find_library( ALUT_LIB + NAMES alut.0 + PATHS ${ARCH_PREBUILT_DIRS_RELEASE} + NO_DEFAULT_PATH + ) + else (WINDOWS) + set(ALUT_LIB alut) + endif (WINDOWS) + + if (NOT ALUT_LIB) + message(FATAL_ERROR "ALUT not found!") + else (NOT ALUT_LIB) + # message(STATUS "ALUT found: ${ALUT_LIB}") + endif (NOT ALUT_LIB) + + + + # ALUT_INCLUDE_DIR + + find_path(ALUT_INCLUDE_DIR + NAMES alut.h + PATHS ${OPENAL_INCLUDE_DIR} + ) + + if (NOT ALUT_INCLUDE_DIR) + message(FATAL_ERROR "alut.h not found!") + else (NOT ALUT_INCLUDE_DIR) + # message(STATUS "alut.h found in: ${ALUT_INCLUDE_DIR}") + endif (NOT ALUT_INCLUDE_DIR) + + + set(OPENAL_LIBRARIES - openal - alut + ${OPENAL_LIB} + ${ALUT_LIB} + ) + + set(OPENAL_INCLUDE_DIRS + ${OPENAL_INCLUDE_DIR} + ${ALUT_INCLUDE_DIR} + ) + + + set(OPENAL_FOUND TRUE CACHE BOOL + "Found OpenAL and ALUT libraries successfully" ) -endif (OPENAL) -if (OPENAL) - message(STATUS "Building with OpenAL audio support") endif (OPENAL) -- cgit v1.1 From e14cd4c42432fa5825f06248c8cf45cf944505f3 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 2 Oct 2010 21:12:22 +0200 Subject: RED-560: Add support for STANDALONE to OPENAL.cmake Use pkg_check_modules to find freealut (and openal) for STANDALONE. Non-standalone is untouched by this version. The changes relative to snowglobe (for the STANDALONE path) is that I removed the 'include(FindOpenAL) (that comes with cmake) which not only doesn't find libalut, but even sets the wrong cmake variables (it sets OPENAL_LIBRARY, and our cmake scripts *use* OPENAL_LIBRARIES). Moreover, under the assumption that STANDALONE really is only for linux (and I think that is so), every linux distribution DOES have freealut (and openal) installed with a pkg-config anyway. I also removed pkg_check_modules(openal) because it is redundant: freealut pulls that in already. --- linden/indra/cmake/OPENAL.cmake | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'linden/indra/cmake') diff --git a/linden/indra/cmake/OPENAL.cmake b/linden/indra/cmake/OPENAL.cmake index 4f0e0cc..b9efd57 100644 --- a/linden/indra/cmake/OPENAL.cmake +++ b/linden/indra/cmake/OPENAL.cmake @@ -2,11 +2,21 @@ include(Variables) include(Linking) +include(FindPkgConfig) set(OPENAL ON CACHE BOOL "Enable OpenAL") +# If STANDALONE but NOT PKG_CONFIG_FOUND we should fail, +# but why try to find it as prebuilt? +if (OPENAL AND STANDALONE AND PKG_CONFIG_FOUND) -if (OPENAL) + # This module defines + # OPENAL_INCLUDE_DIRS + # OPENAL_LIBRARIES + # OPENAL_FOUND + pkg_check_modules(OPENAL REQUIRED freealut) # freealut links with openal. + +elseif (OPENAL) # message(STATUS "Building with OpenAL audio support") @@ -110,4 +120,4 @@ if (OPENAL) "Found OpenAL and ALUT libraries successfully" ) -endif (OPENAL) +endif (OPENAL AND STANDALONE AND PKG_CONFIG_FOUND) -- cgit v1.1