diff options
author | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2012-07-31 15:42:02 -0700 |
---|---|---|
committer | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2012-07-31 15:42:02 -0700 |
commit | 83f5d0c61667ae7682893adbb8939f77b28c2201 (patch) | |
tree | 081ac47802bf782a8dcd55d7c2fd100ee3f03b89 /indra/cmake | |
parent | 7cd5f7d479b889c3dcdb4bcd0ee6b65b5b5a025f (diff) | |
parent | b8bac66a0f8c392a221ad2c64611e2a55de82339 (diff) |
Merge in viewer-development
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/CMakeLists.txt | 3 | ||||
-rw-r--r-- | indra/cmake/Copy3rdPartyLibs.cmake | 23 | ||||
-rw-r--r-- | indra/cmake/FindHUNSPELL.cmake | 38 | ||||
-rw-r--r-- | indra/cmake/GooglePerfTools.cmake | 40 | ||||
-rw-r--r-- | indra/cmake/Havok.cmake | 83 | ||||
-rw-r--r-- | indra/cmake/Hunspell.cmake | 22 | ||||
-rw-r--r-- | indra/cmake/LLAddBuildTest.cmake | 9 | ||||
-rw-r--r-- | indra/cmake/LLConvexDecomposition.cmake | 12 | ||||
-rw-r--r-- | indra/cmake/LLPhysicsExtensions.cmake | 35 | ||||
-rw-r--r-- | indra/cmake/Linking.cmake | 3 | ||||
-rw-r--r-- | indra/cmake/Variables.cmake | 4 | ||||
-rw-r--r-- | indra/cmake/ViewerMiscLibs.cmake | 8 |
12 files changed, 238 insertions, 42 deletions
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 279d577a27..569034a6fb 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -37,12 +37,12 @@ set(cmake_SOURCE_FILES GLOD.cmake GStreamer010Plugin.cmake GooglePerfTools.cmake + Hunspell.cmake JPEG.cmake LLAddBuildTest.cmake LLAudio.cmake LLCharacter.cmake LLCommon.cmake - LLConvexDecomposition.cmake LLCrashLogger.cmake LLDatabase.cmake LLImage.cmake @@ -53,6 +53,7 @@ set(cmake_SOURCE_FILES LLMessage.cmake LLPlugin.cmake LLPrimitive.cmake + LLPhysicsExtensions.cmake LLRender.cmake LLScene.cmake LLTestCommand.cmake diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 394db362b1..9f05c4cff2 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -41,6 +41,7 @@ if(WINDOWS) libeay32.dll libcollada14dom22-d.dll glod.dll + libhunspell.dll ) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") @@ -53,12 +54,13 @@ if(WINDOWS) libeay32.dll libcollada14dom22.dll glod.dll + libhunspell.dll ) - if(USE_GOOGLE_PERFTOOLS) + if(USE_TCMALLOC) set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll) set(release_files ${release_files} libtcmalloc_minimal.dll) - endif(USE_GOOGLE_PERFTOOLS) + endif(USE_TCMALLOC) if (FMOD) set(debug_files ${debug_files} fmod.dll) @@ -212,11 +214,12 @@ elseif(DARWIN) libexpat.1.5.2.dylib libexpat.dylib libGLOD.dylib - libllqtwebkit.dylib - libminizip.a + libllqtwebkit.dylib + libminizip.a libndofdev.dylib + libhunspell-1.3.0.dylib libexception_handler.dylib - libcollada14dom.dylib + libcollada14dom.dylib ) # fmod is statically linked on darwin @@ -257,24 +260,28 @@ elseif(LINUX) libdb-5.1.so libexpat.so libexpat.so.1 - libglod.so + libglod.so libgmock_main.so libgmock.so.0 libgmodule-2.0.so libgobject-2.0.so libgtest_main.so libgtest.so.0 - libminizip.so + libhunspell-1.3.so.0.0.0 + libminizip.so libopenal.so libopenjpeg.so libssl.so - libtcmalloc_minimal.so libuuid.so.16 libuuid.so.16.0.22 libssl.so.1.0.0 libfontconfig.so.1.4.4 ) + if (USE_TCMALLOC) + set(release_files ${release_files} "libtcmalloc_minimal.so") + endif (USE_TCMALLOC) + if (FMOD) set(release_files ${release_files} "libfmod-3.75.so") endif (FMOD) diff --git a/indra/cmake/FindHUNSPELL.cmake b/indra/cmake/FindHUNSPELL.cmake new file mode 100644 index 0000000000..6faf22959c --- /dev/null +++ b/indra/cmake/FindHUNSPELL.cmake @@ -0,0 +1,38 @@ +# -*- cmake -*- + +# - Find HUNSPELL +# This module defines +# HUNSPELL_INCLUDE_DIR, where to find libhunspell.h, etc. +# HUNSPELL_LIBRARY, the library needed to use HUNSPELL. +# HUNSPELL_FOUND, If false, do not try to use HUNSPELL. + +find_path(HUNSPELL_INCLUDE_DIR hunspell.h + PATH_SUFFIXES hunspell + ) + +set(HUNSPELL_NAMES ${HUNSPELL_NAMES} libhunspell-1.3.0 libhunspell) +find_library(HUNSPELL_LIBRARY + NAMES ${HUNSPELL_NAMES} + ) + +if (HUNSPELL_LIBRARY AND HUNSPELL_INCLUDE_DIR) + set(HUNSPELL_FOUND "YES") +else (HUNSPELL_LIBRARY AND HUNSPELL_INCLUDE_DIR) + set(HUNSPELL_FOUND "NO") +endif (HUNSPELL_LIBRARY AND HUNSPELL_INCLUDE_DIR) + + +if (HUNSPELL_FOUND) + if (NOT HUNSPELL_FIND_QUIETLY) + message(STATUS "Found Hunspell: Library in '${HUNSPELL_LIBRARY}' and header in '${HUNSPELL_INCLUDE_DIR}' ") + endif (NOT HUNSPELL_FIND_QUIETLY) +else (HUNSPELL_FOUND) + if (HUNSPELL_FIND_REQUIRED) + message(FATAL_ERROR " * * *\nCould not find HUNSPELL library! * * *") + endif (HUNSPELL_FIND_REQUIRED) +endif (HUNSPELL_FOUND) + +mark_as_advanced( + HUNSPELL_LIBRARY + HUNSPELL_INCLUDE_DIR + ) diff --git a/indra/cmake/GooglePerfTools.cmake b/indra/cmake/GooglePerfTools.cmake index d9f91193be..09501e0406 100644 --- a/indra/cmake/GooglePerfTools.cmake +++ b/indra/cmake/GooglePerfTools.cmake @@ -1,20 +1,34 @@ # -*- cmake -*- include(Prebuilt) +# If you want to enable or disable TCMALLOC in viewer builds, this is the place. +# set ON or OFF as desired. +set (USE_TCMALLOC ON) + if (STANDALONE) include(FindGooglePerfTools) else (STANDALONE) if (WINDOWS) - use_prebuilt_binary(tcmalloc) - set(TCMALLOC_LIBRARIES - debug libtcmalloc_minimal-debug - optimized libtcmalloc_minimal) + if (USE_TCMALLOC) + use_prebuilt_binary(tcmalloc) + set(TCMALLOC_LIBRARIES + debug libtcmalloc_minimal-debug + optimized libtcmalloc_minimal) + set(TCMALLOC_LINK_FLAGS "/INCLUDE:__tcmalloc") + else (USE_TCMALLOC) + set(TCMALLOC_LIBRARIES) + set(TCMALLOC_LINK_FLAGS) + endif (USE_TCMALLOC) set(GOOGLE_PERFTOOLS_FOUND "YES") endif (WINDOWS) if (LINUX) - use_prebuilt_binary(tcmalloc) - set(TCMALLOC_LIBRARIES - tcmalloc) + if (USE_TCMALLOC) + use_prebuilt_binary(tcmalloc) + set(TCMALLOC_LIBRARIES + tcmalloc) + else (USE_TCMALLOC) + set(TCMALLOC_LIBRARIES) + endif (USE_TCMALLOC) set(PROFILER_LIBRARIES profiler) set(GOOGLE_PERFTOOLS_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) @@ -29,13 +43,19 @@ if (GOOGLE_PERFTOOLS_FOUND) endif (GOOGLE_PERFTOOLS_FOUND) if (WINDOWS) - set(USE_GOOGLE_PERFTOOLS ON) + set(USE_GOOGLE_PERFTOOLS ON) endif (WINDOWS) if (USE_GOOGLE_PERFTOOLS) - set(TCMALLOC_FLAG -ULL_USE_TCMALLOC=1) + if (USE_TCMALLOC) + set(TCMALLOC_FLAG -DLL_USE_TCMALLOC=1) + else (USE_TCMALLOC) + set(TCMALLOC_FLAG -ULL_USE_TCMALLOC) + endif (USE_TCMALLOC) +endif (USE_GOOGLE_PERFTOOLS) + +if (USE_GOOGLE_PERFTOOLS) include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR}) set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES} ${STACKTRACE_LIBRARIES} ${PROFILER_LIBRARIES}) else (USE_GOOGLE_PERFTOOLS) - set(TCMALLOC_FLAG -ULL_USE_TCMALLOC) endif (USE_GOOGLE_PERFTOOLS) diff --git a/indra/cmake/Havok.cmake b/indra/cmake/Havok.cmake new file mode 100644 index 0000000000..5c0768abfa --- /dev/null +++ b/indra/cmake/Havok.cmake @@ -0,0 +1,83 @@ +# -*- cmake -*- + +use_prebuilt_binary(havok-source) +set(Havok_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/havok/Source) +list(APPEND Havok_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/havok/Demo) + +set(HAVOK_DEBUG_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-fulldebug) +set(HAVOK_RELEASE_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release/havok) + +if (LL_DEBUG_HAVOK) + if (WIN32) + # Always link relwithdebinfo to havok-hybrid on windows. + set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-hybrid) + else (WIN32) + set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-fulldebug) + endif (WIN32) +else (LL_DEBUG_HAVOK) + set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release/havok) +endif (LL_DEBUG_HAVOK) + +set(HAVOK_LIBS + hkBase + hkCompat + hkGeometryUtilities + hkInternal + hkSerialize + hkSceneData + hkpCollide + hkpUtilities + hkpConstraintSolver + hkpDynamics + hkpInternal + hkaiInternal + hkaiPathfinding + hkaiAiPhysicsBridge + hkcdInternal + hkcdCollide + hkpVehicle + hkVisualize + hkaiVisualize + hkgpConvexDecomposition +) + +unset(HK_DEBUG_LIBRARIES) +unset(HK_RELEASE_LIBRARIES) +unset(HK_RELWITHDEBINFO_LIBRARIES) + +foreach(HAVOK_LIB ${HAVOK_LIBS}) + find_library(HAVOK_DEBUG_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_DEBUG_LIBRARY_PATH}) + find_library(HAVOK_RELEASE_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELEASE_LIBRARY_PATH}) + find_library(HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}) + + if(LINUX) + set(cmd "mkdir") + set(debug_dir "${HAVOK_DEBUG_LIBRARY_PATH}/${HAVOK_LIB}") + set(release_dir "${HAVOK_RELEASE_LIBRARY_PATH}/${HAVOK_LIB}") + set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}") + + exec_program( ${cmd} ${HAVOK_DEBUG_LIBRARY_PATH} ARGS ${debug_dir} OUTPUT_VARIABLE rv) + exec_program( ${cmd} ${HAVOK_RELEASE_LIBRARY_PATH} ARGS ${release_dir} OUTPUT_VARIABLE rv) + exec_program( ${cmd} ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH} ARGS ${relwithdebinfo_dir} OUTPUT_VARIABLE rv) + + set(cmd "ar") + set(arg " -xv") + set(arg "${arg} ../lib${HAVOK_LIB}.a") + exec_program( ${cmd} ${debug_dir} ARGS ${arg} OUTPUT_VARIABLE rv) + exec_program( ${cmd} ${release_dir} ARGS ${arg} OUTPUT_VARIABLE rv) + exec_program( ${cmd} ${relwithdebinfo_dir} ARGS ${arg} OUTPUT_VARIABLE rv) + + file(GLOB extracted_debug "${debug_dir}/*.o") + file(GLOB extracted_release "${release_dir}/*.o") + file(GLOB extracted_relwithdebinfo "${relwithdebinfo_dir}/*.o") + list(APPEND HK_DEBUG_LIBRARIES ${extracted_debug}) + list(APPEND HK_RELEASE_LIBRARIES ${extracted_release}) + list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_relwithdebinfo}) + else(LINUX) + # Win32 + list(APPEND HK_DEBUG_LIBRARIES ${HAVOK_DEBUG_LIB_${HAVOK_LIB}}) + list(APPEND HK_RELEASE_LIBRARIES ${HAVOK_RELEASE_LIB_${HAVOK_LIB}}) + list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB}}) + endif (LINUX) +endforeach(HAVOK_LIB) + diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake new file mode 100644 index 0000000000..0c9cf93316 --- /dev/null +++ b/indra/cmake/Hunspell.cmake @@ -0,0 +1,22 @@ +# -*- cmake -*- +include(Prebuilt) + +set(HUNSPELL_FIND_QUIETLY ON) +set(HUNSPELL_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindHUNSPELL) +else (STANDALONE) + use_prebuilt_binary(libhunspell) + if (WINDOWS) + set(HUNSPELL_LIBRARY libhunspell) + elseif(DARWIN) + set(HUNSPELL_LIBRARY hunspell-1.3.0) + elseif(LINUX) + set(HUNSPELL_LIBRARY hunspell-1.3) + else() + message(FATAL_ERROR "Invalid platform") + endif() + set(HUNSPELL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/hunspell) + use_prebuilt_binary(dictionaries) +endif (STANDALONE) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 08feab6e36..a6f69a09e9 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -205,6 +205,15 @@ FUNCTION(LL_ADD_INTEGRATION_TEST SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}") endif(STANDALONE) + if (WINDOWS) + SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} + PROPERTIES + LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${TCMALLOC_LINK_FLAGS}" + LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO" + LINK_FLAGS_RELEASE "" + ) + endif (WINDOWS) + # Add link deps to the executable if(TEST_DEBUG) message(STATUS "TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})") diff --git a/indra/cmake/LLConvexDecomposition.cmake b/indra/cmake/LLConvexDecomposition.cmake deleted file mode 100644 index 8e44504782..0000000000 --- a/indra/cmake/LLConvexDecomposition.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) - -set(LLCONVEXDECOMP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) - -if (INSTALL_PROPRIETARY AND NOT STANDALONE) - use_prebuilt_binary(llconvexdecomposition) - set(LLCONVEXDECOMP_LIBRARY llconvexdecomposition) -else (INSTALL_PROPRIETARY AND NOT STANDALONE) - use_prebuilt_binary(llconvexdecompositionstub) - set(LLCONVEXDECOMP_LIBRARY llconvexdecompositionstub) -endif (INSTALL_PROPRIETARY AND NOT STANDALONE) diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake new file mode 100644 index 0000000000..e6afee762e --- /dev/null +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -0,0 +1,35 @@ +# -*- cmake -*- +include(Prebuilt) + +# There are three possible solutions to provide the llphysicsextensions: +# - The full source package, selected by -DHAVOK:BOOL=ON +# - The stub source package, selected by -DHAVOK:BOOL=OFF +# - The prebuilt package available to those with sublicenses, selected by -DHAVOK_TPV:BOOL=ON + +if (INSTALL_PROPRIETARY) + set(HAVOK ON CACHE BOOL "Use Havok physics library") +endif (INSTALL_PROPRIETARY) + + +# Note that the use_prebuilt_binary macros below do not in fact include binaries; +# the llphysicsextensions_* packages are source only and are built here. +# The source package and the stub package both build libraries of the same name. + +if (HAVOK) + include(Havok) + use_prebuilt_binary(llphysicsextensions_source) + set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src) + set(LLPHYSICSEXTENSIONS_LIBRARIES llphysicsextensions) + +elseif (HAVOK_TPV) + use_prebuilt_binary(llphysicsextensions_tpv) + set(LLPHYSICSEXTENSIONS_LIBRARIES llphysicsextensions_tpv) + +else (HAVOK) + use_prebuilt_binary(llphysicsextensions_stub) + set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub) + set(LLPHYSICSEXTENSIONS_LIBRARIES llphysicsextensionsstub) + +endif (HAVOK) + +set(LLPHYSICSEXTENSIONS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 47f944f9a5..c3e3a80fd0 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -38,9 +38,8 @@ if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release") # packages/lib/release directory to deal with autobuild packages that don't # provide (e.g.) lib/debug libraries. list(APPEND AUTOBUILD_LIBS_INSTALL_DIRS ${ARCH_PREBUILT_DIRS_RELEASE}) - message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}, extending AUTOBUILD_LIBS_INSTALL_DIRS") endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release") -message(STATUS "For ${CMAKE_BUILD_TYPE}, AUTOBUILD_LIBS_INSTALL_DIRS: ${AUTOBUILD_LIBS_INSTALL_DIRS}") + link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS}) if (LINUX) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 4cbf7aa043..56ced20abf 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -101,8 +101,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # To support a different SDK update these Xcode settings: set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5) - set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) - set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.0") + set(CMAKE_OSX_SYSROOT macosx10.6) + set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) # NOTE: To attempt an i386/PPC Universal build, add this on the configure line: diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index df013b1665..5b00c989a4 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -2,15 +2,9 @@ include(Prebuilt) if (NOT STANDALONE) + use_prebuilt_binary(libhunspell) use_prebuilt_binary(libuuid) use_prebuilt_binary(slvoice) use_prebuilt_binary(fontconfig) endif(NOT STANDALONE) -if(VIEWER AND NOT STANDALONE) - if(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker) - message(STATUS "We seem to have an artwork bundle in the tree - brilliant.") - else(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker) - message(FATAL_ERROR "Didn't find an artwork bundle - this needs to be downloaded separately and unpacked into this tree. You can probably get it from the same place you got your viewer source. Thanks!") - endif(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker) -endif(VIEWER AND NOT STANDALONE) |