From 798d367d54a6c6379ad355bd8345fa40e31e7fe9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 6 Sep 2008 18:24:57 -0500 Subject: Second Life viewer sources 1.21.0-RC --- linden/indra/cmake/00-Common.cmake | 206 ++++++++++++++++++++++++++ linden/indra/cmake/APR.cmake | 55 +++++++ linden/indra/cmake/Audio.cmake | 34 +++++ linden/indra/cmake/BerkeleyDB.cmake | 11 ++ linden/indra/cmake/Boost.cmake | 49 ++++++ linden/indra/cmake/BuildVersion.cmake | 18 +++ linden/indra/cmake/CARes.cmake | 23 +++ linden/indra/cmake/CMakeCopyIfDifferent.cmake | 41 +++++ linden/indra/cmake/CSharpMacros.cmake | 142 ++++++++++++++++++ linden/indra/cmake/CURL.cmake | 19 +++ linden/indra/cmake/CommonMiscLibs.cmake | 7 + linden/indra/cmake/CopyBackToSource.cmake | 16 ++ linden/indra/cmake/CopyWinLibs.cmake | 155 +++++++++++++++++++ linden/indra/cmake/DirectX.cmake | 40 +++++ linden/indra/cmake/ELFIO.cmake | 19 +++ linden/indra/cmake/EXPAT.cmake | 17 +++ linden/indra/cmake/FMOD.cmake | 64 ++++++++ linden/indra/cmake/FindAPR.cmake | 94 ++++++++++++ linden/indra/cmake/FindBerkeleyDB.cmake | 50 +++++++ linden/indra/cmake/FindCARes.cmake | 48 ++++++ linden/indra/cmake/FindELFIO.cmake | 48 ++++++ linden/indra/cmake/FindGooglePerfTools.cmake | 66 +++++++++ linden/indra/cmake/FindMono.cmake | 68 +++++++++ linden/indra/cmake/FindMySQL.cmake | 48 ++++++ linden/indra/cmake/FindOpenJPEG.cmake | 50 +++++++ linden/indra/cmake/FindSCP.cmake | 40 +++++ linden/indra/cmake/FindXmlRpcEpi.cmake | 48 ++++++ linden/indra/cmake/FreeType.cmake | 20 +++ linden/indra/cmake/GStreamer.cmake | 38 +++++ linden/indra/cmake/GooglePerfTools.cmake | 28 ++++ linden/indra/cmake/JPEG.cmake | 23 +++ linden/indra/cmake/LLAudio.cmake | 15 ++ linden/indra/cmake/LLCharacter.cmake | 9 ++ linden/indra/cmake/LLCommon.cmake | 21 +++ linden/indra/cmake/LLCrashLogger.cmake | 9 ++ linden/indra/cmake/LLDatabase.cmake | 13 ++ linden/indra/cmake/LLImage.cmake | 15 ++ linden/indra/cmake/LLImageJ2COJ.cmake | 8 + linden/indra/cmake/LLInventory.cmake | 9 ++ linden/indra/cmake/LLKDU.cmake | 20 +++ linden/indra/cmake/LLMath.cmake | 9 ++ linden/indra/cmake/LLMedia.cmake | 15 ++ linden/indra/cmake/LLMessage.cmake | 22 +++ linden/indra/cmake/LLPhysics.cmake | 76 ++++++++++ linden/indra/cmake/LLPrimitive.cmake | 9 ++ linden/indra/cmake/LLRender.cmake | 32 ++++ linden/indra/cmake/LLScene.cmake | 9 ++ linden/indra/cmake/LLUI.cmake | 9 ++ linden/indra/cmake/LLVFS.cmake | 13 ++ linden/indra/cmake/LLWindow.cmake | 43 ++++++ linden/indra/cmake/LLXML.cmake | 13 ++ linden/indra/cmake/LScript.cmake | 16 ++ linden/indra/cmake/Linking.cmake | 45 ++++++ linden/indra/cmake/MonoDeps.cmake | 48 ++++++ linden/indra/cmake/MonoEmbed.cmake | 57 +++++++ linden/indra/cmake/Mozlib.cmake | 47 ++++++ linden/indra/cmake/MySQL.cmake | 23 +++ linden/indra/cmake/NDOF.cmake | 14 ++ linden/indra/cmake/OpenGL.cmake | 9 ++ linden/indra/cmake/OpenJPEG.cmake | 22 +++ linden/indra/cmake/OpenSSL.cmake | 23 +++ linden/indra/cmake/PNG.cmake | 13 ++ linden/indra/cmake/Prebuilt.cmake | 44 ++++++ linden/indra/cmake/Python.cmake | 49 ++++++ linden/indra/cmake/QuickTime.cmake | 33 +++++ linden/indra/cmake/TemplateCheck.cmake | 14 ++ linden/indra/cmake/UI.cmake | 64 ++++++++ linden/indra/cmake/UnixInstall.cmake | 31 ++++ linden/indra/cmake/Variables.cmake | 100 +++++++++++++ linden/indra/cmake/ViewerMiscLibs.cmake | 10 ++ linden/indra/cmake/XmlRpcEpi.cmake | 17 +++ linden/indra/cmake/ZLIB.cmake | 20 +++ 72 files changed, 2653 insertions(+) create mode 100644 linden/indra/cmake/00-Common.cmake create mode 100644 linden/indra/cmake/APR.cmake create mode 100644 linden/indra/cmake/Audio.cmake create mode 100644 linden/indra/cmake/BerkeleyDB.cmake create mode 100644 linden/indra/cmake/Boost.cmake create mode 100644 linden/indra/cmake/BuildVersion.cmake create mode 100644 linden/indra/cmake/CARes.cmake create mode 100644 linden/indra/cmake/CMakeCopyIfDifferent.cmake create mode 100644 linden/indra/cmake/CSharpMacros.cmake create mode 100644 linden/indra/cmake/CURL.cmake create mode 100644 linden/indra/cmake/CommonMiscLibs.cmake create mode 100644 linden/indra/cmake/CopyBackToSource.cmake create mode 100644 linden/indra/cmake/CopyWinLibs.cmake create mode 100644 linden/indra/cmake/DirectX.cmake create mode 100644 linden/indra/cmake/ELFIO.cmake create mode 100644 linden/indra/cmake/EXPAT.cmake create mode 100644 linden/indra/cmake/FMOD.cmake create mode 100644 linden/indra/cmake/FindAPR.cmake create mode 100644 linden/indra/cmake/FindBerkeleyDB.cmake create mode 100644 linden/indra/cmake/FindCARes.cmake create mode 100644 linden/indra/cmake/FindELFIO.cmake create mode 100644 linden/indra/cmake/FindGooglePerfTools.cmake create mode 100644 linden/indra/cmake/FindMono.cmake create mode 100644 linden/indra/cmake/FindMySQL.cmake create mode 100644 linden/indra/cmake/FindOpenJPEG.cmake create mode 100644 linden/indra/cmake/FindSCP.cmake create mode 100644 linden/indra/cmake/FindXmlRpcEpi.cmake create mode 100644 linden/indra/cmake/FreeType.cmake create mode 100644 linden/indra/cmake/GStreamer.cmake create mode 100644 linden/indra/cmake/GooglePerfTools.cmake create mode 100644 linden/indra/cmake/JPEG.cmake create mode 100644 linden/indra/cmake/LLAudio.cmake create mode 100644 linden/indra/cmake/LLCharacter.cmake create mode 100644 linden/indra/cmake/LLCommon.cmake create mode 100644 linden/indra/cmake/LLCrashLogger.cmake create mode 100644 linden/indra/cmake/LLDatabase.cmake create mode 100644 linden/indra/cmake/LLImage.cmake create mode 100644 linden/indra/cmake/LLImageJ2COJ.cmake create mode 100644 linden/indra/cmake/LLInventory.cmake create mode 100644 linden/indra/cmake/LLKDU.cmake create mode 100644 linden/indra/cmake/LLMath.cmake create mode 100644 linden/indra/cmake/LLMedia.cmake create mode 100644 linden/indra/cmake/LLMessage.cmake create mode 100644 linden/indra/cmake/LLPhysics.cmake create mode 100644 linden/indra/cmake/LLPrimitive.cmake create mode 100644 linden/indra/cmake/LLRender.cmake create mode 100644 linden/indra/cmake/LLScene.cmake create mode 100644 linden/indra/cmake/LLUI.cmake create mode 100644 linden/indra/cmake/LLVFS.cmake create mode 100644 linden/indra/cmake/LLWindow.cmake create mode 100644 linden/indra/cmake/LLXML.cmake create mode 100644 linden/indra/cmake/LScript.cmake create mode 100644 linden/indra/cmake/Linking.cmake create mode 100644 linden/indra/cmake/MonoDeps.cmake create mode 100644 linden/indra/cmake/MonoEmbed.cmake create mode 100644 linden/indra/cmake/Mozlib.cmake create mode 100644 linden/indra/cmake/MySQL.cmake create mode 100644 linden/indra/cmake/NDOF.cmake create mode 100644 linden/indra/cmake/OpenGL.cmake create mode 100644 linden/indra/cmake/OpenJPEG.cmake create mode 100644 linden/indra/cmake/OpenSSL.cmake create mode 100644 linden/indra/cmake/PNG.cmake create mode 100644 linden/indra/cmake/Prebuilt.cmake create mode 100644 linden/indra/cmake/Python.cmake create mode 100644 linden/indra/cmake/QuickTime.cmake create mode 100644 linden/indra/cmake/TemplateCheck.cmake create mode 100644 linden/indra/cmake/UI.cmake create mode 100644 linden/indra/cmake/UnixInstall.cmake create mode 100644 linden/indra/cmake/Variables.cmake create mode 100644 linden/indra/cmake/ViewerMiscLibs.cmake create mode 100644 linden/indra/cmake/XmlRpcEpi.cmake create mode 100644 linden/indra/cmake/ZLIB.cmake (limited to 'linden/indra/cmake') diff --git a/linden/indra/cmake/00-Common.cmake b/linden/indra/cmake/00-Common.cmake new file mode 100644 index 0000000..240853a --- /dev/null +++ b/linden/indra/cmake/00-Common.cmake @@ -0,0 +1,206 @@ +# -*- cmake -*- +# +# Compilation options shared by all Second Life components. + +include(Variables) + + +# Portable compilation flags. + +set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1") +set(CMAKE_CXX_FLAGS_RELEASE + "-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "-DLL_RELEASE=1 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1") + + +# Don't bother with a MinSizeRel build. + +set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING + "Supported build types." FORCE) + + +# Platform-specific compilation flags. + +if (WINDOWS) + # Don't build DLLs. + set(BUILD_SHARED_LIBS OFF) + + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MTd" + CACHE STRING "C++ compiler debug options" FORCE) + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MT" + CACHE STRING "C++ compiler release-with-debug options" FORCE) + set(CMAKE_CXX_FLAGS_RELEASE + "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MT" + CACHE STRING "C++ compiler release options" FORCE) + + add_definitions( + /DLL_WINDOWS=1 + /DUNICODE + /D_UNICODE + /GS + /TP + /W3 + /c + /Zc:forScope + /nologo + /Oy- + ) + + if(MSVC80 OR MSVC90) + add_definitions( + /Zc:wchar_t- + ) + endif (MSVC80 OR MSVC90) + + # Are we using the crummy Visual Studio KDU build workaround? + if (NOT VS_DISABLE_FATAL_WARNINGS) + add_definitions(/WX) + endif (NOT VS_DISABLE_FATAL_WARNINGS) +endif (WINDOWS) + + +if (LINUX) + set(CMAKE_SKIP_RPATH TRUE) + + # Here's a giant hack for Fedora 8, where we can't use + # _FORTIFY_SOURCE if we're using a compiler older than gcc 4.1. + + find_program(GXX g++) + mark_as_advanced(GXX) + + if (GXX) + execute_process( + COMMAND ${GXX} --version + COMMAND sed "s/^[gc+ ]*//" + COMMAND head -1 + OUTPUT_VARIABLE GXX_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + else (GXX) + set(GXX_VERSION x) + endif (GXX) + + # The quoting hack here is necessary in case we're using distcc or + # ccache as our compiler. CMake doesn't pass the command line + # through the shell by default, so we end up trying to run "distcc" + # " g++" - notice the leading space. Ugh. + + execute_process( + COMMAND sh -c "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version" + COMMAND sed "s/^[gc+ ]*//" + COMMAND head -1 + OUTPUT_VARIABLE CXX_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if (${GXX_VERSION} STREQUAL ${CXX_VERSION}) + add_definitions(-D_FORTIFY_SOURCE=2) + else (${GXX_VERSION} STREQUAL ${CXX_VERSION}) + if (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat") + add_definitions(-D_FORTIFY_SOURCE=2) + endif (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat") + endif (${GXX_VERSION} STREQUAL ${CXX_VERSION}) + + # GCC 4.3 introduces a pile of obnoxious new warnings, which we + # treat as errors due to -Werror. Quiet the most offensive and + # widespread of them. + + if (${CXX_VERSION} MATCHES "4.3") + add_definitions(-Wno-deprecated -Wno-parentheses) + endif (${CXX_VERSION} MATCHES "4.3") + + # End of hacks. + + add_definitions( + -DLL_LINUX=1 + -D_REENTRANT + -fexceptions + -fno-math-errno + -fno-strict-aliasing + -fsigned-char + -g + -pthread + ) + + if (SERVER) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-60") + if (EXISTS /etc/debian_version) + FILE(READ /etc/debian_version DEBIAN_VERSION) + else (EXISTS /etc/debian_version) + set(DEBIAN_VERSION "") + endif (EXISTS /etc/debian_version) + + if (NOT DEBIAN_VERSION STREQUAL "3.1") + add_definitions(-DCTYPE_WORKAROUND) + endif (NOT DEBIAN_VERSION STREQUAL "3.1") + + if (EXISTS /usr/lib/mysql4/mysql) + link_directories(/usr/lib/mysql4/mysql) + endif (EXISTS /usr/lib/mysql4/mysql) + + add_definitions( + -msse2 + -mfpmath=sse + ) + endif (SERVER) + + if (VIEWER) + add_definitions(-DAPPID=secondlife) + add_definitions(-fvisibility=hidden) + if (NOT STANDALONE) + # this stops us requiring a really recent glibc at runtime + add_definitions(-fno-stack-protector) + endif (NOT STANDALONE) + endif (VIEWER) + + set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") + set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}") +endif (LINUX) + + +if (DARWIN) + add_definitions(-DLL_DARWIN=1) + set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch") +endif (DARWIN) + + +if (LINUX OR DARWIN) + set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs") + + if (NOT GCC_DISABLE_FATAL_WARNINGS) + set(GCC_WARNINGS "${GCC_WARNINGS} -Werror") + endif (NOT GCC_DISABLE_FATAL_WARNINGS) + + set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder") + + set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}") +endif (LINUX OR DARWIN) + + +if (STANDALONE) + add_definitions(-DLL_STANDALONE=1) + + if (LINUX AND ${ARCH} STREQUAL "i686") + add_definitions(-march=pentiumpro) + endif (LINUX AND ${ARCH} STREQUAL "i686") + +else (STANDALONE) + set(${ARCH}_linux_INCLUDES + ELFIO + atk-1.0 + glib-2.0 + gstreamer-0.10 + gtk-2.0 + llfreetype2 + pango-1.0 + ) +endif (STANDALONE) + +if(SERVER) + include_directories(${LIBS_PREBUILT_DIR}/include/havok) +endif(SERVER) diff --git a/linden/indra/cmake/APR.cmake b/linden/indra/cmake/APR.cmake new file mode 100644 index 0000000..2a96d70 --- /dev/null +++ b/linden/indra/cmake/APR.cmake @@ -0,0 +1,55 @@ +# -*- cmake -*- + +include(BerkeleyDB) +include(Linking) +include(Prebuilt) + +set(APR_FIND_QUIETLY ON) +set(APR_FIND_REQUIRED ON) + +set(APRUTIL_FIND_QUIETLY ON) +set(APRUTIL_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindAPR) +else (STANDALONE) + use_prebuilt_binary(apr_suite) + if (WINDOWS) + set(WINLIBS_PREBUILT_DEBUG_DIR + ${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug + ) + set(WINLIBS_PREBUILT_RELEASE_DIR + ${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release + ) + set(APR_LIBRARIES + debug ${WINLIBS_PREBUILT_DEBUG_DIR}/apr-1.lib + optimized ${WINLIBS_PREBUILT_RELEASE_DIR}/apr-1.lib + ) + set(APRUTIL_LIBRARIES + debug ${WINLIBS_PREBUILT_DEBUG_DIR}/aprutil-1.lib + optimized ${WINLIBS_PREBUILT_RELEASE_DIR}/aprutil-1.lib + ) + set(APRICONV_LIBRARIES + debug ${WINLIBS_PREBUILT_DEBUG_DIR}/apriconv-1.lib + optimized ${WINLIBS_PREBUILT_RELEASE_DIR}/apriconv-1.lib + ) + elseif (DARWIN) + set(APR_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a + ) + set(APRUTIL_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a + ) + set(APRICONV_LIBRARIES apriconv-1) + else (WINDOWS) + set(APR_LIBRARIES apr-1) + set(APRUTIL_LIBRARIES aprutil-1) + endif (WINDOWS) + set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/apr-1) + + if (LINUX AND VIEWER) + list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES}) + endif (LINUX AND VIEWER) +endif (STANDALONE) diff --git a/linden/indra/cmake/Audio.cmake b/linden/indra/cmake/Audio.cmake new file mode 100644 index 0000000..c6ccab2 --- /dev/null +++ b/linden/indra/cmake/Audio.cmake @@ -0,0 +1,34 @@ +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + include(FindPkgConfig) + pkg_check_modules(OGG REQUIRED ogg) + pkg_check_modules(VORBIS REQUIRED vorbis) + pkg_check_modules(VORBISENC REQUIRED vorbisenc) + pkg_check_modules(VORBISFILE REQUIRED vorbisfile) +else (STANDALONE) + use_prebuilt_binary(ogg-vorbis) + set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) + set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) + + if (WINDOWS) + set(OGG_LIBRARIES ogg_static_mt) + set(VORBIS_LIBRARIES vorbis_static_mt) + set(VORBISENC_LIBRARIES vorbisenc_static_mt) + set(VORBISFILE_LIBRARIES vorbisfile_static_mt) + else (WINDOWS) + set(OGG_LIBRARIES ogg) + set(VORBIS_LIBRARIES vorbis) + set(VORBISENC_LIBRARIES vorbisenc) + set(VORBISFILE_LIBRARIES vorbisfile) + endif (WINDOWS) +endif (STANDALONE) + +link_directories( + ${VORBIS_LIBRARY_DIRS} + ${VORBISENC_LIBRARY_DIRS} + ${VORBISFILE_LIBRARY_DIRS} + ${OGG_LIBRARY_DIRS} + ) diff --git a/linden/indra/cmake/BerkeleyDB.cmake b/linden/indra/cmake/BerkeleyDB.cmake new file mode 100644 index 0000000..d98e791 --- /dev/null +++ b/linden/indra/cmake/BerkeleyDB.cmake @@ -0,0 +1,11 @@ +# -*- cmake -*- + +set(DB_FIND_QUIETLY ON) +set(DB_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindBerkeleyDB) +else (STANDALONE) + set(DB_LIBRARIES db-4.2) + set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) +endif (STANDALONE) diff --git a/linden/indra/cmake/Boost.cmake b/linden/indra/cmake/Boost.cmake new file mode 100644 index 0000000..a7db67c --- /dev/null +++ b/linden/indra/cmake/Boost.cmake @@ -0,0 +1,49 @@ +# -*- cmake -*- +include(Prebuilt) + +set(Boost_FIND_QUIETLY ON) +set(Boost_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindBoost) + + set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) + set(BOOST_REGEX_LIBRARY boost_regex-mt) + set(BOOST_SIGNALS_LIBRARY boost_signals-mt) +else (STANDALONE) + use_prebuilt_binary(boost) + set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + + if (WINDOWS) + set(BOOST_VERSION 1_34_1) + if (MSVC71) + set(BOOST_PROGRAM_OPTIONS_LIBRARY + optimized libboost_program_options-vc71-mt-s-${BOOST_VERSION} + debug libboost_program_options-vc71-mt-sgd-${BOOST_VERSION}) + set(BOOST_REGEX_LIBRARY + optimized libboost_regex-vc71-mt-s-${BOOST_VERSION} + debug libboost_regex-vc71-mt-sgd-${BOOST_VERSION}) + set(BOOST_SIGNALS_LIBRARY + optimized libboost_signals-vc71-mt-s-${BOOST_VERSION} + debug libboost_signals-vc71-mt-sgd-${BOOST_VERSION}) + else (MSVC71) + set(BOOST_PROGRAM_OPTIONS_LIBRARY + optimized libboost_program_options-vc80-mt-s-${BOOST_VERSION} + debug libboost_program_options-vc80-mt-sgd-${BOOST_VERSION}) + set(BOOST_REGEX_LIBRARY + optimized libboost_regex-vc80-mt-s-${BOOST_VERSION} + debug libboost_regex-vc80-mt-sgd-${BOOST_VERSION}) + set(BOOST_SIGNALS_LIBRARY + optimized libboost_signals-vc80-mt-s-${BOOST_VERSION} + debug libboost_signals-vc80-mt-sgd-${BOOST_VERSION}) + endif (MSVC71) + elseif (DARWIN) + set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) + set(BOOST_REGEX_LIBRARY boost_regex-mt) + set(BOOST_SIGNALS_LIBRARY boost_signals-mt) + elseif (LINUX) + set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) + set(BOOST_REGEX_LIBRARY boost_regex-mt) + set(BOOST_SIGNALS_LIBRARY boost_signals-mt) + endif (WINDOWS) +endif (STANDALONE) diff --git a/linden/indra/cmake/BuildVersion.cmake b/linden/indra/cmake/BuildVersion.cmake new file mode 100644 index 0000000..60a519c --- /dev/null +++ b/linden/indra/cmake/BuildVersion.cmake @@ -0,0 +1,18 @@ +# -*- cmake -*- + +include(Python) + +macro (build_version _target) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/build_version.py + llversion${_target}.h ${LLCOMMON_INCLUDE_DIRS} + OUTPUT_VARIABLE ${_target}_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if (${_target}_VERSION) + message(STATUS "Version of ${_target} is ${${_target}_VERSION}") + else (${_target}_VERSION) + message(SEND_ERROR "Could not determine ${_target} version") + endif (${_target}_VERSION) +endmacro (build_version) diff --git a/linden/indra/cmake/CARes.cmake b/linden/indra/cmake/CARes.cmake new file mode 100644 index 0000000..8a2dc01 --- /dev/null +++ b/linden/indra/cmake/CARes.cmake @@ -0,0 +1,23 @@ +# -*- cmake -*- +include(Linking) +include(Prebuilt) + +set(CARES_FIND_QUIETLY ON) +set(CARES_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindCARes) +else (STANDALONE) + use_prebuilt_binary(ares) + if (WINDOWS) + set(CARES_LIBRARIES areslib) + elseif (DARWIN) + set(CARES_LIBRARIES + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libcares.a + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libcares.a + ) + else (WINDOWS) + set(CARES_LIBRARIES cares) + endif (WINDOWS) + set(CARES_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/ares) +endif (STANDALONE) diff --git a/linden/indra/cmake/CMakeCopyIfDifferent.cmake b/linden/indra/cmake/CMakeCopyIfDifferent.cmake new file mode 100644 index 0000000..55e71ff --- /dev/null +++ b/linden/indra/cmake/CMakeCopyIfDifferent.cmake @@ -0,0 +1,41 @@ +# -*- cmake -*- +# Taken from http://www.cmake.org/Wiki/CMakeCopyIfDifferent +# Generates a rule to copy each source file from source directory to destination directory. +# +# Typical use - +# +# SET(SRC_FILES head1.h head2.h head3.h) +# COPY_IF_DIFFERENT( /from_dir /to_dir IncludeTargets ${SRC_FILES}) +# ADD_TARGET(CopyIncludes ALL DEPENDS ${IncludeTargets}) + +MACRO(COPY_IF_DIFFERENT FROM_DIR TO_DIR TARGETS) +# Macro to implement copy_if_different for a list of files +# Arguments - +# FROM_DIR - this is the source directory +# TO_DIR - this is the destination directory +# TARGETS - A variable to receive a list of targets +# FILES - names of the files to copy +# TODO: add globing. +SET(AddTargets "") +FOREACH(SRC ${ARGN}) + GET_FILENAME_COMPONENT(SRCFILE ${SRC} NAME) + IF("${FROM_DIR}" STREQUAL "") + SET(FROM ${SRC}) + ELSE("${FROM_DIR}" STREQUAL "") + SET(FROM ${FROM_DIR}/${SRC}) + ENDIF("${FROM_DIR}" STREQUAL "") + IF("${TO_DIR}" STREQUAL "") + SET(TO ${SRCFILE}) + ELSE("${TO_DIR}" STREQUAL "") + SET(TO ${TO_DIR}/${SRCFILE}) + ENDIF("${TO_DIR}" STREQUAL "") + ADD_CUSTOM_COMMAND( + OUTPUT "${TO}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FROM} ${TO} + DEPENDS ${FROM} + COMMENT "Copying ${SRCFILE} ${TO_DIR}" + ) + SET(AddTargets ${AddTargets} ${TO}) +ENDFOREACH(SRC ${ARGN}) +SET(${TARGETS} ${AddTargets}) +ENDMACRO(COPY_IF_DIFFERENT FROM_DIR TO_DIR TARGETS) diff --git a/linden/indra/cmake/CSharpMacros.cmake b/linden/indra/cmake/CSharpMacros.cmake new file mode 100644 index 0000000..a4dd815 --- /dev/null +++ b/linden/indra/cmake/CSharpMacros.cmake @@ -0,0 +1,142 @@ +# - This is a support module for easy Mono/C# handling with CMake +# It defines the following macros: +# +# ADD_CS_LIBRARY ( ) +# ADD_CS_EXECUTABLE ( ) +# INSTALL_GAC () +# +# Note that the order of the arguments is important. +# +# You can optionally set the variable CS_FLAGS to tell the macros whether +# to pass additional flags to the compiler. This is particularly useful to +# set assembly references, unsafe code, etc... These flags are always reset +# after the target was added so you don't have to care about that. +# +# copyright (c) 2007 Arno Rehn arno@arnorehn.de +# +# Redistribution and use is allowed according to the terms of the GPL license. + + +# ----- support macros ----- +MACRO(GET_CS_LIBRARY_TARGET_DIR) + IF (NOT LIBRARY_OUTPUT_PATH) + SET(CS_LIBRARY_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR}) + ELSE (NOT LIBRARY_OUTPUT_PATH) + SET(CS_LIBRARY_TARGET_DIR ${LIBRARY_OUTPUT_PATH}) + ENDIF (NOT LIBRARY_OUTPUT_PATH) +ENDMACRO(GET_CS_LIBRARY_TARGET_DIR) + +MACRO(GET_CS_EXECUTABLE_TARGET_DIR) + IF (NOT EXECUTABLE_OUTPUT_PATH) + SET(CS_EXECUTABLE_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR}) + ELSE (NOT EXECUTABLE_OUTPUT_PATH) + SET(CS_EXECUTABLE_TARGET_DIR ${EXECUTABLE_OUTPUT_PATH}) + ENDIF (NOT EXECUTABLE_OUTPUT_PATH) +ENDMACRO(GET_CS_EXECUTABLE_TARGET_DIR) + +MACRO(MAKE_PROPER_FILE_LIST) + FOREACH(file ${ARGN}) + # first assume it's a relative path + FILE(GLOB globbed ${CMAKE_CURRENT_SOURCE_DIR}/${file}) + IF(globbed) + FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${file} native) + ELSE(globbed) + FILE(TO_NATIVE_PATH ${file} native) + ENDIF(globbed) + SET(proper_file_list ${proper_file_list} ${native}) + SET(native "") + ENDFOREACH(file) +ENDMACRO(MAKE_PROPER_FILE_LIST) +# ----- end support macros ----- + +MACRO(ADD_CS_LIBRARY target) + GET_CS_LIBRARY_TARGET_DIR() + + SET(target_DLL "${CS_LIBRARY_TARGET_DIR}/${target}.dll") + MAKE_PROPER_FILE_LIST(${ARGN}) + FILE(RELATIVE_PATH relative_path ${CMAKE_BINARY_DIR} ${target_DLL}) + + SET(target_KEY "${CMAKE_CURRENT_SOURCE_DIR}/${target}.key") + SET(target_CS_FLAGS "${CS_FLAGS}") + IF(${target}_CS_FLAGS) + LIST(APPEND target_CS_FLAGS ${${target}_CS_FLAGS}) + ENDIF(${target}_CS_FLAGS) + IF(EXISTS ${target_KEY}) + LIST(APPEND target_CS_FLAGS -keyfile:${target_KEY}) + ENDIF(EXISTS ${target_KEY}) + + FOREACH(ref ${${target}_REFS}) + SET(ref_DLL ${CMAKE_CURRENT_BINARY_DIR}/${ref}.dll) + IF(EXISTS ${ref_DLL}) + LIST(APPEND target_CS_FLAGS -r:${ref_DLL}) + ELSE(EXISTS ${ref_DLL}) + LIST(APPEND target_CS_FLAGS -r:${ref}) + ENDIF(EXISTS ${ref_DLL}) + ENDFOREACH(ref ${${target}_REFS}) + + ADD_CUSTOM_COMMAND (OUTPUT ${target_DLL} + COMMAND ${MCS_EXECUTABLE} ${target_CS_FLAGS} -out:${target_DLL} -target:library ${proper_file_list} + MAIN_DEPENDENCY ${proper_file_list} + DEPENDS ${ARGN} + COMMENT "Building ${relative_path}") + ADD_CUSTOM_TARGET (${target} ALL DEPENDS ${target_DLL}) + + FOREACH(ref ${${target}_REFS}) + GET_TARGET_PROPERTY(is_target ${ref} TYPE) + IF(is_target) + ADD_DEPENDENCIES(${target} ${ref}) + ENDIF(is_target) + ENDFOREACH(ref ${${target}_REFS}) + + SET(relative_path "") + SET(proper_file_list "") +ENDMACRO(ADD_CS_LIBRARY) + +MACRO(ADD_CS_EXECUTABLE target) + GET_CS_EXECUTABLE_TARGET_DIR() + + # Seems like cmake doesn't like the ".exe" ending for custom commands. + # If we call it ${target}.exe, 'make' will later complain about a missing rule. + # Create a fake target instead. + SET(target_EXE "${CS_EXECUTABLE_TARGET_DIR}/${target}.exe") + SET(target_TOUCH "${CS_EXECUTABLE_TARGET_DIR}/${target}.exe-built") + GET_DIRECTORY_PROPERTY(clean ADDITIONAL_MAKE_CLEAN_FILES) + LIST(APPEND clean ${target}.exe) + SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${clean}") + MAKE_PROPER_FILE_LIST(${ARGN}) + FILE(RELATIVE_PATH relative_path ${CMAKE_BINARY_DIR} ${target_EXE}) + SET(target_CS_FLAGS "${CS_FLAGS}") + + FOREACH(ref ${${target}_REFS}) + SET(ref_DLL ${CMAKE_CURRENT_SOURCE_DIR}/${ref}.dll) + IF(EXISTS ${ref_DLL}) + LIST(APPEND target_CS_FLAGS -r:${ref_DLL}) + ELSE(EXISTS ${ref_DLL}) + LIST(APPEND target_CS_FLAGS -r:${ref}) + ENDIF(EXISTS ${ref_DLL}) + ENDFOREACH(ref ${${target}_REFS}) + + ADD_CUSTOM_COMMAND (OUTPUT "${target_TOUCH}" + COMMAND ${MCS_EXECUTABLE} ${target_CS_FLAGS} -out:${target_EXE} ${proper_file_list} + COMMAND ${CMAKE_COMMAND} -E touch ${target_TOUCH} + MAIN_DEPENDENCY ${ARGN} + DEPENDS ${ARGN} + COMMENT "Building ${relative_path}") + ADD_CUSTOM_TARGET ("${target}" ALL DEPENDS "${target_TOUCH}") + + FOREACH(ref ${${target}_REFS}) + GET_TARGET_PROPERTY(is_target ${ref} TYPE) + IF(is_target) + ADD_DEPENDENCIES(${target} ${ref}) + ENDIF(is_target) + ENDFOREACH(ref ${${target}_REFS}) + + SET(relative_path "") + SET(proper_file_list "") +ENDMACRO(ADD_CS_EXECUTABLE) + +MACRO(INSTALL_GAC target) + GET_CS_LIBRARY_TARGET_DIR() + + INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${GACUTIL_EXECUTABLE} -i ${CS_LIBRARY_TARGET_DIR}/${target}.dll -package 2.0)") +ENDMACRO(INSTALL_GAC target) diff --git a/linden/indra/cmake/CURL.cmake b/linden/indra/cmake/CURL.cmake new file mode 100644 index 0000000..6e5fed4 --- /dev/null +++ b/linden/indra/cmake/CURL.cmake @@ -0,0 +1,19 @@ +# -*- cmake -*- +include(Prebuilt) + +set(CURL_FIND_QUIETLY ON) +set(CURL_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindCURL) +else (STANDALONE) + use_prebuilt_binary(curl) + if (WINDOWS) + set(CURL_LIBRARIES + debug libcurld + optimized libcurl) + else (WINDOWS) + set(CURL_LIBRARIES curl) + endif (WINDOWS) + set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) +endif (STANDALONE) diff --git a/linden/indra/cmake/CommonMiscLibs.cmake b/linden/indra/cmake/CommonMiscLibs.cmake new file mode 100644 index 0000000..513acf3 --- /dev/null +++ b/linden/indra/cmake/CommonMiscLibs.cmake @@ -0,0 +1,7 @@ +# -*- cmake -*- +include(Prebuilt) + +if (NOT STANDALONE) + use_prebuilt_binary(tut) +endif(NOT STANDALONE) + diff --git a/linden/indra/cmake/CopyBackToSource.cmake b/linden/indra/cmake/CopyBackToSource.cmake new file mode 100644 index 0000000..d217df9 --- /dev/null +++ b/linden/indra/cmake/CopyBackToSource.cmake @@ -0,0 +1,16 @@ +# -*- cmake -*- +# Copies a binary back to the source directory + +MACRO(COPY_BACK_TO_SOURCE target) + GET_TARGET_PROPERTY(FROM ${target} LOCATION) + SET(TO ${CMAKE_CURRENT_SOURCE_DIR}) + #MESSAGE("TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}") + ADD_CUSTOM_COMMAND( + TARGET ${target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO} + DEPENDS ${FROM} + COMMENT "Copying ${target} to ${CMAKE_CURRENT_BINARY_DIR}" + ) +ENDMACRO(COPY_BACK_TO_SOURCE) + + diff --git a/linden/indra/cmake/CopyWinLibs.cmake b/linden/indra/cmake/CopyWinLibs.cmake new file mode 100644 index 0000000..345761a --- /dev/null +++ b/linden/indra/cmake/CopyWinLibs.cmake @@ -0,0 +1,155 @@ +# -*- cmake -*- + +# The copy_win_libs folder contains file lists and a script used to +# copy dlls, exes and such needed to run the SecondLife from within +# VisualStudio. + +include(CMakeCopyIfDifferent) + +set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32") +set(vivox_files + tntk.dll + libeay32.dll + SLVoice.exe + ssleay32.dll + SLVoiceAgent.exe + srtp.dll + alut.dll + vivoxsdk.dll + ortp.dll + wrap_oal.dll + ) + +set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug") +set(debug_files + freebl3.dll + gksvggdiplus.dll + js3250.dll + nspr4.dll + nss3.dll + nssckbi.dll + plc4.dll + plds4.dll + smime3.dll + softokn3.dll + ssl3.dll + xpcom.dll + xul.dll + openjpegd.dll + windbgdlg.exe + ) + +copy_if_different( + ${debug_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/Debug" + out_targets + ${debug_files} + ) +set(all_targets ${all_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/Debug" + out_targets + ${vivox_files} + ) +set(all_targets ${all_targets} ${out_targets}) + +set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") +set(release_files + freebl3.dll + gksvggdiplus.dll + js3250.dll + nspr4.dll + nss3.dll + nssckbi.dll + plc4.dll + plds4.dll + smime3.dll + softokn3.dll + ssl3.dll + xpcom.dll + xul.dll + openjpeg.dll + ) + +copy_if_different( + ${release_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/Release" + out_targets + ${release_files} + ) +set(all_targets ${all_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/Release" + out_targets + ${vivox_files} + ) +set(all_targets ${all_targets} ${out_targets}) + +copy_if_different( + ${release_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" + out_targets + ${release_files} + ) +set(all_targets ${all_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" + out_targets + ${vivox_files} + ) +set(all_targets ${all_targets} ${out_targets}) + +set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") +if(EXISTS ${internal_llkdu_path}) + set(internal_llkdu_src "${CMAKE_BINARY_DIR}/llkdu/${CMAKE_CFG_INTDIR}/llkdu.dll") + set(llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${internal_llkdu_src} ${llkdu_dst} + DEPENDS ${internal_llkdu_src} + COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" + ) + set(all_targets ${all_targets} ${llkdu_dst}) +else(EXISTS ${internal_llkdu_path}) + set(debug_llkdu_src "${debug_src_dir}/llkdu.dll") + set(debug_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/Debug/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${debug_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst} + DEPENDS ${debug_llkdu_src} + COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/Debug" + ) + set(all_targets ${all_targets} ${debug_llkdu_dst}) + + set(release_llkdu_src "${release_src_dir}/llkdu.dll") + set(release_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/Release/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${release_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst} + DEPENDS ${release_llkdu_src} + COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/Release" + ) + set(all_targets ${all_targets} ${release_llkdu_dst}) + + set(relwithdebinfo_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${relwithdebinfo_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst} + DEPENDS ${release_llkdu_src} + COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" + ) + set(all_targets ${all_targets} ${relwithdebinfo_llkdu_dst}) + +endif (EXISTS ${internal_llkdu_path}) + +add_custom_target(copy_win_libs ALL DEPENDS ${all_targets}) + +if(EXISTS ${internal_llkdu_path}) + add_dependencies(copy_win_libs llkdu) +endif(EXISTS ${internal_llkdu_path}) diff --git a/linden/indra/cmake/DirectX.cmake b/linden/indra/cmake/DirectX.cmake new file mode 100644 index 0000000..4d2d5e0 --- /dev/null +++ b/linden/indra/cmake/DirectX.cmake @@ -0,0 +1,40 @@ +# -*- cmake -*- + +if (VIEWER AND WINDOWS) + find_path(DIRECTX_INCLUDE_DIR dxdiag.h + "$ENV{DXSDK_DIR}/Include" + "C:/Program Files/Microsoft DirectX SDK (June 2008)/Include" + "C:/Program Files/Microsoft DirectX SDK (March 2008)/Include" + "C:/Program Files/Microsoft DirectX SDK (November 2007)/Include" + "C:/Program Files/Microsoft DirectX SDK (August 2007)/Include" + "C:/DX90SDK/Include" + "C:/Program Files/DX90SDK/Include" + ) + if (DIRECTX_INCLUDE_DIR) + include_directories(${DIRECTX_INCLUDE_DIR}) + if (DIRECTX_FIND_QUIETLY) + message(STATUS "Found DirectX include: ${DIRECTX_INCLUDE_DIR}") + endif (DIRECTX_FIND_QUIETLY) + else (DIRECTX_INCLUDE_DIR) + message(FATAL_ERROR "Could not find DirectX SDK Include") + endif (DIRECTX_INCLUDE_DIR) + + + find_path(DIRECTX_LIBRARY_DIR dxguid.lib + "$ENV{DXSDK_DIR}/Lib/x86" + "C:/Program Files/Microsoft DirectX SDK (June 2008)/Lib/x86" + "C:/Program Files/Microsoft DirectX SDK (March 2008)/Lib/x86" + "C:/Program Files/Microsoft DirectX SDK (November 2007)/Lib/x86" + "C:/Program Files/Microsoft DirectX SDK (August 2007)/Lib/x86" + "C:/DX90SDK/Lib" + "C:/Program Files/DX90SDK/Lib" + ) + if (DIRECTX_LIBRARY_DIR) + if (DIRECTX_FIND_QUIETLY) + message(STATUS "Found DirectX include: ${DIRECTX_LIBRARY_DIR}") + endif (DIRECTX_FIND_QUIETLY) + else (DIRECTX_LIBRARY_DIR) + message(FATAL_ERROR "Could not find DirectX SDK Libraries") + endif (DIRECTX_LIBRARY_DIR) + +endif (VIEWER AND WINDOWS) diff --git a/linden/indra/cmake/ELFIO.cmake b/linden/indra/cmake/ELFIO.cmake new file mode 100644 index 0000000..e51993b --- /dev/null +++ b/linden/indra/cmake/ELFIO.cmake @@ -0,0 +1,19 @@ +# -*- cmake -*- +include(Prebuilt) + +set(ELFIO_FIND_QUIETLY ON) + +if (STANDALONE) + include(FindELFIO) +elseif (LINUX) + use_prebuilt_binary(elfio) + set(ELFIO_LIBRARIES ELFIO) + set(ELFIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) + set(ELFIO_FOUND "YES") +endif (STANDALONE) + +if (ELFIO_FOUND) + add_definitions(-DLL_ELFBIN=1) +else (ELFIO_FOUND) + set(ELFIO_INCLUDE_DIR "") +endif (ELFIO_FOUND) diff --git a/linden/indra/cmake/EXPAT.cmake b/linden/indra/cmake/EXPAT.cmake new file mode 100644 index 0000000..acb15dc --- /dev/null +++ b/linden/indra/cmake/EXPAT.cmake @@ -0,0 +1,17 @@ +# -*- cmake -*- +include(Prebuilt) + +set(EXPAT_FIND_QUIETLY ON) +set(EXPAT_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindEXPAT) +else (STANDALONE) + use_prebuilt_binary(expat) + if (WINDOWS) + set(EXPAT_LIBRARIES libexpatMT) + else (WINDOWS) + set(EXPAT_LIBRARIES expat) + endif (WINDOWS) + set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) +endif (STANDALONE) diff --git a/linden/indra/cmake/FMOD.cmake b/linden/indra/cmake/FMOD.cmake new file mode 100644 index 0000000..759b8f1 --- /dev/null +++ b/linden/indra/cmake/FMOD.cmake @@ -0,0 +1,64 @@ +# -*- cmake -*- + +include(Linking) + +if(INSTALL_PROPRIETARY) + include(Prebuilt) + use_prebuilt_binary(fmod) +endif(INSTALL_PROPRIETARY) + +find_library(FMOD_LIBRARY_RELEASE + NAMES fmod fmodvc fmod-3.75 + PATHS + ${ARCH_PREBUILT_DIRS_RELEASE} + ) + +find_library(FMOD_LIBRARY_DEBUG + NAMES fmod fmodvc fmod-3.75 + PATHS + ${ARCH_PREBUILT_DIRS_DEBUG} + ) + +if (FMOD_LIBRARY_RELEASE AND FMOD_LIBRARY_DEBUG) + set(FMOD_LIBRARY + debug ${FMOD_LIBRARY_DEBUG} + optimized ${FMOD_LIBRARY_RELEASE}) +elseif (FMOD_LIBRARY_RELEASE) + set(FMOD_LIBRARY ${FMOD_LIBRARY_RELEASE}) +endif (FMOD_LIBRARY_RELEASE AND FMOD_LIBRARY_DEBUG) + +if (NOT FMOD_LIBRARY) + set(FMOD_SDK_DIR CACHE PATH "Path to the FMOD SDK.") + if (FMOD_SDK_DIR) + find_library(FMOD_LIBRARY + NAMES fmodvc fmod-3.75 fmod + PATHS + ${FMOD_SDK_DIR}/api/lib + ${FMOD_SDK_DIR}/api + ${FMOD_SDK_DIR}/lib + ${FMOD_SDK_DIR} + ) + endif (FMOD_SDK_DIR) +endif (NOT FMOD_LIBRARY) + +find_path(FMOD_INCLUDE_DIR fmod.h + ${LIBS_PREBUILT_DIR}/include + ${FMOD_SDK_DIR}/api/inc + ${FMOD_SDK_DIR}/inc + ${FMOD_SDK_DIR} + ) + +if (FMOD_LIBRARY AND FMOD_INCLUDE_DIR) + set(FMOD ON CACHE BOOL "Use closed source FMOD sound library.") +else (FMOD_LIBRARY AND FMOD_INCLUDE_DIR) + set(FMOD_LIBRARY "") + set(FMOD_INCLUDE_DIR "") + if (FMOD) + message(STATUS "No support for FMOD audio (need to set FMOD_SDK_DIR?)") + endif (FMOD) + set(FMOD OFF CACHE BOOL "Use closed source FMOD sound library.") +endif (FMOD_LIBRARY AND FMOD_INCLUDE_DIR) + +if (FMOD) + message(STATUS "Building with FMOD audio support") +endif (FMOD) diff --git a/linden/indra/cmake/FindAPR.cmake b/linden/indra/cmake/FindAPR.cmake new file mode 100644 index 0000000..906b6c9 --- /dev/null +++ b/linden/indra/cmake/FindAPR.cmake @@ -0,0 +1,94 @@ +# -*- cmake -*- + +# - Find Apache Portable Runtime +# Find the APR includes and libraries +# This module defines +# APR_INCLUDE_DIR and APRUTIL_INCLUDE_DIR, where to find apr.h, etc. +# APR_LIBRARIES and APRUTIL_LIBRARIES, the libraries needed to use APR. +# APR_FOUND and APRUTIL_FOUND, If false, do not try to use APR. +# also defined, but not for general use are +# APR_LIBRARY and APRUTIL_LIBRARY, where to find the APR library. + +# APR first. + +FIND_PATH(APR_INCLUDE_DIR apr.h +/usr/local/include/apr-1 +/usr/local/include/apr-1.0 +/usr/include/apr-1 +/usr/include/apr-1.0 +) + +SET(APR_NAMES ${APR_NAMES} apr-1) +FIND_LIBRARY(APR_LIBRARY + NAMES ${APR_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (APR_LIBRARY AND APR_INCLUDE_DIR) + SET(APR_LIBRARIES ${APR_LIBRARY}) + SET(APR_FOUND "YES") +ELSE (APR_LIBRARY AND APR_INCLUDE_DIR) + SET(APR_FOUND "NO") +ENDIF (APR_LIBRARY AND APR_INCLUDE_DIR) + + +IF (APR_FOUND) + IF (NOT APR_FIND_QUIETLY) + MESSAGE(STATUS "Found APR: ${APR_LIBRARIES}") + ENDIF (NOT APR_FIND_QUIETLY) +ELSE (APR_FOUND) + IF (APR_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find APR library") + ENDIF (APR_FIND_REQUIRED) +ENDIF (APR_FOUND) + +# Deprecated declarations. +SET (NATIVE_APR_INCLUDE_PATH ${APR_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_APR_LIB_PATH ${APR_LIBRARY} PATH) + +MARK_AS_ADVANCED( + APR_LIBRARY + APR_INCLUDE_DIR + ) + +# Next, APRUTIL. + +FIND_PATH(APRUTIL_INCLUDE_DIR apu.h +/usr/local/include/apr-1 +/usr/local/include/apr-1.0 +/usr/include/apr-1 +/usr/include/apr-1.0 +) + +SET(APRUTIL_NAMES ${APRUTIL_NAMES} aprutil-1) +FIND_LIBRARY(APRUTIL_LIBRARY + NAMES ${APRUTIL_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) + SET(APRUTIL_LIBRARIES ${APRUTIL_LIBRARY}) + SET(APRUTIL_FOUND "YES") +ELSE (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) + SET(APRUTIL_FOUND "NO") +ENDIF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) + + +IF (APRUTIL_FOUND) + IF (NOT APRUTIL_FIND_QUIETLY) + MESSAGE(STATUS "Found APRUTIL: ${APRUTIL_LIBRARIES}") + ENDIF (NOT APRUTIL_FIND_QUIETLY) +ELSE (APRUTIL_FOUND) + IF (APRUTIL_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find APRUTIL library") + ENDIF (APRUTIL_FIND_REQUIRED) +ENDIF (APRUTIL_FOUND) + +# Deprecated declarations. +SET (NATIVE_APRUTIL_INCLUDE_PATH ${APRUTIL_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_APRUTIL_LIB_PATH ${APRUTIL_LIBRARY} PATH) + +MARK_AS_ADVANCED( + APRUTIL_LIBRARY + APRUTIL_INCLUDE_DIR + ) diff --git a/linden/indra/cmake/FindBerkeleyDB.cmake b/linden/indra/cmake/FindBerkeleyDB.cmake new file mode 100644 index 0000000..2d633c7 --- /dev/null +++ b/linden/indra/cmake/FindBerkeleyDB.cmake @@ -0,0 +1,50 @@ +# -*- cmake -*- + +# - Find BerkeleyDB +# Find the BerkeleyDB includes and library +# This module defines +# DB_INCLUDE_DIR, where to find db.h, etc. +# DB_LIBRARIES, the libraries needed to use BerkeleyDB. +# DB_FOUND, If false, do not try to use BerkeleyDB. +# also defined, but not for general use are +# DB_LIBRARY, where to find the BerkeleyDB library. + +FIND_PATH(DB_INCLUDE_DIR db.h +/usr/local/include/db4 +/usr/local/include +/usr/include/db4 +/usr/include +) + +SET(DB_NAMES ${DB_NAMES} db) +FIND_LIBRARY(DB_LIBRARY + NAMES ${DB_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (DB_LIBRARY AND DB_INCLUDE_DIR) + SET(DB_LIBRARIES ${DB_LIBRARY}) + SET(DB_FOUND "YES") +ELSE (DB_LIBRARY AND DB_INCLUDE_DIR) + SET(DB_FOUND "NO") +ENDIF (DB_LIBRARY AND DB_INCLUDE_DIR) + + +IF (DB_FOUND) + IF (NOT DB_FIND_QUIETLY) + MESSAGE(STATUS "Found BerkeleyDB: ${DB_LIBRARIES}") + ENDIF (NOT DB_FIND_QUIETLY) +ELSE (DB_FOUND) + IF (DB_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find BerkeleyDB library") + ENDIF (DB_FIND_REQUIRED) +ENDIF (DB_FOUND) + +# Deprecated declarations. +SET (NATIVE_DB_INCLUDE_PATH ${DB_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_DB_LIB_PATH ${DB_LIBRARY} PATH) + +MARK_AS_ADVANCED( + DB_LIBRARY + DB_INCLUDE_DIR + ) diff --git a/linden/indra/cmake/FindCARes.cmake b/linden/indra/cmake/FindCARes.cmake new file mode 100644 index 0000000..1ed5b32 --- /dev/null +++ b/linden/indra/cmake/FindCARes.cmake @@ -0,0 +1,48 @@ +# -*- cmake -*- + +# - Find c-ares +# Find the c-ares includes and library +# This module defines +# CARES_INCLUDE_DIR, where to find ares.h, etc. +# CARES_LIBRARIES, the libraries needed to use c-ares. +# CARES_FOUND, If false, do not try to use c-ares. +# also defined, but not for general use are +# CARES_LIBRARY, where to find the c-ares library. + +FIND_PATH(CARES_INCLUDE_DIR ares.h +/usr/local/include +/usr/include +) + +SET(CARES_NAMES ${CARES_NAMES} cares) +FIND_LIBRARY(CARES_LIBRARY + NAMES ${CARES_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (CARES_LIBRARY AND CARES_INCLUDE_DIR) + SET(CARES_LIBRARIES ${CARES_LIBRARY}) + SET(CARES_FOUND "YES") +ELSE (CARES_LIBRARY AND CARES_INCLUDE_DIR) + SET(CARES_FOUND "NO") +ENDIF (CARES_LIBRARY AND CARES_INCLUDE_DIR) + + +IF (CARES_FOUND) + IF (NOT CARES_FIND_QUIETLY) + MESSAGE(STATUS "Found c-ares: ${CARES_LIBRARIES}") + ENDIF (NOT CARES_FIND_QUIETLY) +ELSE (CARES_FOUND) + IF (CARES_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find c-ares library") + ENDIF (CARES_FIND_REQUIRED) +ENDIF (CARES_FOUND) + +# Deprecated declarations. +SET (NATIVE_CARES_INCLUDE_PATH ${CARES_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_CARES_LIB_PATH ${CARES_LIBRARY} PATH) + +MARK_AS_ADVANCED( + CARES_LIBRARY + CARES_INCLUDE_DIR + ) diff --git a/linden/indra/cmake/FindELFIO.cmake b/linden/indra/cmake/FindELFIO.cmake new file mode 100644 index 0000000..8a5421a --- /dev/null +++ b/linden/indra/cmake/FindELFIO.cmake @@ -0,0 +1,48 @@ +# -*- cmake -*- + +# - Find ELFIO +# Find the ELFIO includes and library +# This module defines +# ELFIO_INCLUDE_DIR, where to find elfio.h, etc. +# ELFIO_LIBRARIES, the libraries needed to use ELFIO. +# ELFIO_FOUND, If false, do not try to use ELFIO. +# also defined, but not for general use are +# ELFIO_LIBRARY, where to find the ELFIO library. + +FIND_PATH(ELFIO_INCLUDE_DIR ELFIO/ELFIO.h +/usr/local/include +/usr/include +) + +SET(ELFIO_NAMES ${ELFIO_NAMES} ELFIO) +FIND_LIBRARY(ELFIO_LIBRARY + NAMES ${ELFIO_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR) + SET(ELFIO_LIBRARIES ${ELFIO_LIBRARY}) + SET(ELFIO_FOUND "YES") +ELSE (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR) + SET(ELFIO_FOUND "NO") +ENDIF (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR) + + +IF (ELFIO_FOUND) + IF (NOT ELFIO_FIND_QUIETLY) + MESSAGE(STATUS "Found ELFIO: ${ELFIO_LIBRARIES}") + ENDIF (NOT ELFIO_FIND_QUIETLY) +ELSE (ELFIO_FOUND) + IF (ELFIO_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find ELFIO library") + ENDIF (ELFIO_FIND_REQUIRED) +ENDIF (ELFIO_FOUND) + +# Deprecated declarations. +SET (NATIVE_ELFIO_INCLUDE_PATH ${ELFIO_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_ELFIO_LIB_PATH ${ELFIO_LIBRARY} PATH) + +MARK_AS_ADVANCED( + ELFIO_LIBRARY + ELFIO_INCLUDE_DIR + ) diff --git a/linden/indra/cmake/FindGooglePerfTools.cmake b/linden/indra/cmake/FindGooglePerfTools.cmake new file mode 100644 index 0000000..bb125d5 --- /dev/null +++ b/linden/indra/cmake/FindGooglePerfTools.cmake @@ -0,0 +1,66 @@ +# -*- cmake -*- + +# - Find Google perftools +# Find the Google perftools includes and libraries +# This module defines +# GOOGLE_PERFTOOLS_INCLUDE_DIR, where to find heap-profiler.h, etc. +# GOOGLE_PERFTOOLS_FOUND, If false, do not try to use Google perftools. +# also defined for general use are +# TCMALLOC_LIBRARIES, where to find the tcmalloc library. +# STACKTRACE_LIBRARIES, where to find the stacktrace library. +# PROFILER_LIBRARIES, where to find the profiler library. + +FIND_PATH(GOOGLE_PERFTOOLS_INCLUDE_DIR google/heap-profiler.h +/usr/local/include +/usr/include +) + +SET(TCMALLOC_NAMES ${TCMALLOC_NAMES} tcmalloc) +FIND_LIBRARY(TCMALLOC_LIBRARY + NAMES ${TCMALLOC_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) + SET(TCMALLOC_LIBRARIES ${TCMALLOC_LIBRARY}) + SET(GOOGLE_PERFTOOLS_FOUND "YES") +ELSE (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) + SET(GOOGLE_PERFTOOLS_FOUND "NO") +ENDIF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) + +SET(STACKTRACE_NAMES ${STACKTRACE_NAMES} stacktrace) +FIND_LIBRARY(STACKTRACE_LIBRARY + NAMES ${STACKTRACE_LIBRARY} + PATHS /usr/lib /usr/local/lib + ) + +IF (STACKTRACE_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) + SET(STACKTRACE_LIBRARIES ${STACKTRACE_LIBRARY}) +ENDIF (STACKTRACE_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) + +SET(PROFILER_NAMES ${PROFILER_NAMES} profiler) +FIND_LIBRARY(PROFILER_LIBRARY + NAMES ${PROFILER_LIBRARY} + PATHS /usr/lib /usr/local/lib + ) + +IF (PROFILER_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) + SET(PROFILER_LIBRARIES ${PROFILER_LIBRARY}) +ENDIF (PROFILER_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) + +IF (GOOGLE_PERFTOOLS_FOUND) + IF (NOT GOOGLE_PERFTOOLS_FIND_QUIETLY) + MESSAGE(STATUS "Found Google perftools: ${GOOGLE_PERFTOOLS_LIBRARIES}") + ENDIF (NOT GOOGLE_PERFTOOLS_FIND_QUIETLY) +ELSE (GOOGLE_PERFTOOLS_FOUND) + IF (GOOGLE_PERFTOOLS_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Google perftools library") + ENDIF (GOOGLE_PERFTOOLS_FIND_REQUIRED) +ENDIF (GOOGLE_PERFTOOLS_FOUND) + +MARK_AS_ADVANCED( + TCMALLOC_LIBRARY + STACKTRACE_LIBRARY + PROFILER_LIBRARY + GOOGLE_PERFTOOLS_INCLUDE_DIR + ) diff --git a/linden/indra/cmake/FindMono.cmake b/linden/indra/cmake/FindMono.cmake new file mode 100644 index 0000000..f0a0705 --- /dev/null +++ b/linden/indra/cmake/FindMono.cmake @@ -0,0 +1,68 @@ +# - Try to find the mono, mcs, gmcs and gacutil +# +# defines +# +# MONO_FOUND - system has mono, mcs, gmcs and gacutil +# MONO_PATH - where to find 'mono' +# MCS_PATH - where to find 'mcs' +# GMCS_PATH - where to find 'gmcs' +# GACUTIL_PATH - where to find 'gacutil' +# +# copyright (c) 2007 Arno Rehn arno@arnorehn.de +# +# Redistribution and use is allowed according to the terms of the GPL license. +# Removed the check for gmcs + +FIND_PROGRAM (MONO_EXECUTABLE mono + "C:/Program Files/Mono-1.9.1/bin" + "C:/Program Files/Mono-1.2.6/bin" + /bin + /usr/bin + /usr/local/bin +) +FIND_PROGRAM (MCS_EXECUTABLE mcs + "C:/Program Files/Mono-1.9.1/bin" + "C:/Program Files/Mono-1.2.6/bin" + /bin + /usr/bin + /usr/local/bin +) +FIND_PROGRAM (GMCS_EXECUTABLE gmcs + "C:/Program Files/Mono-1.9.1/bin" + "C:/Program Files/Mono-1.2.6/bin" + /bin + /usr/bin + /usr/local/bin +) +FIND_PROGRAM (GACUTIL_EXECUTABLE gacutil + "C:/Program Files/Mono-1.9.1/bin" + "C:/Program Files/Mono-1.2.6/bin" + /bin + /usr/bin + /usr/local/bin +) +FIND_PROGRAM (ILASM_EXECUTABLE + ilasm + NO_DEFAULT_PATH + PATHS "C:/Program Files/Mono-1.9.1/bin" "C:/Apps/Mono-1.2.6/bin" "C:/Program Files/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin +) + +SET (MONO_FOUND FALSE) + +IF (MONO_EXECUTABLE AND MCS_EXECUTABLE AND GACUTIL_EXECUTABLE) + SET (MONO_FOUND TRUE) +ENDIF (MONO_EXECUTABLE AND MCS_EXECUTABLE AND GACUTIL_EXECUTABLE) + +IF (MONO_FOUND) + IF (NOT Mono_FIND_QUIETLY) + MESSAGE(STATUS "Found mono: ${MONO_EXECUTABLE}") + MESSAGE(STATUS "Found mcs: ${MCS_EXECUTABLE}") + MESSAGE(STATUS "Found gacutil: ${GACUTIL_EXECUTABLE}") + ENDIF (NOT Mono_FIND_QUIETLY) +ELSE (MONO_FOUND) + IF (Mono_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find one or more of the following programs: mono, mcs, gacutil") + ENDIF (Mono_FIND_REQUIRED) +ENDIF (MONO_FOUND) + +MARK_AS_ADVANCED(MONO_EXECUTABLE MCS_EXECUTABLE GACUTIL_EXECUTABLE) diff --git a/linden/indra/cmake/FindMySQL.cmake b/linden/indra/cmake/FindMySQL.cmake new file mode 100644 index 0000000..4319403 --- /dev/null +++ b/linden/indra/cmake/FindMySQL.cmake @@ -0,0 +1,48 @@ +# -*- cmake -*- + +# - Find MySQL +# Find the MySQL includes and library +# This module defines +# MYSQL_INCLUDE_DIR, where to find mysql.h, etc. +# MYSQL_LIBRARIES, the libraries needed to use Mysql. +# MYSQL_FOUND, If false, do not try to use Mysql. +# also defined, but not for general use are +# MYSQL_LIBRARY, where to find the Mysql library. + +FIND_PATH(MYSQL_INCLUDE_DIR mysql/mysql.h +/usr/local/include +/usr/include +) + +SET(MYSQL_NAMES ${MYSQL_NAMES} mysqlclient) +FIND_LIBRARY(MYSQL_LIBRARY + NAMES ${MYSQL_NAMES} + PATHS /usr/lib/mysql /usr/lib /usr/local/lib/mysql /usr/local/lib + ) + +IF (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR) + SET(MYSQL_LIBRARIES ${MYSQL_LIBRARY}) + SET(MYSQL_FOUND "YES") +ELSE (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR) + SET(MYSQL_FOUND "NO") +ENDIF (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR) + + +IF (MYSQL_FOUND) + IF (NOT MYSQL_FIND_QUIETLY) + MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARIES}") + ENDIF (NOT MYSQL_FIND_QUIETLY) +ELSE (MYSQL_FOUND) + IF (MYSQL_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find MySQL library") + ENDIF (MYSQL_FIND_REQUIRED) +ENDIF (MYSQL_FOUND) + +# Deprecated declarations. +SET (NATIVE_MYSQL_INCLUDE_PATH ${MYSQL_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_MYSQL_LIB_PATH ${MYSQL_LIBRARY} PATH) + +MARK_AS_ADVANCED( + MYSQL_LIBRARY + MYSQL_INCLUDE_DIR + ) diff --git a/linden/indra/cmake/FindOpenJPEG.cmake b/linden/indra/cmake/FindOpenJPEG.cmake new file mode 100644 index 0000000..949384e --- /dev/null +++ b/linden/indra/cmake/FindOpenJPEG.cmake @@ -0,0 +1,50 @@ +# -*- cmake -*- + +# - Find OpenJPEG +# Find the OpenJPEG includes and library +# This module defines +# OPENJPEG_INCLUDE_DIR, where to find openjpeg.h, etc. +# OPENJPEG_LIBRARIES, the libraries needed to use OpenJPEG. +# OPENJPEG_FOUND, If false, do not try to use OpenJPEG. +# also defined, but not for general use are +# OPENJPEG_LIBRARY, where to find the OpenJPEG library. + +FIND_PATH(OPENJPEG_INCLUDE_DIR openjpeg.h +/usr/local/include/openjpeg +/usr/local/include +/usr/include/openjpeg +/usr/include +) + +SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjpeg) +FIND_LIBRARY(OPENJPEG_LIBRARY + NAMES ${OPENJPEG_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR) + SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY}) + SET(OPENJPEG_FOUND "YES") +ELSE (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR) + SET(OPENJPEG_FOUND "NO") +ENDIF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR) + + +IF (OPENJPEG_FOUND) + IF (NOT OPENJPEG_FIND_QUIETLY) + MESSAGE(STATUS "Found OpenJPEG: ${OPENJPEG_LIBRARIES}") + ENDIF (NOT OPENJPEG_FIND_QUIETLY) +ELSE (OPENJPEG_FOUND) + IF (OPENJPEG_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find OpenJPEG library") + ENDIF (OPENJPEG_FIND_REQUIRED) +ENDIF (OPENJPEG_FOUND) + +# Deprecated declarations. +SET (NATIVE_OPENJPEG_INCLUDE_PATH ${OPENJPEG_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_OPENJPEG_LIB_PATH ${OPENJPEG_LIBRARY} PATH) + +MARK_AS_ADVANCED( + OPENJPEG_LIBRARY + OPENJPEG_INCLUDE_DIR + ) diff --git a/linden/indra/cmake/FindSCP.cmake b/linden/indra/cmake/FindSCP.cmake new file mode 100644 index 0000000..ea02102 --- /dev/null +++ b/linden/indra/cmake/FindSCP.cmake @@ -0,0 +1,40 @@ +# -*- cmake -*- +# +# Find the OpenSSH scp ("secure copy") or Putty pscp command. +# +# Input variables: +# SCP_FIND_REQUIRED - set this if configuration should fail without scp +# +# Output variables: +# +# SCP_FOUND - set if scp was found +# SCP_EXECUTABLE - path to scp or pscp executable +# SCP_BATCH_FLAG - how to put scp/pscp into batch mode + +SET(SCP_EXECUTABLE) +IF (WINDOWS) + FIND_PROGRAM(SCP_EXECUTABLE NAMES pscp pscp.exe) +ELSE (WINDOWS) + FIND_PROGRAM(SCP_EXECUTABLE NAMES scp scp.exe) +ENDIF (WINDOWS) + +IF (SCP_EXECUTABLE) + SET(SCP_FOUND ON) +ELSE (SCP_EXECUTABLE) + SET(SCP_FOUND OFF) +ENDIF (SCP_EXECUTABLE) + +IF (SCP_FOUND) + GET_FILENAME_COMPONENT(_scp_name ${SCP_EXECUTABLE} NAME_WE) + IF (_scp_name STREQUAL scp) + SET(SCP_BATCH_FLAG -B) + ELSE (_scp_name STREQUAL scp) + SET(SCP_BATCH_FLAG -batch) + ENDIF (_scp_name STREQUAL scp) +ELSE (SCP_FOUND) + IF (SCP_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find scp or pscp executable") + ENDIF (SCP_FIND_REQUIRED) +ENDIF (SCP_FOUND) + +MARK_AS_ADVANCED(SCP_EXECUTABLE SCP_FOUND SCP_BATCH_FLAG) diff --git a/linden/indra/cmake/FindXmlRpcEpi.cmake b/linden/indra/cmake/FindXmlRpcEpi.cmake new file mode 100644 index 0000000..ba217e7 --- /dev/null +++ b/linden/indra/cmake/FindXmlRpcEpi.cmake @@ -0,0 +1,48 @@ +# -*- cmake -*- + +# - Find XMLRPC-EPI +# Find the XMLRPC-EPI includes and library +# This module defines +# XMLRPCEPI_INCLUDE_DIR, where to find jpeglib.h, etc. +# XMLRPCEPI_LIBRARIES, the libraries needed to use XMLRPC-EPI. +# XMLRPCEPI_FOUND, If false, do not try to use XMLRPC-EPI. +# also defined, but not for general use are +# XMLRPCEPI_LIBRARY, where to find the XMLRPC-EPI library. + +FIND_PATH(XMLRPCEPI_INCLUDE_DIR xmlrpc-epi/xmlrpc.h +/usr/local/include +/usr/include +) + +SET(XMLRPCEPI_NAMES ${XMLRPCEPI_NAMES} xmlrpc-epi) +FIND_LIBRARY(XMLRPCEPI_LIBRARY + NAMES ${XMLRPCEPI_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR) + SET(XMLRPCEPI_LIBRARIES ${XMLRPCEPI_LIBRARY}) + SET(XMLRPCEPI_FOUND "YES") +ELSE (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR) + SET(XMLRPCEPI_FOUND "NO") +ENDIF (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR) + + +IF (XMLRPCEPI_FOUND) + IF (NOT XMLRPCEPI_FIND_QUIETLY) + MESSAGE(STATUS "Found XMLRPC-EPI: ${XMLRPCEPI_LIBRARIES}") + ENDIF (NOT XMLRPCEPI_FIND_QUIETLY) +ELSE (XMLRPCEPI_FOUND) + IF (XMLRPCEPI_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find XMLRPC-EPI library") + ENDIF (XMLRPCEPI_FIND_REQUIRED) +ENDIF (XMLRPCEPI_FOUND) + +# Deprecated declarations. +SET (NATIVE_XMLRPCEPI_INCLUDE_PATH ${XMLRPCEPI_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_XMLRPCEPI_LIB_PATH ${XMLRPCEPI_LIBRARY} PATH) + +MARK_AS_ADVANCED( + XMLRPCEPI_LIBRARY + XMLRPCEPI_INCLUDE_DIR + ) diff --git a/linden/indra/cmake/FreeType.cmake b/linden/indra/cmake/FreeType.cmake new file mode 100644 index 0000000..5f1aa26 --- /dev/null +++ b/linden/indra/cmake/FreeType.cmake @@ -0,0 +1,20 @@ +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + include(FindPkgConfig) + + pkg_check_modules(FREETYPE REQUIRED freetype2) +else (STANDALONE) + use_prebuilt_binary(freetype) + if (LINUX) + set(FREETYPE_INCLUDE_DIRS + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) + else (LINUX) + set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + endif (LINUX) + + set(FREETYPE_LIBRARIES freetype) +endif (STANDALONE) + +link_directories(${FREETYPE_LIBRARY_DIRS}) diff --git a/linden/indra/cmake/GStreamer.cmake b/linden/indra/cmake/GStreamer.cmake new file mode 100644 index 0000000..10d5207 --- /dev/null +++ b/linden/indra/cmake/GStreamer.cmake @@ -0,0 +1,38 @@ +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + include(FindPkgConfig) + + pkg_check_modules(GSTREAMER REQUIRED gstreamer-0.10) + pkg_check_modules(GSTREAMER_PLUGINS_BASE REQUIRED gstreamer-plugins-base-0.10) +elseif (LINUX) + use_prebuilt_binary(gstreamer) + # possible libxml should have its own .cmake file instead + use_prebuilt_binary(libxml) + set(GSTREAMER_FOUND ON FORCE BOOL) + set(GSTREAMER_PLUGINS_BASE_FOUND ON FORCE BOOL) + set(GSTREAMER_INCLUDE_DIRS + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/gstreamer-0.10 + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/glib-2.0 + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/libxml2 + ) + # We don't need to explicitly link against gstreamer itself, because + # LLMediaImplGStreamer probes for the system's copy at runtime. + set(GSTREAMER_LIBRARIES + gobject-2.0 + gmodule-2.0 + dl + gthread-2.0 + rt + glib-2.0 + ) +endif (STANDALONE) + +if (GSTREAMER_FOUND AND GSTREAMER_PLUGINS_BASE_FOUND) + set(GSTREAMER ON CACHE BOOL "Build with GStreamer streaming media support.") +endif (GSTREAMER_FOUND AND GSTREAMER_PLUGINS_BASE_FOUND) + +if (GSTREAMER) + add_definitions(-DLL_GSTREAMER_ENABLED=1) +endif (GSTREAMER) diff --git a/linden/indra/cmake/GooglePerfTools.cmake b/linden/indra/cmake/GooglePerfTools.cmake new file mode 100644 index 0000000..9b3eca0 --- /dev/null +++ b/linden/indra/cmake/GooglePerfTools.cmake @@ -0,0 +1,28 @@ +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + include(FindGooglePerfTools) +else (STANDALONE) + use_prebuilt_binary(google) + if (LINUX) + set(TCMALLOC_LIBRARIES tcmalloc) + set(STACKTRACE_LIBRARIES stacktrace) + set(PROFILER_LIBRARIES profiler) + set(GOOGLE_PERFTOOLS_INCLUDE_DIR + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) + set(GOOGLE_PERFTOOLS_FOUND "YES") + endif (LINUX) +endif (STANDALONE) + +if (GOOGLE_PERFTOOLS_FOUND) + set(USE_GOOGLE_PERFTOOLS ON CACHE BOOL "Build with Google PerfTools support.") +endif (GOOGLE_PERFTOOLS_FOUND) + +if (USE_GOOGLE_PERFTOOLS) + set(TCMALLOC_FLAG -DLL_USE_TCMALLOC=1) + include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR}) + set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES} ${STACKTRACE_LIBRARIES}) +else (USE_GOOGLE_PERFTOOLS) + set(TCMALLOC_FLAG -ULL_USE_TCMALLOC) +endif (USE_GOOGLE_PERFTOOLS) diff --git a/linden/indra/cmake/JPEG.cmake b/linden/indra/cmake/JPEG.cmake new file mode 100644 index 0000000..5d0ee0d --- /dev/null +++ b/linden/indra/cmake/JPEG.cmake @@ -0,0 +1,23 @@ +# -*- cmake -*- +include(Prebuilt) + +include(Linking) +set(JPEG_FIND_QUIETLY ON) +set(JPEG_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindJPEG) +else (STANDALONE) + use_prebuilt_binary(jpeglib) + if (LINUX) + set(JPEG_LIBRARIES jpeg) + elseif (DARWIN) + set(JPEG_LIBRARIES + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/liblljpeg.a + debug ${ARCH_PREBUILT_DIRS_DEBUG}/liblljpeg.a + ) + elseif (WINDOWS) + set(JPEG_LIBRARIES jpeglib_6b) + endif (LINUX) + set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) +endif (STANDALONE) diff --git a/linden/indra/cmake/LLAudio.cmake b/linden/indra/cmake/LLAudio.cmake new file mode 100644 index 0000000..7b9f254 --- /dev/null +++ b/linden/indra/cmake/LLAudio.cmake @@ -0,0 +1,15 @@ +# -*- cmake -*- + +include(Audio) + +set(LLAUDIO_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llaudio + ) + +set(LLAUDIO_LIBRARIES + llaudio + ${VORBISENC_LIBRARIES} + ${VORBISFILE_LIBRARIES} + ${VORBIS_LIBRARIES} + ${OGG_LIBRARIES} + ) diff --git a/linden/indra/cmake/LLCharacter.cmake b/linden/indra/cmake/LLCharacter.cmake new file mode 100644 index 0000000..c74092c --- /dev/null +++ b/linden/indra/cmake/LLCharacter.cmake @@ -0,0 +1,9 @@ +# -*- cmake -*- + +set(LLCHARACTER_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llcharacter + ) + +set(LLCHARACTER_LIBRARIES + llcharacter + ) diff --git a/linden/indra/cmake/LLCommon.cmake b/linden/indra/cmake/LLCommon.cmake new file mode 100644 index 0000000..f4b251e --- /dev/null +++ b/linden/indra/cmake/LLCommon.cmake @@ -0,0 +1,21 @@ +# -*- cmake -*- + +include(APR) +include(Boost) +include(EXPAT) +include(ZLIB) + +set(LLCOMMON_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llcommon + ${APRUTIL_INCLUDE_DIR} + ${APR_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} + ) + +set(LLCOMMON_LIBRARIES + llcommon + ${APRUTIL_LIBRARIES} + ${APR_LIBRARIES} + ${EXPAT_LIBRARIES} + ${ZLIB_LIBRARIES} + ) diff --git a/linden/indra/cmake/LLCrashLogger.cmake b/linden/indra/cmake/LLCrashLogger.cmake new file mode 100644 index 0000000..7b362d0 --- /dev/null +++ b/linden/indra/cmake/LLCrashLogger.cmake @@ -0,0 +1,9 @@ +# -*- cmake -*- + +set(LLCRASHLOGGER_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llcrashlogger + ) + +set(LLCRASHLOGGER_LIBRARIES + llcrashlogger + ) diff --git a/linden/indra/cmake/LLDatabase.cmake b/linden/indra/cmake/LLDatabase.cmake new file mode 100644 index 0000000..c3cf622 --- /dev/null +++ b/linden/indra/cmake/LLDatabase.cmake @@ -0,0 +1,13 @@ +# -*- cmake -*- + +include(MySQL) + +set(LLDATABASE_INCLUDE_DIRS + ${LIBS_SERVER_DIR}/lldatabase + ${MYSQL_INCLUDE_DIR} + ) + +set(LLDATABASE_LIBRARIES + lldatabase + ${MYSQL_LIBRARIES} + ) diff --git a/linden/indra/cmake/LLImage.cmake b/linden/indra/cmake/LLImage.cmake new file mode 100644 index 0000000..8874fa5 --- /dev/null +++ b/linden/indra/cmake/LLImage.cmake @@ -0,0 +1,15 @@ +# -*- cmake -*- + +include(JPEG) +include(PNG) + +set(LLIMAGE_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llimage + ${JPEG_INCLUDE_DIRS} + ) + +set(LLIMAGE_LIBRARIES + llimage + ${JPEG_LIBRARIES} + ${PNG_LIBRARIES} + ) diff --git a/linden/indra/cmake/LLImageJ2COJ.cmake b/linden/indra/cmake/LLImageJ2COJ.cmake new file mode 100644 index 0000000..91973e0 --- /dev/null +++ b/linden/indra/cmake/LLImageJ2COJ.cmake @@ -0,0 +1,8 @@ +# -*- cmake -*- + +include(OpenJPEG) + +set(LLIMAGEJ2COJ_LIBRARIES + llimagej2coj + ${OPENJPEG_LIBRARIES} + ) diff --git a/linden/indra/cmake/LLInventory.cmake b/linden/indra/cmake/LLInventory.cmake new file mode 100644 index 0000000..7d5f492 --- /dev/null +++ b/linden/indra/cmake/LLInventory.cmake @@ -0,0 +1,9 @@ +# -*- cmake -*- + +set(LLINVENTORY_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llinventory + ) + +set(LLINVENTORY_LIBRARIES + llinventory + ) diff --git a/linden/indra/cmake/LLKDU.cmake b/linden/indra/cmake/LLKDU.cmake new file mode 100644 index 0000000..a02b5d9 --- /dev/null +++ b/linden/indra/cmake/LLKDU.cmake @@ -0,0 +1,20 @@ +# -*- cmake -*- +include(Prebuilt) + +if (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu) + use_prebuilt_binary(kdu) + if (WINDOWS) + set(KDU_LIBRARY debug kdu_cored optimized kdu_core) + elseif (LINUX) + set(KDU_LIBRARY kdu_v42R) + else (WINDOWS) + set(KDU_LIBRARY kdu) + endif (WINDOWS) + + set(KDU_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) + + set(LLKDU_LIBRARY llkdu) + set(LLKDU_STATIC_LIBRARY llkdu_static) + set(LLKDU_LIBRARIES ${LLKDU_LIBRARY}) + set(LLKDU_STATIC_LIBRARIES ${LLKDU_STATIC_LIBRARY}) +endif (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu) diff --git a/linden/indra/cmake/LLMath.cmake b/linden/indra/cmake/LLMath.cmake new file mode 100644 index 0000000..8afd45e --- /dev/null +++ b/linden/indra/cmake/LLMath.cmake @@ -0,0 +1,9 @@ +# -*- cmake -*- + +set(LLMATH_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llmath + ) + +set(LLMATH_LIBRARIES + llmath + ) diff --git a/linden/indra/cmake/LLMedia.cmake b/linden/indra/cmake/LLMedia.cmake new file mode 100644 index 0000000..b7bf11c --- /dev/null +++ b/linden/indra/cmake/LLMedia.cmake @@ -0,0 +1,15 @@ +# -*- cmake -*- + +include(GStreamer) +include(QuickTime) + +set(LLMEDIA_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llmedia + ) + +set(LLMEDIA_LIBRARIES + llmedia + ${GSTREAMER_LIBRARIES} + ${GSTREAMER_PLUGINS_BASE_LIBRARIES} + ${QUICKTIME_LIBRARY} + ) diff --git a/linden/indra/cmake/LLMessage.cmake b/linden/indra/cmake/LLMessage.cmake new file mode 100644 index 0000000..1cea03a --- /dev/null +++ b/linden/indra/cmake/LLMessage.cmake @@ -0,0 +1,22 @@ +# -*- cmake -*- + +include(CARes) +include(CURL) +include(OpenSSL) +include(XmlRpcEpi) + +set(LLMESSAGE_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llmessage + ${CARES_INCLUDE_DIRS} + ${CURL_INCLUDE_DIRS} + ${OPENSSL_INCLUDE_DIRS} + ) + +set(LLMESSAGE_LIBRARIES + llmessage + ${CURL_LIBRARIES} + ${CARES_LIBRARIES} + ${OPENSSL_LIBRARIES} + ${CRYPTO_LIBRARIES} + ${XMLRPCEPI_LIBRARIES} + ) diff --git a/linden/indra/cmake/LLPhysics.cmake b/linden/indra/cmake/LLPhysics.cmake new file mode 100644 index 0000000..3ae390e --- /dev/null +++ b/linden/indra/cmake/LLPhysics.cmake @@ -0,0 +1,76 @@ +# -*- cmake -*- +include(Prebuilt) + +use_prebuilt_binary(havok) + +set(HAVOK_VERSION 460) + +set(LLPHYSICS_INCLUDE_DIRS + ${LIBS_SERVER_DIR}/llphysics + ${LIBS_PREBUILT_DIR}/include/havok/hk${HAVOK_VERSION}/common + ${LIBS_PREBUILT_DIR}/include/havok/hk${HAVOK_VERSION}/physics + ) + +add_definitions(-DLL_CURRENT_HAVOK_VERSION=${HAVOK_VERSION}) + +if (LINUX OR DARWIN) + if (DARWIN) + link_directories( + ${LIBS_PREBUILT_DIR}/universal-darwin/lib_release/havok/hk460 + ) + else (DARWIN) + link_directories( + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release/havok/hk460 + ) + endif (DARWIN) + + set(LLPHYSICS_LIBRARIES + llphysics + hkcompat + hkutilities + hkvisualize + hkdynamics + hkvehicle + hkcollide + hkinternal + hkconstraintsolver + hkmath + hkscenedata + hkserialize + hkgraphicsogl + hkgraphicsbridge + hkgraphics + hkdemoframework + hkbase + ) +elseif (WINDOWS) + if (MSVC71) + set(HK_DEBUG ${WINLIBS_PREBUILT_DEBUG_DIR}/havok/hk460) + set(HK_RELEASE ${WINLIBS_PREBUILT_RELEASE_DIR}/havok/hk460) + else (MSVC71) + set(HK_DEBUG ${WINLIBS_PREBUILT_DEBUG_DIR}/havok/hk460_net_8-0) + set(HK_RELEASE ${WINLIBS_PREBUILT_RELEASE_DIR}/havok/hk460_net_8-0) + endif (MSVC71) + + set(HAVOK_LIBS + hkbase + hkdynamics + hkmath + hkcollide + hkutilities + hkvisualize + hkinternal + hkconstraintsolver + hkcompat + hkserialize + hkvehicle + hkscenedata + ) + + set(LLPHYSICS_LIBRARIES llphysics) + + foreach(lib ${HAVOK_LIBS}) + list(APPEND LLPHYSICS_LIBRARIES + debug ${HK_DEBUG}/${lib} optimized ${HK_RELEASE}/${lib}) + endforeach(lib) +endif (LINUX OR DARWIN) diff --git a/linden/indra/cmake/LLPrimitive.cmake b/linden/indra/cmake/LLPrimitive.cmake new file mode 100644 index 0000000..0426ae5 --- /dev/null +++ b/linden/indra/cmake/LLPrimitive.cmake @@ -0,0 +1,9 @@ +# -*- cmake -*- + +set(LLPRIMITIVE_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llprimitive + ) + +set(LLPRIMITIVE_LIBRARIES + llprimitive + ) diff --git a/linden/indra/cmake/LLRender.cmake b/linden/indra/cmake/LLRender.cmake new file mode 100644 index 0000000..bbcf4cd --- /dev/null +++ b/linden/indra/cmake/LLRender.cmake @@ -0,0 +1,32 @@ +# -*- cmake -*- + +include(FreeType) + +set(LLRENDER_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llrender + ) + +if (SERVER AND LINUX) + set(LLRENDER_LIBRARIES + llrenderheadless + ) +else (SERVER AND LINUX) +set(LLRENDER_LIBRARIES + llrender + ) +endif (SERVER AND LINUX) + +# mapserver requires certain files to be copied so LL_MESA_HEADLESS can be set +# differently for different object files. +macro (copy_server_sources _copied_SOURCES) + foreach (PREFIX ${_copied_SOURCES}) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}_server.cpp + COMMAND ${CMAKE_COMMAND} + ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}.cpp + ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}_server.cpp + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}.cpp + ) + list(APPEND server_SOURCE_FILES ${PREFIX}_server.cpp) + endforeach (PREFIX ${_copied_SOURCES}) +endmacro (copy_server_sources _copied_SOURCES) diff --git a/linden/indra/cmake/LLScene.cmake b/linden/indra/cmake/LLScene.cmake new file mode 100644 index 0000000..d1c32b3 --- /dev/null +++ b/linden/indra/cmake/LLScene.cmake @@ -0,0 +1,9 @@ +# -*- cmake -*- + +set(LLSCENE_INCLUDE_DIRS + ${LIBS_SERVER_DIR}/llscene + ) + +set(LLSCENE_LIBRARIES + llscene + ) diff --git a/linden/indra/cmake/LLUI.cmake b/linden/indra/cmake/LLUI.cmake new file mode 100644 index 0000000..d1287de --- /dev/null +++ b/linden/indra/cmake/LLUI.cmake @@ -0,0 +1,9 @@ +# -*- cmake -*- + +set(LLUI_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llui + ) + +set(LLUI_LIBRARIES + llui + ) diff --git a/linden/indra/cmake/LLVFS.cmake b/linden/indra/cmake/LLVFS.cmake new file mode 100644 index 0000000..5ce3d25 --- /dev/null +++ b/linden/indra/cmake/LLVFS.cmake @@ -0,0 +1,13 @@ +# -*- cmake -*- + +set(LLVFS_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llvfs + ) + +set(LLVFS_LIBRARIES llvfs) + +if (DARWIN) + include(CMakeFindFrameworks) + find_library(CARBON_LIBRARY Carbon) + list(APPEND LLVFS_LIBRARIES ${CARBON_LIBRARY}) +endif (DARWIN) diff --git a/linden/indra/cmake/LLWindow.cmake b/linden/indra/cmake/LLWindow.cmake new file mode 100644 index 0000000..c0efa27 --- /dev/null +++ b/linden/indra/cmake/LLWindow.cmake @@ -0,0 +1,43 @@ +# -*- cmake -*- + +include(OpenGL) +include(Prebuilt) + +if (STANDALONE) + include(FindSDL) + + # This should be done by FindSDL. Sigh. + mark_as_advanced( + SDLMAIN_LIBRARY + SDL_INCLUDE_DIR + SDL_LIBRARY + ) +else (STANDALONE) + use_prebuilt_binary(SDL) + use_prebuilt_binary(mesa) + if (LINUX AND VIEWER) + set (SDL_FOUND TRUE) + set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux) + set (SDL_LIBRARY SDL) + endif (LINUX AND VIEWER) +endif (STANDALONE) + +if (SDL_FOUND) + add_definitions(-DLL_SDL=1) + include_directories(${SDL_INCLUDE_DIR}) +endif (SDL_FOUND) + +set(LLWINDOW_INCLUDE_DIRS + ${GLEXT_INCLUDE_DIR} + ${LIBS_OPEN_DIR}/llwindow + ) + +if (SERVER AND LINUX) + set(LLWINDOW_LIBRARIES + llwindowheadless + ) +else (SERVER AND LINUX) + set(LLWINDOW_LIBRARIES + llwindow + ) +endif (SERVER AND LINUX) diff --git a/linden/indra/cmake/LLXML.cmake b/linden/indra/cmake/LLXML.cmake new file mode 100644 index 0000000..1ce93c0 --- /dev/null +++ b/linden/indra/cmake/LLXML.cmake @@ -0,0 +1,13 @@ +# -*- cmake -*- + +include(EXPAT) + +set(LLXML_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llxml + ${EXPAT_INCLUDE_DIRS} + ) + +set(LLXML_LIBRARIES + llxml + ${EXPAT_LIBRARIES} + ) diff --git a/linden/indra/cmake/LScript.cmake b/linden/indra/cmake/LScript.cmake new file mode 100644 index 0000000..86bfcb7 --- /dev/null +++ b/linden/indra/cmake/LScript.cmake @@ -0,0 +1,16 @@ +# -*- cmake -*- + +set(LSCRIPT_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/lscript + ${LIBS_OPEN_DIR}/lscript/lscript_compile + ${LIBS_OPEN_DIR}/lscript/lscript_execute + ${LIBS_OPEN_DIR}/lscript/lscript_execute_mono + ) + +set(LSCRIPT_LIBRARIES + lscript_compile + lscript_execute + lscript_library + ) + +set(LSCRIPT_EXECUTE_MONO_LIBRARIES lscript_execute_mono) \ No newline at end of file diff --git a/linden/indra/cmake/Linking.cmake b/linden/indra/cmake/Linking.cmake new file mode 100644 index 0000000..c9748e3 --- /dev/null +++ b/linden/indra/cmake/Linking.cmake @@ -0,0 +1,45 @@ +# -*- cmake -*- + +if (NOT STANDALONE) + if (WINDOWS) + set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib) + set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release) + set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug) + elseif (LINUX) + if (VIEWER) + set(ARCH_PREBUILT_DIRS + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client) + set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS}) + set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS}) + else (VIEWER) + set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release) + endif (VIEWER) + elseif (DARWIN) + set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release) + set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS_RELEASE}) + endif (WINDOWS) +endif (NOT STANDALONE) + +link_directories(${ARCH_PREBUILT_DIRS}) + +if (LINUX) + set(DL_LIBRARY dl) + set(PTHREAD_LIBRARY pthread) +else (LINUX) + set(DL_LIBRARY "") + set(PTHREAD_LIBRARY "") +endif (LINUX) + +if (WINDOWS) + set(WINDOWS_LIBRARIES + ws2_32 + mswsock + psapi + winmm + netapi32 + ) +else (WINDOWS) + set(WINDOWS_LIBRARIES "") +endif (WINDOWS) + +mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES) diff --git a/linden/indra/cmake/MonoDeps.cmake b/linden/indra/cmake/MonoDeps.cmake new file mode 100644 index 0000000..52d5491 --- /dev/null +++ b/linden/indra/cmake/MonoDeps.cmake @@ -0,0 +1,48 @@ +# -*- cmake -*- + +set(MONO_PREBUILT_LIBRARIES_DIR ${LIBS_PREBUILT_DIR}/mono/1.0) + +set(MONO_PREBUILT_LIBRARIES + Iesi.Collections.dll + Iesi.Collections.pdb + Mono.CompilerServices.SymbolWriter.dll + Mono.PEToolkit.dll + Mono.PEToolkit.pdb + Mono.Security.dll + PEAPI.dll + RAIL.dll + RAIL.pdb + ) + + set(MONO_CORE_LIBRARIES + System.dll + System.Xml.dll + mscorlib.dll) + +if(WINDOWS) + set(MONO_DEPENDENCIES + DomainCreator + DomainRegister + LslLibrary + LslUserScript + Script + ScriptTypes + TestFormat + UserScript + UThread + UThreadInjector + ) +else(WINDOWS) + set(MONO_DEPENDENCIES + DomainCreator_POST_BUILD + DomainRegister_POST_BUILD + LslLibrary_POST_BUILD + LslUserScript_POST_BUILD + Script_POST_BUILD + ScriptTypes_POST_BUILD + TestFormat_POST_BUILD + UserScript_POST_BUILD + UThread_POST_BUILD + UThreadInjector_POST_BUILD + ) +endif(WINDOWS) diff --git a/linden/indra/cmake/MonoEmbed.cmake b/linden/indra/cmake/MonoEmbed.cmake new file mode 100644 index 0000000..0f1f233 --- /dev/null +++ b/linden/indra/cmake/MonoEmbed.cmake @@ -0,0 +1,57 @@ +# -*- cmake -*- + +include(Prebuilt) +use_prebuilt_binary(libmono) + +SET(GLIB_2_0 glib-2.0) + +if (WINDOWS) + SET(MONO_LIB mono) +else (WINDOWS) + SET(MONO_LIB mono) + SET(M_LIBRARIES m) + SET(GTHREAD_2_0 gthread-2.0) +endif(WINDOWS) + + +IF (DARWIN) + + FIND_LIBRARY(MONO_LIBRARY NAMES Mono) + # Find_file doesnt work as expected. Hardcode relative to Mono.framework. + #FIND_FILE(GLIB_CONFIG glibconfig.h ${MONO_LIBRARY}) + #FIND_FILE(MONO_GLIB_LIBRARY glib.h ${MONO_LIBRARY}) + SET(MONO_GLIB_LIBRARY ${MONO_LIBRARY}/Headers/glib-2.0/) + SET(GLIB_CONFIG ${MONO_LIBRARY}/Libraries/glib-2.0/include/) + SET(MONO_LIB_DIRECTORY ${MONO_LIBRARY}/Libraries) + + IF (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG) + MESSAGE(STATUS "Found Mono for embedding") + INCLUDE_DIRECTORIES(${MONO_GLIB_LIBRARY} ${GLIB_CONFIG}) + LINK_DIRECTORIES(${MONO_LIB_DIRECTORY}) + ELSE (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG) + MESSAGE(FATAL_ERROR "Mono not found for embedding") + MESSAGE(${MONO_LIBRARY}) + MESSAGE(${MONO_GLIB_LIBRARY}) + MESSAGE(${GLIB_CONFIG}) + ENDIF (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG) + +ELSE (DARWIN) + + SET(MONO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) + SET(GLIB_2_0_PLATFORM_INCLUDE_DIR + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/glib-2.0) + SET(GLIB_2_0_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/glib-2.0) + + INCLUDE_DIRECTORIES( + ${MONO_INCLUDE_DIR} + ${GLIB_2_0_PLATFORM_INCLUDE_DIR} + ${GLIB_2_0_INCLUDE_DIR}) + +ENDIF (DARWIN) + +SET(MONO_LIBRARIES + ${MONO_LIB} + ${M_LIBRARIES} + ${GLIB_2_0} + ${GTHREAD_2_0} +) diff --git a/linden/indra/cmake/Mozlib.cmake b/linden/indra/cmake/Mozlib.cmake new file mode 100644 index 0000000..e9555df --- /dev/null +++ b/linden/indra/cmake/Mozlib.cmake @@ -0,0 +1,47 @@ +# -*- cmake -*- +include(Linking) +include(Prebuilt) + +if (STANDALONE) + set(MOZLIB OFF CACHE BOOL + "Enable Mozilla support in the viewer (requires llmozlib library).") +else (STANDALONE) + use_prebuilt_binary(llmozlib) + set(MOZLIB ON CACHE BOOL + "Enable Mozilla support in the viewer (requires llmozlib library).") +endif (STANDALONE) + +if (MOZLIB) + add_definitions(-DLL_LLMOZLIB_ENABLED=1) + + if (LINUX) + link_directories(${CMAKE_SOURCE_DIR}/newview/app_settings/mozilla-runtime-linux-${ARCH}) + set(MOZLIB_LIBRARIES + llmozlib2 + mozjs + nspr4 + plc4 + plds4 + xpcom + xul + profdirserviceprovider_s + ) + elseif (WINDOWS) + if (MSVC71) + set(MOZLIB_LIBRARIES + debug llmozlib2d + optimized llmozlib2) + elseif (MSVC80 OR MSVC90) + set(MOZLIB_LIBRARIES + debug llmozlib2d-vc80 + optimized llmozlib2-vc80) + endif (MSVC71) + else (LINUX) + set(MOZLIB_LIBRARIES + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libllmozlib2.dylib + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libllmozlib2.dylib + ) + endif (LINUX) +else (MOZLIB) + add_definitions(-DLL_LLMOZLIB_ENABLED=0) +endif (MOZLIB) diff --git a/linden/indra/cmake/MySQL.cmake b/linden/indra/cmake/MySQL.cmake new file mode 100644 index 0000000..97dd091 --- /dev/null +++ b/linden/indra/cmake/MySQL.cmake @@ -0,0 +1,23 @@ +# -*- cmake -*- +include(Linking) +include(Prebuilt) +# We don't prebuild our own MySQL client library. + +use_prebuilt_binary(mysql) + +set(MYSQL_FIND_QUIETLY ON) +set(MYSQL_FIND_REQUIRED ON) + +if (WINDOWS) + set(MYSQL_LIBRARIES mysqlclient) + set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) +elseif (DARWIN) + set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) + set(MYSQL_LIBRARIES + optimized ${LIBS_PREBUILT_DIRS_RELEASE}/libmysqlclient.a + debug ${LIBS_PREBUILT_DIRS_DEBUG}/libmysqlclient.a + ) +else (WINDOWS) + set(MYSQL_FIND_REQUIRED) + include(FindMySQL) +endif (WINDOWS) diff --git a/linden/indra/cmake/NDOF.cmake b/linden/indra/cmake/NDOF.cmake new file mode 100644 index 0000000..3f715a2 --- /dev/null +++ b/linden/indra/cmake/NDOF.cmake @@ -0,0 +1,14 @@ +# -*- cmake -*- +include(Prebuilt) + +use_prebuilt_binary(ndofdev) + +if (WINDOWS OR DARWIN) + add_definitions(-DLIB_NDOF=1) +endif (WINDOWS OR DARWIN) + +if (WINDOWS) + set(NDOF_LIBRARY libndofdev) +elseif (DARWIN) + set(NDOF_LIBRARY ndofdev) +endif (WINDOWS) diff --git a/linden/indra/cmake/OpenGL.cmake b/linden/indra/cmake/OpenGL.cmake new file mode 100644 index 0000000..6a2b681 --- /dev/null +++ b/linden/indra/cmake/OpenGL.cmake @@ -0,0 +1,9 @@ +# -*- cmake -*- +include(Prebuilt) + +if (NOT STANDALONE) + use_prebuilt_binary(GL) + # possible glh_linear should have its own .cmake file instead + use_prebuilt_binary(glh_linear) + set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) +endif (NOT STANDALONE) diff --git a/linden/indra/cmake/OpenJPEG.cmake b/linden/indra/cmake/OpenJPEG.cmake new file mode 100644 index 0000000..fcc82c2 --- /dev/null +++ b/linden/indra/cmake/OpenJPEG.cmake @@ -0,0 +1,22 @@ +# -*- cmake -*- +include(Prebuilt) + +set(OPENJPEG_FIND_QUIETLY ON) +set(OPENJPEG_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindOpenJPEG) +else (STANDALONE) + use_prebuilt_binary(openjpeg) + + if(WINDOWS) + # Windows has differently named release and debug openjpeg(d) libs. + set(OPENJPEG_LIBRARIES + debug openjpegd + optimized openjpeg) + else(WINDOWS) + set(OPENJPEG_LIBRARIES openjpeg) + endif(WINDOWS) + + set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg) +endif (STANDALONE) diff --git a/linden/indra/cmake/OpenSSL.cmake b/linden/indra/cmake/OpenSSL.cmake new file mode 100644 index 0000000..81584c0 --- /dev/null +++ b/linden/indra/cmake/OpenSSL.cmake @@ -0,0 +1,23 @@ +# -*- cmake -*- +include(Prebuilt) + +set(OpenSSL_FIND_QUIETLY ON) +set(OpenSSL_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindOpenSSL) +else (STANDALONE) + use_prebuilt_binary(openSSL) + if (WINDOWS) + set(OPENSSL_LIBRARIES ssleay32 libeay32) + else (WINDOWS) + set(OPENSSL_LIBRARIES ssl) + endif (WINDOWS) + set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) +endif (STANDALONE) + +if (LINUX) + set(CRYPTO_LIBRARIES crypto) +elseif (DARWIN) + set(CRYPTO_LIBRARIES llcrypto) +endif (LINUX) diff --git a/linden/indra/cmake/PNG.cmake b/linden/indra/cmake/PNG.cmake new file mode 100644 index 0000000..4d0b7b2 --- /dev/null +++ b/linden/indra/cmake/PNG.cmake @@ -0,0 +1,13 @@ +# -*- cmake -*- +include(Prebuilt) + +set(PNG_FIND_QUIETLY ON) +set(PNG_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindPNG) +else (STANDALONE) + use_prebuilt_binary(libpng) + set(PNG_LIBRARIES png12) + set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) +endif (STANDALONE) diff --git a/linden/indra/cmake/Prebuilt.cmake b/linden/indra/cmake/Prebuilt.cmake new file mode 100644 index 0000000..a915192 --- /dev/null +++ b/linden/indra/cmake/Prebuilt.cmake @@ -0,0 +1,44 @@ +# -*- cmake -*- + +include(Python) +include(FindSCP) + +macro (use_prebuilt_binary _binary) + if (NOT STANDALONE) + if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed) + if(INSTALL_PROPRIETARY) + include(FindSCP) + if(DEBUG_PREBUILT) + message("cd ${SCRIPTS_DIR} && ${PYTHON_EXECUTABLE} install.py --install-dir=${CMAKE_SOURCE_DIR}/.. --scp=${SCP_EXECUTABLE} ${_binary}") + endif(DEBUG_PREBUILT) + execute_process(COMMAND ${PYTHON_EXECUTABLE} + install.py + --install-dir=${CMAKE_SOURCE_DIR}/.. + --scp=${SCP_EXECUTABLE} + ${_binary} + WORKING_DIRECTORY ${SCRIPTS_DIR} + RESULT_VARIABLE ${_binary}_installed + ) + else(INSTALL_PROPRIETARY) + if(DEBUG_PREBUILT) + message("cd ${SCRIPTS_DIR} && ${PYTHON_EXECUTABLE} install.py --install-dir=${CMAKE_SOURCE_DIR}/.. ${_binary}") + endif(DEBUG_PREBUILT) + execute_process(COMMAND ${PYTHON_EXECUTABLE} + install.py + --install-dir=${CMAKE_SOURCE_DIR}/.. + ${_binary} + WORKING_DIRECTORY ${SCRIPTS_DIR} + RESULT_VARIABLE ${_binary}_installed + ) + endif(INSTALL_PROPRIETARY) + file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}") + else(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed) + set(${_binary}_installed 0) + endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed) + if(NOT ${_binary}_installed EQUAL 0) + message(FATAL_ERROR + "Failed to download or unpack prebuilt '${_binary}'." + " Process returned ${${_binary}_installed}.") + endif (NOT ${_binary}_installed EQUAL 0) + endif (NOT STANDALONE) +endmacro (use_prebuilt_binary _binary) diff --git a/linden/indra/cmake/Python.cmake b/linden/indra/cmake/Python.cmake new file mode 100644 index 0000000..e9505fb --- /dev/null +++ b/linden/indra/cmake/Python.cmake @@ -0,0 +1,49 @@ +# -*- cmake -*- + +set(PYTHONINTERP_FOUND) + +if (WINDOWS) + # On Windows, explicitly avoid Cygwin Python. + + find_program(PYTHON_EXECUTABLE + NAMES python25.exe python23.exe python.exe + NO_DEFAULT_PATH # added so that cmake does not find cygwin python + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] + ) +elseif (EXISTS /etc/debian_version) + # On Debian and Ubuntu, avoid Python 2.4 if possible. + + find_program(PYTHON_EXECUTABLE python2.5 python2.3 python PATHS /usr/bin) + + if (PYTHON_EXECUTABLE) + set(PYTHONINTERP_FOUND ON) + endif (PYTHON_EXECUTABLE) +elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + # On MAC OS X be sure to search standard locations first + + string(REPLACE ":" ";" PATH_LIST "$ENV{PATH}") + find_program(PYTHON_EXECUTABLE + NAMES python python25 python24 python23 + NO_DEFAULT_PATH # Avoid searching non-standard locations first + PATHS + /bin + /usr/bin + /usr/local/bin + ${PATH_LIST} + ) + + if (PYTHON_EXECUTABLE) + set(PYTHONINTERP_FOUND ON) + endif (PYTHON_EXECUTABLE) +else (WINDOWS) + include(FindPythonInterp) +endif (WINDOWS) + +if (NOT PYTHON_EXECUTABLE) + message(FATAL_ERROR "No Python interpreter found") +endif (NOT PYTHON_EXECUTABLE) + +mark_as_advanced(PYTHON_EXECUTABLE) diff --git a/linden/indra/cmake/QuickTime.cmake b/linden/indra/cmake/QuickTime.cmake new file mode 100644 index 0000000..b79ac11 --- /dev/null +++ b/linden/indra/cmake/QuickTime.cmake @@ -0,0 +1,33 @@ +# -*- cmake -*- + +if(INSTALL_PROPRIETARY) + include(Prebuilt) + use_prebuilt_binary(quicktime) +endif(INSTALL_PROPRIETARY) + +if (DARWIN) + include(CMakeFindFrameworks) + find_library(QUICKTIME_LIBRARY QuickTime) +elseif (WINDOWS) + set(QUICKTIME_SDK_DIR "C:\\Program Files\\QuickTime SDK" + CACHE PATH "Location of the QuickTime SDK.") + find_library(QUICKTIME_LIBRARY qtmlclient + PATHS + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release + "${QUICKTIME_SDK_DIR}\\libraries" + ) + include_directories( + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/quicktime + "${QUICKTIME_SDK_DIR}\\CIncludes" + ) +endif (DARWIN) + +mark_as_advanced(QUICKTIME_LIBRARY) + +if (QUICKTIME_LIBRARY) + set(QUICKTIME ON CACHE BOOL "Build with QuickTime streaming media support.") +endif (QUICKTIME_LIBRARY) + +if (QUICKTIME) + add_definitions(-DLL_QUICKTIME_ENABLED=1) +endif (QUICKTIME) diff --git a/linden/indra/cmake/TemplateCheck.cmake b/linden/indra/cmake/TemplateCheck.cmake new file mode 100644 index 0000000..3b73dc8 --- /dev/null +++ b/linden/indra/cmake/TemplateCheck.cmake @@ -0,0 +1,14 @@ +# -*- cmake -*- + +include(Python) + +macro (check_message_template _target) + add_custom_command( + TARGET ${_target} + PRE_LINK + COMMAND ${PYTHON_EXECUTABLE} + ARGS ${SCRIPTS_DIR}/template_verifier.py + --mode=development --cache_master + COMMENT "Verifying message template" + ) +endmacro (check_message_template) diff --git a/linden/indra/cmake/UI.cmake b/linden/indra/cmake/UI.cmake new file mode 100644 index 0000000..f529f5b --- /dev/null +++ b/linden/indra/cmake/UI.cmake @@ -0,0 +1,64 @@ +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + include(FindPkgConfig) + + if (LINUX) + set(PKGCONFIG_PACKAGES + atk + cairo + gdk-2.0 + gdk-pixbuf-2.0 + glib-2.0 + gmodule-2.0 + gtk+-2.0 + gthread-2.0 + libpng + pango + pangoft2 + pangox + pangoxft + sdl + ) + endif (LINUX) + + foreach(pkg ${PKGCONFIG_PACKAGES}) + pkg_check_modules(${pkg} REQUIRED ${pkg}) + include_directories(${${pkg}_INCLUDE_DIRS}) + link_directories(${${pkg}_LIBRARY_DIRS}) + list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES}) + add_definitions(${${pkg}_CFLAGS_OTHERS}) + endforeach(pkg) +else (STANDALONE) + use_prebuilt_binary(gtk-atk-pango-glib) + if (LINUX) + set(UI_LIBRARIES + atk-1.0 + gdk-x11-2.0 + gdk_pixbuf-2.0 + Xinerama + glib-2.0 + gmodule-2.0 + gobject-2.0 + gthread-2.0 + gtk-x11-2.0 + pango-1.0 + pangoft2-1.0 + pangox-1.0 + pangoxft-1.0 + ) + endif (LINUX) + + include_directories ( + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include + ${LIBS_PREBUILT_DIR}/include + ) + foreach(include ${${LL_ARCH}_INCLUDES}) + include_directories(${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/${include}) + endforeach(include) +endif (STANDALONE) + +if (LINUX) + add_definitions(-DLL_GTK=1 -DLL_X11=1) +endif (LINUX) diff --git a/linden/indra/cmake/UnixInstall.cmake b/linden/indra/cmake/UnixInstall.cmake new file mode 100644 index 0000000..139be0a --- /dev/null +++ b/linden/indra/cmake/UnixInstall.cmake @@ -0,0 +1,31 @@ +if (NOT ${viewer_VERSION}) + MESSAGE(FATAL_ERROR "Viewer version not known!") +endif (NOT ${viewer_VERSION}) + +set(INSTALL OFF CACHE BOOL + "Generate install target.") + +if (INSTALL) + set(INSTALL_PREFIX /usr CACHE PATH + "Top-level installation directory.") + + if (EXISTS /lib64) + set(_LIB lib64) + else (EXISTS /lib64) + set(_LIB lib) + endif (EXISTS /lib64) + + set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/${_LIB} CACHE PATH + "Installation directory for read-only shared files.") + + set(INSTALL_SHARE_DIR ${INSTALL_PREFIX}/share CACHE PATH + "Installation directory for read-only shared files.") + + set(APP_BINARY_DIR ${INSTALL_LIBRARY_DIR}/secondlife-${viewer_VERSION} + CACHE PATH + "Installation directory for binaries.") + + set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/secondlife-${viewer_VERSION} + CACHE PATH + "Installation directory for read-only data files.") +endif (INSTALL) diff --git a/linden/indra/cmake/Variables.cmake b/linden/indra/cmake/Variables.cmake new file mode 100644 index 0000000..5868e4d --- /dev/null +++ b/linden/indra/cmake/Variables.cmake @@ -0,0 +1,100 @@ +# -*- cmake -*- +# +# Definitions of variables used throughout the Second Life build +# process. +# +# Platform variables: +# +# DARWIN - Mac OS X +# LINUX - Linux +# WINDOWS - Windows +# +# What to build: +# +# VIEWER - viewer and other viewer-side components +# SERVER - simulator and other server-side bits + + +# Relative and absolute paths to subtrees. + +set(LIBS_CLOSED_PREFIX) +set(LIBS_OPEN_PREFIX) +set(LIBS_SERVER_PREFIX) +set(SCRIPTS_PREFIX ../scripts) +set(SERVER_PREFIX) +set(VIEWER_PREFIX) + +set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX}) +set(LIBS_OPEN_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX}) +set(LIBS_SERVER_DIR ${CMAKE_SOURCE_DIR}/${LIBS_SERVER_PREFIX}) +set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX}) +set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX}) +set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX}) + +set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH + "Location of prebuilt libraries.") + +if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake) + # We use this as a marker that you can try to use the proprietary libraries. + set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries") +endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake) + + +if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(WINDOWS ON BOOL FORCE) + set(ARCH i686) + set(LL_ARCH ${ARCH}_win32) + set(LL_ARCH_DIR ${ARCH}-win32) +endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") + +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(LINUX ON BOOl FORCE) + execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/ + OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) + set(LL_ARCH ${ARCH}_linux) + set(LL_ARCH_DIR ${ARCH}-linux) +endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(DARWIN 1) + # set this dynamically from the build system now - + # NOTE: wont have a distributable build unless you add this on the configure line with: + # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc' + #set(CMAKE_OSX_ARCHITECTURES i386;ppc) + set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk) + if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc") + set(ARCH universal) + else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc") + if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc") + set(ARCH ppc) + else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc") + set(ARCH i386) + endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc") + endif (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc") + set(LL_ARCH ${ARCH}_darwin) + set(LL_ARCH_DIR universal-darwin) +endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + +# Default deploy grid +set(GRID agni CACHE STRING "Target Grid") + +set(VIEWER ON CACHE BOOL "Build Second Life viewer.") +set(VIEWER_CHANNEL "Developer" CACHE STRING "Viewer Channel Name") +set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing") + +set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.") + +if (NOT STANDALONE AND EXISTS ${CMAKE_SOURCE_DIR}/llphysics) + set(SERVER ON CACHE BOOL "Build Second Life server software.") +endif (NOT STANDALONE AND EXISTS ${CMAKE_SOURCE_DIR}/llphysics) + +if (LINUX AND SERVER AND VIEWER) + MESSAGE(FATAL_ERROR " +The indra source does not currently support building SERVER and VIEWER at the same time. +Please set one of these values to OFF in your CMake cache file. +(either by running ccmake or by editing CMakeCache.txt by hand) +For more information, please see JIRA DEV-14943 - Cmake Linux cannot build both VIEWER and SERVER in one build environment + ") +endif (LINUX AND SERVER AND VIEWER) + +source_group("CMake Rules" FILES CMakeLists.txt) diff --git a/linden/indra/cmake/ViewerMiscLibs.cmake b/linden/indra/cmake/ViewerMiscLibs.cmake new file mode 100644 index 0000000..68ee881 --- /dev/null +++ b/linden/indra/cmake/ViewerMiscLibs.cmake @@ -0,0 +1,10 @@ +# -*- cmake -*- +include(Prebuilt) + +if (NOT STANDALONE) + use_prebuilt_binary(libstdc++) + use_prebuilt_binary(libuuid) + use_prebuilt_binary(vivox) + use_prebuilt_binary(fontconfig) +endif(NOT STANDALONE) + diff --git a/linden/indra/cmake/XmlRpcEpi.cmake b/linden/indra/cmake/XmlRpcEpi.cmake new file mode 100644 index 0000000..107d192 --- /dev/null +++ b/linden/indra/cmake/XmlRpcEpi.cmake @@ -0,0 +1,17 @@ +# -*- cmake -*- +include(Prebuilt) + +set(XMLRPCEPI_FIND_QUIETLY ON) +set(XMLRPCEPI_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindXmlRpcEpi) +else (STANDALONE) + use_prebuilt_binary(xmlrpc-epi) + if (WINDOWS) + set(XMLRPCEPI_LIBRARIES xmlrpcepi) + else (WINDOWS) + set(XMLRPCEPI_LIBRARIES xmlrpc-epi) + endif (WINDOWS) + set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) +endif (STANDALONE) diff --git a/linden/indra/cmake/ZLIB.cmake b/linden/indra/cmake/ZLIB.cmake new file mode 100644 index 0000000..80d4191 --- /dev/null +++ b/linden/indra/cmake/ZLIB.cmake @@ -0,0 +1,20 @@ +# -*- cmake -*- + +set(ZLIB_FIND_QUIETLY ON) +set(ZLIB_FIND_REQUIRED ON) + +include(Prebuilt) + +if (STANDALONE) + include(FindZLIB) +else (STANDALONE) + use_prebuilt_binary(zlib) + if (WINDOWS) + set(ZLIB_LIBRARIES zlib) + else (WINDOWS) + set(ZLIB_LIBRARIES z) + endif (WINDOWS) + if (WINDOWS OR LINUX) + set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/zlib) + endif (WINDOWS OR LINUX) +endif (STANDALONE) -- cgit v1.1