diff options
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/00-Common.cmake | 7 | ||||
-rw-r--r-- | indra/cmake/CARes.cmake | 1 | ||||
-rw-r--r-- | indra/cmake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/cmake/Copy3rdPartyLibs.cmake | 2 | ||||
-rw-r--r-- | indra/cmake/GLOD.cmake | 9 | ||||
-rw-r--r-- | indra/cmake/GoogleBreakpad.cmake | 19 | ||||
-rw-r--r-- | indra/cmake/LLAddBuildTest.cmake | 43 | ||||
-rw-r--r-- | indra/cmake/LLConvexDecomposition.cmake | 16 | ||||
-rw-r--r-- | indra/cmake/LLSharedLibs.cmake | 17 | ||||
-rw-r--r-- | indra/cmake/LLTestCommand.cmake | 17 | ||||
-rw-r--r-- | indra/cmake/Variables.cmake | 31 | ||||
-rw-r--r-- | indra/cmake/ViewerMiscLibs.cmake | 7 | ||||
-rw-r--r-- | indra/cmake/run_build_test.py | 2 |
13 files changed, 132 insertions, 41 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 113e21a715..8262462ced 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -68,6 +68,7 @@ if (WINDOWS) add_definitions( /Zc:wchar_t- + /arch:SSE2 ) endif (MSVC80 OR MSVC90) @@ -75,6 +76,10 @@ if (WINDOWS) if (NOT VS_DISABLE_FATAL_WARNINGS) add_definitions(/WX) endif (NOT VS_DISABLE_FATAL_WARNINGS) + + # configure win32 API for windows XP+ compatibility + set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)") + add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}") endif (WINDOWS) @@ -169,6 +174,8 @@ if (LINUX) add_definitions(-fvisibility=hidden) # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway. add_definitions(-DLL_IGNORE_SIGCHLD) + add_definitions(-march=pentium4 -mfpmath=sse) + #add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2 if (NOT STANDALONE) # this stops us requiring a really recent glibc at runtime add_definitions(-fno-stack-protector) diff --git a/indra/cmake/CARes.cmake b/indra/cmake/CARes.cmake index 8a2dc01561..1850b706ac 100644 --- a/indra/cmake/CARes.cmake +++ b/indra/cmake/CARes.cmake @@ -9,6 +9,7 @@ if (STANDALONE) include(FindCARes) else (STANDALONE) use_prebuilt_binary(ares) + add_definitions("-DCARES_STATICLIB") if (WINDOWS) set(CARES_LIBRARIES areslib) elseif (DARWIN) diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 4fc25dcc24..cadd2608e2 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -34,6 +34,7 @@ set(cmake_SOURCE_FILES FindXmlRpcEpi.cmake FMOD.cmake FreeType.cmake + GLOD.cmake GStreamer010Plugin.cmake GooglePerfTools.cmake JPEG.cmake @@ -41,6 +42,7 @@ set(cmake_SOURCE_FILES LLAudio.cmake LLCharacter.cmake LLCommon.cmake + LLConvexDecomposition.cmake LLCrashLogger.cmake LLDatabase.cmake LLImage.cmake diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index c9dc301b8b..9900a8fb45 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -171,6 +171,7 @@ elseif(DARWIN) libexpat.dylib libllqtwebkit.dylib libndofdev.dylib + libexception_handler.dylib ) # fmod is statically linked on darwin @@ -220,6 +221,7 @@ elseif(LINUX) libapr-1.so.0 libaprutil-1.so.0 libatk-1.0.so + libbreakpad_client.so.0 libcrypto.so.0.9.7 libdb-4.2.so libexpat.so diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake new file mode 100644 index 0000000000..77221d55ed --- /dev/null +++ b/indra/cmake/GLOD.cmake @@ -0,0 +1,9 @@ +# -*- cmake -*- +include(Prebuilt) + +if (NOT STANDALONE) + use_prebuilt_binary(GLOD) +endif (NOT STANDALONE) + +set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) +set(GLOD_LIBRARIES glod) diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake new file mode 100644 index 0000000000..8270c0fabb --- /dev/null +++ b/indra/cmake/GoogleBreakpad.cmake @@ -0,0 +1,19 @@ +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + MESSAGE(FATAL_ERROR "*TODO standalone support for google breakad is unimplemented") + # *TODO - implement this include(FindGoogleBreakpad) +else (STANDALONE) + use_prebuilt_binary(google_breakpad) + if (DARWIN) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler) + endif (DARWIN) + if (LINUX) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client) + endif (LINUX) + if (WINDOWS) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common) + endif (WINDOWS) +endif (STANDALONE) + diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index bf4d9b72a9..e8a0a949b6 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -137,21 +137,13 @@ INCLUDE(GoogleMock) SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt) SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR}) - # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19 + # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19 IF(LL_TEST_VERBOSE) MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}") ENDIF(LL_TEST_VERBOSE) - - IF(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) - ELSEIF(DARWIN) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib) - ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib) - ENDIF(WINDOWS) - LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${TEST_CMD}) - SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value}) + SET_TEST_PATH(LD_LIBRARY_PATH) + LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${TEST_CMD}) IF(LL_TEST_VERBOSE) MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}") ENDIF(LL_TEST_VERBOSE) @@ -233,16 +225,8 @@ FUNCTION(LL_ADD_INTEGRATION_TEST LIST(INSERT test_command test_exe_pos "${TEST_EXE}") ENDIF (test_exe_pos LESS 0) - IF(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) - ELSEIF(DARWIN) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib) - ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib) - ENDIF(WINDOWS) - - LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${test_command}) - SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value}) + SET_TEST_PATH(LD_LIBRARY_PATH) + LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${test_command}) if(TEST_DEBUG) message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}") @@ -258,3 +242,20 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD}) ENDFUNCTION(LL_ADD_INTEGRATION_TEST) + +MACRO(SET_TEST_PATH LISTVAR) + IF(WINDOWS) + # We typically build/package only Release variants of third-party + # libraries, so append the Release staging dir in case the library being + # sought doesn't have a debug variant. + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release) + ELSEIF(DARWIN) + # We typically build/package only Release variants of third-party + # libraries, so append the Release staging dir in case the library being + # sought doesn't have a debug variant. + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib) + ELSE(WINDOWS) + # Linux uses a single staging directory anyway. + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib) + ENDIF(WINDOWS) +ENDMACRO(SET_TEST_PATH) diff --git a/indra/cmake/LLConvexDecomposition.cmake b/indra/cmake/LLConvexDecomposition.cmake new file mode 100644 index 0000000000..ae9dc3c17a --- /dev/null +++ b/indra/cmake/LLConvexDecomposition.cmake @@ -0,0 +1,16 @@ +# -*- cmake -*- +include(Prebuilt) + +set(LLCONVEXDECOMP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + +if (INSTALL_PROPRIETARY AND NOT STANDALONE) + use_prebuilt_binary(llconvexdecomposition) + if (WINDOWS) + set(LLCONVEXDECOMP_LIBRARY llconvexdecomposition) + else (WINDOWS) + set(LLCONVEXDECOMP_LIBRARY llconvexdecompositionstub) + endif (WINDOWS) +else (INSTALL_PROPRIETARY AND NOT STANDALONE) + use_prebuilt_binary(llconvexdecompositionstub) + set(LLCONVEXDECOMP_LIBRARY llconvexdecompositionstub) +endif (INSTALL_PROPRIETARY AND NOT STANDALONE) diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake index 6f602680f4..e29076c738 100644 --- a/indra/cmake/LLSharedLibs.cmake +++ b/indra/cmake/LLSharedLibs.cmake @@ -5,20 +5,21 @@ macro(ll_deploy_sharedlibs_command target_exe) get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH) if(DARWIN) - set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources") + SET_TEST_PATH(SEARCH_DIRS) get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE) if(IS_BUNDLE) - # If its a bundle the exe is not in the target location, this should find it. + # If its a bundle the exe is not in the target location, this should find it. get_filename_component(TARGET_FILE ${TARGET_LOCATION} NAME) set(OUTPUT_PATH ${TARGET_LOCATION}.app/Contents/MacOS) set(TARGET_LOCATION ${OUTPUT_PATH}/${TARGET_FILE}) - set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources) + set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources) endif(IS_BUNDLE) elseif(WINDOWS) - set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}" "$ENV{SystemRoot}/system32") + SET_TEST_PATH(SEARCH_DIRS) + LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32") elseif(LINUX) - set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}") - set(OUTPUT_PATH ${OUTPUT_PATH}/lib) + SET_TEST_PATH(SEARCH_DIRS) + set(OUTPUT_PATH ${OUTPUT_PATH}/lib) endif(DARWIN) add_custom_command( @@ -49,7 +50,7 @@ macro(ll_stage_sharedlib DSO_TARGET) else(DARWIN) set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) endif(DARWIN) - + # *TODO - maybe make this a symbolic link? -brad add_custom_command( TARGET ${DSO_TARGET} POST_BUILD @@ -71,4 +72,4 @@ macro(ll_stage_sharedlib DSO_TARGET) ) endif(DARWIN) -endmacro(ll_stage_sharedlib)
\ No newline at end of file +endmacro(ll_stage_sharedlib) diff --git a/indra/cmake/LLTestCommand.cmake b/indra/cmake/LLTestCommand.cmake index fae5640493..554559edbd 100644 --- a/indra/cmake/LLTestCommand.cmake +++ b/indra/cmake/LLTestCommand.cmake @@ -1,13 +1,16 @@ -MACRO(LL_TEST_COMMAND LD_LIBRARY_PATH) +MACRO(LL_TEST_COMMAND OUTVAR LD_LIBRARY_PATH) # nat wonders how Kitware can use the term 'function' for a construct that # cannot return a value. And yet, variables you set inside a FUNCTION are # local. Try a MACRO instead. - SET(LL_TEST_COMMAND_value + SET(value ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/cmake/run_build_test.py") - IF(LD_LIBRARY_PATH) - LIST(APPEND LL_TEST_COMMAND_value "-l${LD_LIBRARY_PATH}") - ENDIF(LD_LIBRARY_PATH) - LIST(APPEND LL_TEST_COMMAND_value ${ARGN}) -##MESSAGE(STATUS "Will run: ${LL_TEST_COMMAND_value}") + FOREACH(dir ${LD_LIBRARY_PATH}) + LIST(APPEND value "-l${dir}") + ENDFOREACH(dir) + LIST(APPEND value ${ARGN}) + SET(${OUTVAR} ${value}) +##IF(LL_TEST_VERBOSE) +## MESSAGE(STATUS "LL_TEST_COMMAND: ${value}") +##ENDIF(LL_TEST_VERBOSE) ENDMACRO(LL_TEST_COMMAND) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 9b1f7024bf..28feb523ea 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -75,11 +75,33 @@ 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: + + # NOTE: If specifying a different SDK with CMAKE_OSX_SYSROOT at configure + # time you should also specify CMAKE_OSX_DEPLOYMENT_TARGET explicitly, + # otherwise CMAKE_OSX_SYSROOT will be overridden here. We can't just check + # for it being unset, as it gets set to the system default :( + + # Default to building against the 10.4u SDK if no deployment target is + # specified. + if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) + # NOTE: setting -isysroot is NOT adequate: http://lists.apple.com/archives/Xcode-users/2007/Oct/msg00696.html + # see http://public.kitware.com/Bug/view.php?id=9959 + poppy + set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.4) + endif (NOT CMAKE_OSX_DEPLOYMENT_TARGET) + + # GCC 4.2 is incompatible with the MacOSX 10.4 SDK + if (${CMAKE_OSX_SYSROOT} MATCHES "10.4u") + set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.0") + endif (${CMAKE_OSX_SYSROOT} MATCHES "10.4u") + + # NOTE: To attempt an i386/PPC Universal build, add this on the configure line: # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc' - #set(CMAKE_OSX_ARCHITECTURES i386;ppc) - set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) + # Build only for i386 by default, system default on MacOSX 10.6 is x86_64 + if (NOT CMAKE_OSX_ARCHITECTURES) + set(CMAKE_OSX_ARCHITECTURES i386) + endif (NOT CMAKE_OSX_ARCHITECTURES) + 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") @@ -89,6 +111,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 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) set(WORD_SIZE 32) diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 2a8abdac23..32c4bc81df 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -7,3 +7,10 @@ if (NOT STANDALONE) use_prebuilt_binary(fontconfig) endif(NOT STANDALONE) +if(VIEWER AND NOT STANDALONE) + if(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker) + message(STATUS "We seem to have an artwork bundle in the tree - brilliant.") + else(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker) + message(FATAL_ERROR "Didn't find an artwork bundle - this needs to be downloaded separately and unpacked into this tree. You can probably get it from the same place you got your viewer source. Thanks!") + endif(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker) +endif(VIEWER AND NOT STANDALONE) diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index 0f6967e42a..1c57d5139c 100644 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -22,7 +22,7 @@ python run_build_test.py -DFOO=bar myprog somearg otherarg sets environment variable FOO=bar, then runs: myprog somearg otherarg -$LicenseInfo:firstyear=2009&license=internal$ +$LicenseInfo:firstyear=2009&license=viewergpl$ Copyright (c) 2009, Linden Research, Inc. $/LicenseInfo$ """ |