From 5e0090c8daa5ae53f7907bbd2b6145f252f278cd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Dec 2008 11:34:13 -0700 Subject: Added fix for VWR-10392 as well as other fixes --- linden/indra/CMakeLists.txt | 4 + linden/indra/cmake/00-Common.cmake | 8 ++ linden/indra/cmake/APR.cmake | 23 ++---- linden/indra/cmake/CopyWinLibs.cmake | 57 +++++++++++++- linden/indra/cmake/DBusGlib.cmake | 29 +++++++ linden/indra/cmake/DirectX.cmake | 22 +++--- linden/indra/cmake/FindMono.cmake | 18 ++--- linden/indra/cmake/GooglePerfTools.cmake | 6 +- linden/indra/cmake/LLXML.cmake | 2 + linden/indra/cmake/Linking.cmake | 8 +- linden/indra/cmake/NDOF.cmake | 6 +- linden/indra/cmake/Python.cmake | 1 + linden/indra/cmake/QuickTime.cmake | 22 +++++- linden/indra/develop.py | 125 ++++++++++++++++++++++--------- linden/indra/newview/CMakeLists.txt | 58 ++++++++------ 15 files changed, 287 insertions(+), 102 deletions(-) create mode 100644 linden/indra/cmake/DBusGlib.cmake (limited to 'linden/indra') diff --git a/linden/indra/CMakeLists.txt b/linden/indra/CMakeLists.txt index 09fa753..1453fe4 100644 --- a/linden/indra/CMakeLists.txt +++ b/linden/indra/CMakeLists.txt @@ -65,7 +65,11 @@ if (VIEWER) add_dependencies(viewer mac-updater mac-crash-logger) elseif (WINDOWS) add_subdirectory(${VIEWER_PREFIX}win_crash_logger) + if (EXISTS ${VIEWER_PREFIX}win_setup) + add_subdirectory(${VIEWER_PREFIX}win_setup) + endif (EXISTS ${VIEWER_PREFIX}win_setup) add_subdirectory(${VIEWER_PREFIX}win_updater) + # add_dependencies(viewer windows-updater windows-setup windows-crash-logger) add_dependencies(viewer windows-updater windows-crash-logger) elseif (SOLARIS) add_subdirectory(solaris_crash_logger) diff --git a/linden/indra/cmake/00-Common.cmake b/linden/indra/cmake/00-Common.cmake index 977e588..c41591f 100644 --- a/linden/indra/cmake/00-Common.cmake +++ b/linden/indra/cmake/00-Common.cmake @@ -49,6 +49,10 @@ if (WINDOWS) ) if(MSVC80 OR MSVC90) + set(CMAKE_CXX_FLAGS_RELEASE + "${CMAKE_CXX_FLAGS_RELEASE} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0" + CACHE STRING "C++ compiler release options" FORCE) + add_definitions( /Zc:wchar_t- ) @@ -165,6 +169,10 @@ if (DARWIN) 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") + # NOTE: it's critical that the optimization flag is put in front. + # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered. + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}") endif (DARWIN) diff --git a/linden/indra/cmake/APR.cmake b/linden/indra/cmake/APR.cmake index 2a96d70..2563a98 100644 --- a/linden/indra/cmake/APR.cmake +++ b/linden/indra/cmake/APR.cmake @@ -15,24 +15,16 @@ if (STANDALONE) 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 + debug ${ARCH_PREBUILT_DIRS_DEBUG}/apr-1.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/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 + debug ${ARCH_PREBUILT_DIRS_DEBUG}/aprutil-1.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1.lib ) + # Doesn't need to link with iconv.dll + set(APRICONV_LIBRARIES "") elseif (DARWIN) set(APR_LIBRARIES debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a @@ -42,10 +34,11 @@ else (STANDALONE) debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a ) - set(APRICONV_LIBRARIES apriconv-1) + set(APRICONV_LIBRARIES iconv) else (WINDOWS) set(APR_LIBRARIES apr-1) set(APRUTIL_LIBRARIES aprutil-1) + set(APRICONV_LIBRARIES iconv) endif (WINDOWS) set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/apr-1) diff --git a/linden/indra/cmake/CopyWinLibs.cmake b/linden/indra/cmake/CopyWinLibs.cmake index e2c45fd..3234bfa 100644 --- a/linden/indra/cmake/CopyWinLibs.cmake +++ b/linden/indra/cmake/CopyWinLibs.cmake @@ -106,4 +106,59 @@ copy_if_different( set(all_targets ${all_targets} ${out_targets}) -add_custom_target(copy_win_libs ALL DEPENDS ${all_targets}) \ No newline at end of file +# Copy MS C runtime dlls, required for packaging. +# *TODO - Adapt this to support VC9 +if (MSVC80) + FIND_PATH(debug_msvc8_redist_path msvcr80d.dll + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT + ) + + if(EXISTS ${debug_msvc8_redist_path}) + set(debug_msvc8_files + msvcr80d.dll + msvcp80d.dll + Microsoft.VC80.DebugCRT.manifest + ) + + copy_if_different( + ${debug_msvc8_redist_path} + "${CMAKE_CURRENT_BINARY_DIR}/Debug" + out_targets + ${debug_msvc8_files} + ) + set(all_targets ${all_targets} ${out_targets}) + endif (EXISTS ${debug_msvc8_redist_path}) + + FIND_PATH(release_msvc8_redist_path msvcr80.dll + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT + ) + + if(EXISTS ${release_msvc8_redist_path}) + set(release_msvc8_files + msvcr80.dll + msvcp80.dll + Microsoft.VC80.CRT.manifest + ) + + copy_if_different( + ${release_msvc8_redist_path} + "${CMAKE_CURRENT_BINARY_DIR}/Release" + out_targets + ${release_msvc8_files} + ) + set(all_targets ${all_targets} ${out_targets}) + + copy_if_different( + ${release_msvc8_redist_path} + "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" + out_targets + ${release_msvc8_files} + ) + set(all_targets ${all_targets} ${out_targets}) + + endif (EXISTS ${release_msvc8_redist_path}) +endif (MSVC80) + +add_custom_target(copy_win_libs ALL DEPENDS ${all_targets}) diff --git a/linden/indra/cmake/DBusGlib.cmake b/linden/indra/cmake/DBusGlib.cmake new file mode 100644 index 0000000..cfc4ccd --- /dev/null +++ b/linden/indra/cmake/DBusGlib.cmake @@ -0,0 +1,29 @@ +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + include(FindPkgConfig) + + pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) + +elseif (LINUX) + use_prebuilt_binary(dbusglib) + set(DBUSGLIB_FOUND ON FORCE BOOL) + set(DBUSGLIB_INCLUDE_DIRS + ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/glib-2.0 + ) + # We don't need to explicitly link against dbus-glib itself, because + # the viewer probes for the system's copy at runtime. + set(DBUSGLIB_LIBRARIES + gobject-2.0 + glib-2.0 + ) +endif (STANDALONE) + +if (DBUSGLIB_FOUND) + set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") +endif (DBUSGLIB_FOUND) + +if (DBUSGLIB) + add_definitions(-DLL_DBUS_ENABLED=1) +endif (DBUSGLIB) diff --git a/linden/indra/cmake/DirectX.cmake b/linden/indra/cmake/DirectX.cmake index 4d2d5e0..d406f37 100644 --- a/linden/indra/cmake/DirectX.cmake +++ b/linden/indra/cmake/DirectX.cmake @@ -3,12 +3,13 @@ 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" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Include" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Include" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2008)/Include" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (November 2007)/Include" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2007)/Include" "C:/DX90SDK/Include" - "C:/Program Files/DX90SDK/Include" + "$ENV{PROGRAMFILES}/DX90SDK/Include" ) if (DIRECTX_INCLUDE_DIR) include_directories(${DIRECTX_INCLUDE_DIR}) @@ -22,12 +23,13 @@ if (VIEWER AND WINDOWS) 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" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Lib/x86" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Lib/x86" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2008)/Lib/x86" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (November 2007)/Lib/x86" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2007)/Lib/x86" "C:/DX90SDK/Lib" - "C:/Program Files/DX90SDK/Lib" + "$ENV{PROGRAMFILES}/DX90SDK/Lib" ) if (DIRECTX_LIBRARY_DIR) if (DIRECTX_FIND_QUIETLY) diff --git a/linden/indra/cmake/FindMono.cmake b/linden/indra/cmake/FindMono.cmake index f0a0705..c36d725 100644 --- a/linden/indra/cmake/FindMono.cmake +++ b/linden/indra/cmake/FindMono.cmake @@ -14,29 +14,29 @@ # 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" + "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" + "$ENV{PROGRAMFILES}/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" + "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" + "$ENV{PROGRAMFILES}/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" + "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" + "$ENV{PROGRAMFILES}/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" + "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" + "$ENV{PROGRAMFILES}/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin @@ -44,7 +44,7 @@ FIND_PROGRAM (GACUTIL_EXECUTABLE gacutil 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 + PATHS "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" "$ENV{PROGRAMFILES}/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin ) SET (MONO_FOUND FALSE) diff --git a/linden/indra/cmake/GooglePerfTools.cmake b/linden/indra/cmake/GooglePerfTools.cmake index 9b3eca0..25e9f6d 100644 --- a/linden/indra/cmake/GooglePerfTools.cmake +++ b/linden/indra/cmake/GooglePerfTools.cmake @@ -19,10 +19,14 @@ if (GOOGLE_PERFTOOLS_FOUND) set(USE_GOOGLE_PERFTOOLS ON CACHE BOOL "Build with Google PerfTools support.") endif (GOOGLE_PERFTOOLS_FOUND) +# XXX Disable temporarily, until we have compilation issues on 64-bit +# Etch sorted. +set(USE_GOOGLE_PERFTOOLS OFF) + 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}) + 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/linden/indra/cmake/LLXML.cmake b/linden/indra/cmake/LLXML.cmake index 1ce93c0..dd2ebca 100644 --- a/linden/indra/cmake/LLXML.cmake +++ b/linden/indra/cmake/LLXML.cmake @@ -1,9 +1,11 @@ # -*- cmake -*- +include(Boost) include(EXPAT) set(LLXML_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llxml + ${Boost_INCLUDE_DIRS} ${EXPAT_INCLUDE_DIRS} ) diff --git a/linden/indra/cmake/Linking.cmake b/linden/indra/cmake/Linking.cmake index c9748e3..167c5dd 100644 --- a/linden/indra/cmake/Linking.cmake +++ b/linden/indra/cmake/Linking.cmake @@ -7,15 +7,15 @@ if (NOT STANDALONE) 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}) + set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client) else (VIEWER) set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release) endif (VIEWER) + set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS}) + set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS}) elseif (DARWIN) set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release) + set(ARCH_PREBUILT_DIRS ${ARCH_PREBUILT_DIRS_RELEASE}) set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS_RELEASE}) endif (WINDOWS) endif (NOT STANDALONE) diff --git a/linden/indra/cmake/NDOF.cmake b/linden/indra/cmake/NDOF.cmake index 3f715a2..dad74e9 100644 --- a/linden/indra/cmake/NDOF.cmake +++ b/linden/indra/cmake/NDOF.cmake @@ -3,12 +3,12 @@ include(Prebuilt) use_prebuilt_binary(ndofdev) -if (WINDOWS OR DARWIN) +if (WINDOWS OR DARWIN OR LINUX) add_definitions(-DLIB_NDOF=1) -endif (WINDOWS OR DARWIN) +endif (WINDOWS OR DARWIN OR LINUX) if (WINDOWS) set(NDOF_LIBRARY libndofdev) -elseif (DARWIN) +elseif (DARWIN OR LINUX) set(NDOF_LIBRARY ndofdev) endif (WINDOWS) diff --git a/linden/indra/cmake/Python.cmake b/linden/indra/cmake/Python.cmake index e9505fb..4f86d32 100644 --- a/linden/indra/cmake/Python.cmake +++ b/linden/indra/cmake/Python.cmake @@ -9,6 +9,7 @@ if (WINDOWS) 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.6\\InstallPath] [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] diff --git a/linden/indra/cmake/QuickTime.cmake b/linden/indra/cmake/QuickTime.cmake index b79ac11..4352709 100644 --- a/linden/indra/cmake/QuickTime.cmake +++ b/linden/indra/cmake/QuickTime.cmake @@ -9,13 +9,29 @@ if (DARWIN) include(CMakeFindFrameworks) find_library(QUICKTIME_LIBRARY QuickTime) elseif (WINDOWS) - set(QUICKTIME_SDK_DIR "C:\\Program Files\\QuickTime SDK" + set(QUICKTIME_SDK_DIR "$ENV{PROGRAMFILES}/QuickTime SDK" CACHE PATH "Location of the QuickTime SDK.") - find_library(QUICKTIME_LIBRARY qtmlclient + + find_library(DEBUG_QUICKTIME_LIBRARY qtmlclient + PATHS + ${ARCH_PREBUILT_DIRS_DEBUG} + "${QUICKTIME_SDK_DIR}\\libraries" + ) + + find_library(RELEASE_QUICKTIME_LIBRARY qtmlclient PATHS - ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release + ${ARCH_PREBUILT_DIRS_RELEASE} "${QUICKTIME_SDK_DIR}\\libraries" ) + + if (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY) + set(QUICKTIME_LIBRARY + optimized ${RELEASE_QUICKTIME_LIBRARY} + debug ${DEBUG_QUICKTIME_LIBRARY} + ) + + endif (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY) + include_directories( ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/quicktime "${QUICKTIME_SDK_DIR}\\CIncludes" diff --git a/linden/indra/develop.py b/linden/indra/develop.py index a0b11c6..830f74d 100755 --- a/linden/indra/develop.py +++ b/linden/indra/develop.py @@ -53,6 +53,16 @@ def mkdir(path): if err.errno != errno.EEXIST or not os.path.isdir(path): raise +def getcwd(): + cwd = os.getcwd() + if 'a' <= cwd[0] <= 'z' and cwd[1] == ':': + # CMake wants DOS drive letters to be in uppercase. The above + # condition never asserts on platforms whose full path names + # always begin with a slash, so we don't need to test whether + # we are running on Windows. + cwd = cwd[0].upper() + cwd[1:] + return cwd + def quote(opts): return '"' + '" "'.join([ opt.replace('"', '') for opt in opts ]) + '"' @@ -65,6 +75,7 @@ class PlatformSetup(object): build_type = build_types['relwithdebinfo'] standalone = 'FALSE' unattended = 'FALSE' + project_name = 'Imprudence' distcc = True cmake_opts = [] @@ -141,7 +152,7 @@ class PlatformSetup(object): # do a sanity check to make sure we have a generator if not hasattr(self, 'generator'): raise "No generator available for '%s'" % (self.__name__,) - cwd = os.getcwd() + cwd = getcwd() created = [] try: for d in self.build_dirs(): @@ -223,6 +234,10 @@ class UnixSetup(PlatformSetup): class LinuxSetup(UnixSetup): def __init__(self): super(LinuxSetup, self).__init__() + try: + self.debian_sarge = open('/etc/debian_version').read().strip() == '3.1' + except: + self.debian_sarge = False def os(self): return 'linux' @@ -230,10 +245,17 @@ class LinuxSetup(UnixSetup): def build_dirs(self): # Only build the server code if (a) we have it and (b) we're # on 32-bit x86. + platform_build = '%s-%s' % (self.platform(), self.build_type.lower()) + if self.arch() == 'i686' and self.is_internal_tree(): - return ['viewer-' + self.platform(), 'server-' + self.platform()] + return ['viewer-' + platform_build, 'server-' + platform_build] + elif self.arch() == 'x86_64' and self.is_internal_tree(): + # the viewer does not build in 64bit -- kdu5 issues + # we can either use openjpeg, or overhaul our viewer to handle kdu5 or higher + # doug knows about kdu issues + return ['server-' + platform_build] else: - return ['viewer-' + self.platform()] + return ['viewer-' + platform_build] def find_in_path(self, name, defval=None, basename=False): for p in os.getenv('PATH', '/usr/bin').split(':'): @@ -251,7 +273,8 @@ class LinuxSetup(UnixSetup): opts=quote(opts), standalone=self.standalone, unattended=self.unattended, - type=self.build_type.upper() + type=self.build_type.upper(), + project_name=self.project_name ) if not self.is_internal_tree(): args.update({'cxx':'g++', 'server':'FALSE', 'viewer':'TRUE'}) @@ -263,22 +286,20 @@ class LinuxSetup(UnixSetup): distcc = [] baseonly = False if 'server' in build_dir: - gcc33 = distcc + self.find_in_path('g++-3.3', 'g++', baseonly) - args.update({'cxx':' '.join(gcc33), 'server':'TRUE', - 'viewer':'FALSE'}) + gcc = distcc + self.find_in_path( + self.debian_sarge and 'g++-3.3' or 'g++-4.1', + 'g++', baseonly) + args.update({'cxx': ' '.join(gcc), 'server': 'TRUE', + 'viewer': 'FALSE'}) else: gcc41 = distcc + self.find_in_path('g++-4.1', 'g++', baseonly) args.update({'cxx': ' '.join(gcc41), 'server':'FALSE', 'viewer':'TRUE'}) - #if simple: - # return (('cmake %(opts)s ' - # '-DSERVER:BOOL=%(server)s ' - # '-DVIEWER:BOOL=%(viewer)s ' - # '%(dir)r') % args) cmd = (('cmake -DCMAKE_BUILD_TYPE:STRING=%(type)s ' '-G %(generator)r -DSERVER:BOOL=%(server)s ' '-DVIEWER:BOOL=%(viewer)s -DSTANDALONE:BOOL=%(standalone)s ' '-DUNATTENDED:BOOL=%(unattended)s ' + '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' '%(opts)s %(dir)r') % args) if 'CXX' not in os.environ: @@ -381,6 +402,7 @@ class DarwinSetup(UnixSetup): opts=quote(opts), standalone=self.standalone, unattended=self.unattended, + project_name=self.project_name, universal='', type=self.build_type.upper() ) @@ -392,11 +414,12 @@ class DarwinSetup(UnixSetup): '-DCMAKE_BUILD_TYPE:STRING=%(type)s ' '-DSTANDALONE:BOOL=%(standalone)s ' '-DUNATTENDED:BOOL=%(unattended)s ' + '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' '%(universal)s ' '%(opts)s %(dir)r' % args) def run_build(self, opts, targets): - cwd = os.getcwd() + cwd = getcwd() if targets: targets = ' '.join(['-target ' + repr(t) for t in targets]) else: @@ -439,7 +462,7 @@ class WindowsSetup(PlatformSetup): def _get_generator(self): if self._generator is None: - for version in 'vc71 vc80 vc90'.split(): + for version in 'vc80 vc90 vc71'.split(): if self.find_visual_studio(version): self._generator = version print 'Building with ', self.gens[version]['gen'] @@ -467,12 +490,14 @@ class WindowsSetup(PlatformSetup): opts=quote(opts), standalone=self.standalone, unattended=self.unattended, + project_name=self.project_name ) #if simple: # return 'cmake %(opts)s "%(dir)s"' % args return ('cmake -G "%(generator)s" ' '-DSTANDALONE:BOOL=%(standalone)s ' '-DUNATTENDED:BOOL=%(unattended)s ' + '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' '%(opts)s "%(dir)s"' % args) def find_visual_studio(self, gen=None): @@ -503,11 +528,11 @@ class WindowsSetup(PlatformSetup): if self.gens[self.generator]['ver'] in [ r'8.0', r'9.0' ]: config = '\"%s|Win32\"' % config - return "buildconsole Imprudence.sln /build %s" % config + return "buildconsole %s.sln /build %s" % (self.project_name, config) # devenv.com is CLI friendly, devenv.exe... not so much. - return ('"%sdevenv.com" Imprudence.sln /build %s' % - (self.find_visual_studio(), self.build_type)) + return ('"%sdevenv.com" %s.sln /build %s' % + (self.find_visual_studio(), self.project_name, self.build_type)) # this override of run exists because the PlatformSetup version # uses Unix/Mac only calls. Freakin' os module! @@ -524,17 +549,26 @@ class WindowsSetup(PlatformSetup): '''Override to add the vstool.exe call after running cmake.''' PlatformSetup.run_cmake(self, args) if self.unattended == 'FALSE': - for build_dir in self.build_dirs(): - vstool_cmd = os.path.join('tools','vstool','VSTool.exe') \ - + ' --solution ' \ - + os.path.join(build_dir,'Imprudence.sln') \ - + ' --config RelWithDebInfo' \ - + ' --startup imprudence-bin' - print 'Running %r in %r' % (vstool_cmd, os.getcwd()) - self.run(vstool_cmd) + self.run_vstool() + + def run_vstool(self): + for build_dir in self.build_dirs(): + stamp = os.path.join(build_dir, 'vstool.txt') + try: + prev_build = open(stamp).read().strip() + except IOError: + prev_build = '' + vstool_cmd = (os.path.join('tools','vstool','VSTool.exe') + + ' --solution ' + + os.path.join(build_dir,'Imprudence.sln') + + ' --config ' + self.build_type + + ' --startup imprudence-bin') + print 'Running %r in %r' % (vstool_cmd, getcwd()) + self.run(vstool_cmd) + print >> open(stamp, 'w'), self.build_type def run_build(self, opts, targets): - cwd = os.getcwd() + cwd = getcwd() build_cmd = self.get_build_cmd() for d in self.build_dirs(): @@ -565,12 +599,14 @@ class CygwinSetup(WindowsSetup): opts=quote(opts), standalone=self.standalone, unattended=self.unattended, + project_name=self.project_name ) #if simple: # return 'cmake %(opts)s "%(dir)s"' % args return ('cmake -G "%(generator)s" ' '-DUNATTENDED:BOOl=%(unattended)s ' '-DSTANDALONE:BOOL=%(standalone)s ' + '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' '%(opts)s "%(dir)s"' % args) setup_platform = { @@ -582,7 +618,7 @@ setup_platform = { usage_msg = ''' -Usage: develop.py [options] command [command-options] +Usage: develop.py [options] [command [command-options]] Options: -h | --help print this help message @@ -595,12 +631,26 @@ Options: Windows: VC71 or VS2003 (default), VC80 (VS2005) or VC90 (VS2008) Mac OS X: Xcode (default), Unix Makefiles Linux: Unix Makefiles (default), KDevelop3 + -p | --project=NAME set the root project name. (Doesn't effect makefiles) + Commands: build configure and build default target clean delete all build directories (does not affect sources) configure configure project by running cmake -If you do not specify a command, the default is "configure". +Command-options for "configure": + We use cmake variables to change the build configuration. + -DSERVER:BOOL=OFF Don't configure simulator/dataserver/etc + -DVIEWER:BOOL=OFF Don't configure the viewer + -DPACKAGE:BOOL=ON Create "package" target to make installers + -DLOCALIZESETUP:BOOL=ON Create one win_setup target per supported language + +Examples: + Set up a viewer-only project for your system: + develop.py configure -DSERVER:BOOL=OFF + + Set up a Visual Studio 2005 project with "package" target: + develop.py -G vc80 configure -DPACKAGE:BOOL=ON ''' def main(arguments): @@ -608,10 +658,14 @@ def main(arguments): try: opts, args = getopt.getopt( arguments, - '?hNt:G:', - ['help', 'standalone', 'no-distcc', 'unattended', 'type=', 'incredibuild', 'generator=']) + '?hNt:p:G:', + ['help', 'standalone', 'no-distcc', 'unattended', 'type=', 'incredibuild', 'generator=', 'project=']) except getopt.GetoptError, err: print >> sys.stderr, 'Error:', err + print >> sys.stderr, """ +Note: You must pass -D options to cmake after the "configure" command +For example: develop.py configure -DSERVER:BOOL=OFF""" + print >> sys.stderr, usage_msg.strip() sys.exit(1) for o, a in opts: @@ -637,6 +691,8 @@ def main(arguments): setup.generator = a elif o in ('-N', '--no-distcc'): setup.distcc = False + elif o in ('-p', '--project'): + setup.project_name = a elif o in ('--incredibuild'): setup.incredibuild = True else: @@ -664,13 +720,14 @@ def main(arguments): print >> sys.stderr, 'Error: unknown subcommand', repr(cmd) print >> sys.stderr, "(run 'develop.py --help' for help)" sys.exit(1) - except CommandError, err: - print >> sys.stderr, 'Error:', err - sys.exit(1) except getopt.GetoptError, err: print >> sys.stderr, 'Error with %r subcommand: %s' % (cmd, err) sys.exit(1) if __name__ == '__main__': - main(sys.argv[1:]) + try: + main(sys.argv[1:]) + except CommandError, err: + print >> sys.stderr, 'Error:', err + sys.exit(1) diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index 9b7a647..53054aa 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -5,9 +5,9 @@ project(viewer) include(00-Common) include(Boost) include(BuildVersion) +include(DBusGlib) include(DirectX) include(ELFIO) -include(FMOD) include(FindOpenGL) include(LLAudio) include(LLCharacter) @@ -429,6 +429,9 @@ set(viewer_SOURCE_FILES pipeline.cpp ) +set(VIEWER_BINARY_NAME "imprudence-bin" CACHE STRING + "The name of the viewer executable to create.") + if (LINUX) # We can't set these flags for Darwin, because they get passed to # the PPC compiler. Ugh. @@ -849,8 +852,8 @@ if (DARWIN) secondlife.icns macview.r gpu_table.txt - Info-SecondLife.plist - SecondLife.nib/ + Info-Imprudence.plist + Imprudence.nib/ # CMake doesn't seem to support Xcode language variants well just yet English.lproj/InfoPlist.strings English.lproj/language.txt @@ -870,6 +873,7 @@ endif (DARWIN) if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) + LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) LIST(APPEND CMAKE_EXE_LINKER_FLAGS -Wl,--as-needed) set(viewer_LIBRARIES @@ -1238,8 +1242,13 @@ set_source_files_properties(${viewer_CHARACTER_FILES} list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES}) + +if (OPENAL) + set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_OPENAL") +endif (OPENAL) + if (FMOD) - set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS -DLL_FMOD) + set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMOD") if (NOT WINDOWS) set(fmodwrapper_SOURCE_FILES fmodwrapper.cpp) @@ -1259,6 +1268,8 @@ if (FMOD) endif (NOT WINDOWS) endif (FMOD) +set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}") + list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES}) set_source_files_properties(${viewer_HEADER_FILES} @@ -1374,7 +1385,7 @@ target_link_libraries(imprudence-bin ${viewer_LIBRARIES} ${BOOST_PROGRAM_OPTIONS_LIBRARY} ${BOOST_REGEX_LIBRARY} - ${BOOST_SIGNALS_LIBRARY} + ${DBUSGLIB_LIBRARIES} ${OPENGL_LIBRARIES} ${FMODWRAPPER_LIBRARY} ${OPENGL_LIBRARIES} @@ -1462,24 +1473,27 @@ if (DARWIN) ) if (PACKAGE) - add_custom_target(package - COMMAND - ${PYTHON_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - --grid=${GRID} - --configuration=${CMAKE_CFG_INTDIR} - --channel=${VIEWER_CHANNEL} - --login_channel=${VIEWER_CHANNEL} - --source=${CMAKE_CURRENT_SOURCE_DIR} - --artwork=${ARTWORK_DIR} - --build=${CMAKE_CURRENT_BINARY_DIR} - --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app - --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched - DEPENDS - imprudence-bin - ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - ) + add_custom_target(package ALL DEPENDS imprudence-bin) add_dependencies(package mac-updater mac-crash-logger) + + add_custom_command( + TARGET package POST_BUILD + COMMAND ${PYTHON_EXECUTABLE} + ARGS + ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + --grid=${GRID} + --configuration=${CMAKE_CFG_INTDIR} + --channel=${VIEWER_CHANNEL} + --login_channel=${VIEWER_LOGIN_CHANNEL} + --source=${CMAKE_CURRENT_SOURCE_DIR} + --artwork=${ARTWORK_DIR} + --build=${CMAKE_CURRENT_BINARY_DIR} + --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app + --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + ) + endif (PACKAGE) endif (DARWIN) -- cgit v1.1