From a4000c3744e42fcbb638e742f3b63fa31a0dee15 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Fri, 8 May 2009 07:43:08 +0000 Subject: merge trunk@116587 skinning-7@119389 -> viewer-2.0.0-skinning-7 --- indra/cmake/LLAddBuildTest.cmake | 1 + indra/cmake/Variables.cmake | 1 + 2 files changed, 2 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 08151bc732..b19eebe1fe 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -31,6 +31,7 @@ MACRO(ADD_BUILD_TEST name parent) SET(basic_libraries ${LLCOMMON_LIBRARIES} + ${LLMATH_LIBRARIES} ${APRUTIL_LIBRARIES} ${APR_LIBRARIES} ${PTHREAD_LIBRARY} diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index c4dcc7eae7..adff01197f 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -23,6 +23,7 @@ set(LIBS_SERVER_PREFIX) set(SCRIPTS_PREFIX ../scripts) set(SERVER_PREFIX) set(VIEWER_PREFIX) +set(INTEGRATION_TESTS_PREFIX) set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX}) set(LIBS_OPEN_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX}) -- cgit v1.2.3 From dc934629919bdcaea72c78e5291263914fb958ec Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 May 2009 20:05:46 +0000 Subject: svn merge -r113003:119136 svn+ssh://svn.lindenlab.com/svn/linden/branches/login-api/login-api-2 svn+ssh://svn.lindenlab.com/svn/linden/branches/login-api/login-api-3 --- indra/cmake/LLAddBuildTest.cmake | 7 ++++++- indra/cmake/LLLogin.cmake | 7 +++++++ indra/cmake/Pth.cmake | 21 +++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 indra/cmake/LLLogin.cmake create mode 100644 indra/cmake/Pth.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index b19eebe1fe..6eeff45afe 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -1,6 +1,7 @@ # -*- cmake -*- INCLUDE(APR) +INCLUDE(Pth) INCLUDE(LLMath) MACRO(ADD_BUILD_TEST_NO_COMMON name parent) @@ -36,6 +37,7 @@ MACRO(ADD_BUILD_TEST name parent) ${APR_LIBRARIES} ${PTHREAD_LIBRARY} ${WINDOWS_LIBRARIES} + ${PTH_LIBRARIES} ) SET(basic_source_files ${name}.cpp @@ -89,10 +91,13 @@ MACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files) GET_TARGET_PROPERTY(TEST_EXE ${name}_test LOCATION) SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}_test_ok.txt) + SET(run_needs ${name}_test) + IF ("${wrapper}" STREQUAL "") SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR}) ELSE ("${wrapper}" STREQUAL "") SET(TEST_CMD ${PYTHON_EXECUTABLE} ${wrapper} ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR}) + SET(run_needs ${run_needs} ${wrapper}) ENDIF ("${wrapper}" STREQUAL "") #MESSAGE(STATUS "ADD_BUILD_TEST_INTERNAL ${name} test_cmd = ${TEST_CMD}") @@ -107,7 +112,7 @@ MACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files) ADD_CUSTOM_COMMAND( OUTPUT ${TEST_OUTPUT} COMMAND ${TEST_SCRIPT_CMD} - DEPENDS ${name}_test + DEPENDS ${run_needs} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/indra/cmake/LLLogin.cmake b/indra/cmake/LLLogin.cmake new file mode 100644 index 0000000000..47d171876a --- /dev/null +++ b/indra/cmake/LLLogin.cmake @@ -0,0 +1,7 @@ +# -*- cmake -*- + +set(LLLOGIN_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/viewer_components/login + ) + +set(LLLOGIN_LIBRARIES lllogin) diff --git a/indra/cmake/Pth.cmake b/indra/cmake/Pth.cmake new file mode 100644 index 0000000000..a28f6ec696 --- /dev/null +++ b/indra/cmake/Pth.cmake @@ -0,0 +1,21 @@ +# -*- cmake -*- +include(Prebuilt) + +set(PTH_FIND_QUIETLY ON) +set(PTH_FIND_REQUIRED ON) + +if (STANDALONE) +# ?? How would I construct FindPTH.cmake? This file was cloned from +# CURL.cmake, which uses include(FindCURL), but there's no FindCURL.cmake? +# include(FindPTH) +else (STANDALONE) + # This library is only needed to support Boost.Coroutine, and only on Mac. + if (DARWIN) + use_prebuilt_binary(pth) + set(PTH_LIBRARIES pth) + set(PTH_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + else (DARWIN) + set(PTH_LIBRARIES) + set(PTH_INCLUDE_DIRS) + endif (DARWIN) +endif (STANDALONE) -- cgit v1.2.3 From 01d390825a5d9ba37715b80cd0aa7aede022dcec Mon Sep 17 00:00:00 2001 From: Brad Kittenbrink Date: Fri, 22 May 2009 23:27:16 +0000 Subject: DEV-27646 dll linkage for login module. Ok, finally got this to a point where it doesn't break the build and I can check in. llcommon can be built as a shared library (disabled but can be enabled with cmake cache var LLCOMMON_LINK_SHARED. reviewed by Mani on tuesday (I still need to get his suggested changes re-reviewed) --- indra/cmake/LLCommon.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake index 410766e4f9..e9e3784e69 100644 --- a/indra/cmake/LLCommon.cmake +++ b/indra/cmake/LLCommon.cmake @@ -13,3 +13,8 @@ set(LLCOMMON_INCLUDE_DIRS ) set(LLCOMMON_LIBRARIES llcommon) + +set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a shared library.") +if(LLCOMMON_LINK_SHARED) + add_definitions(-DLL_COMMON_LINK_SHARED=1) +endif(LLCOMMON_LINK_SHARED) -- cgit v1.2.3 From 7c1742ec7d626ff34084624729b338f9abc58686 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Tue, 30 Jun 2009 19:12:39 -0400 Subject: Added hack for fetching eventlet in place of svn:externals. --- indra/cmake/Externals.cmake | 34 ++++++++++++++++++++++++++++++++++ indra/cmake/FindSVN.cmake | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 indra/cmake/Externals.cmake create mode 100644 indra/cmake/FindSVN.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/Externals.cmake b/indra/cmake/Externals.cmake new file mode 100644 index 0000000000..26f3b56049 --- /dev/null +++ b/indra/cmake/Externals.cmake @@ -0,0 +1,34 @@ +# -*- cmake -*- + +include(Python) +include(FindSVN) + +macro (use_svn_external _binary _path _url _rev) + if (NOT STANDALONE) + if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed) + if(SVN_FOUND) + if(DEBUG_EXTERNALS) + message("cd ${_path} && ${SVN_EXECUTABLE} checkout -r ${_rev} ${_url} ${_binary}") + endif(DEBUG_EXTERNALS) + execute_process(COMMAND ${SVN_EXECUTABLE} + checkout + -r ${_rev} + ${_url} + ${_binary} + WORKING_DIRECTORY ${_path} + RESULT_VARIABLE ${_binary}_installed + ) + else(SVN_FOUND) + message(FATAL_ERROR "Failed to find SVN_EXECUTABLE") + endif(SVN_FOUND) + 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_svn_external _binary _path _url _rev) diff --git a/indra/cmake/FindSVN.cmake b/indra/cmake/FindSVN.cmake new file mode 100644 index 0000000000..3322be4ca9 --- /dev/null +++ b/indra/cmake/FindSVN.cmake @@ -0,0 +1,34 @@ +# -*- cmake -*- +# +# Find the svn executable for exporting old svn:externals. +# +# Input variables: +# SVN_FIND_REQUIRED - set this if configuration should fail without scp +# +# Output variables: +# +# SVN_FOUND - set if svn was found +# SVN_EXECUTABLE - path to svn executable +# SVN_BATCH_FLAG - how to put svn into batch mode + + +SET(SVN_EXECUTABLE) +FIND_PROGRAM(SVN_EXECUTABLE NAMES svn svn.exe) + +IF (SVN_EXECUTABLE) + SET(SVN_FOUND ON) +ELSE (SVN_EXECUTABLE) + SET(SVN_FOUND OFF) +ENDIF (SVN_EXECUTABLE) + +IF (SVN_FOUND) + GET_FILENAME_COMPONENT(_svn_name ${SVN_EXECUTABLE} NAME_WE) + SET(SVN_BATCH_FLAG --non-interactive) +ELSE (SVN_FOUND) + IF (SVN_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find svn executable") + ENDIF (SVN_FIND_REQUIRED) +ENDIF (SVN_FOUND) + +MARK_AS_ADVANCED(SVN_EXECUTABLE SVN_FOUND SVN_BATCH_FLAG) + -- cgit v1.2.3 From c1d59f02609def47507c76d65c60f220c508a71f Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Thu, 2 Jul 2009 14:40:05 -0400 Subject: Windows now links to shared apr when LLCOMMON_LINK_SHARED is on. --- indra/cmake/APR.cmake | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 0755aeee03..efd47f756a 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -13,18 +13,33 @@ if (STANDALONE) else (STANDALONE) use_prebuilt_binary(apr_suite) if (WINDOWS) - set(APR_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/apr-1.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apr-1.lib - ) - set(APRICONV_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/apriconv-1.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apriconv-1.lib - ) - set(APRUTIL_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/aprutil-1.lib ${APRICONV_LIBRARIES} - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1.lib ${APRICONV_LIBRARIES} - ) + if (LLCOMMON_LINK_SHARED) + set(APR_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.lib + ) + set(APRICONV_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapriconv-1.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapriconv-1.lib + ) + set(APRUTIL_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.lib ${APRICONV_LIBRARIES} + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.lib ${APRICONV_LIBRARIES} + ) + else (LLCOMMON_LINK_SHARED) + set(APR_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/apr-1.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apr-1.lib + ) + set(APRICONV_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/apriconv-1.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apriconv-1.lib + ) + set(APRUTIL_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/aprutil-1.lib ${APRICONV_LIBRARIES} + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1.lib ${APRICONV_LIBRARIES} + ) + endif (LLCOMMON_LINK_SHARED) elseif (DARWIN) set(APR_LIBRARIES debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a -- cgit v1.2.3 From b5fef75dad1c0992c63ede83b96da0b1db1f9a37 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Thu, 9 Jul 2009 17:03:20 -0700 Subject: Moveing around DLL copying to support building llcommon.dll and using llcommon.dll while running unit tests. --- indra/cmake/LLAddBuildTest.cmake | 9 ++++++++- indra/cmake/Linking.cmake | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 4a61725e09..5717bc620a 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -118,9 +118,16 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) 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}) + ELSE(WINDOWS) + set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:/usr/lib) + ENDIF(WINDOWS) + SET(TEST_SCRIPT_CMD ${CMAKE_COMMAND} - -DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib + -DLD_LIBRARY_PATH=${LD_LIBRARY_PATH} -DTEST_CMD:STRING="${TEST_CMD}" -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake ) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index eaa8a6dc29..ad52a82b20 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -5,6 +5,7 @@ if (NOT STANDALONE) 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) + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs) elseif (LINUX) if (VIEWER) set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client) -- cgit v1.2.3 From 9e399d5d3c7348012bcb79557d8a055f96b32e90 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Thu, 9 Jul 2009 19:51:28 -0700 Subject: Brad already added the LLCOMMON_LINK_SHARED definition. I removed the broken one I added and set the other one to ON by default. --- indra/cmake/LLCommon.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake index 4cd3a9adb8..19d61008da 100644 --- a/indra/cmake/LLCommon.cmake +++ b/indra/cmake/LLCommon.cmake @@ -17,7 +17,7 @@ set(LLCOMMON_LIBRARIES llcommon) add_definitions(${TCMALLOC_FLAG}) -set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a shared library.") +set(LLCOMMON_LINK_SHARED ON CACHE BOOL "Build the llcommon target as a shared library.") if(LLCOMMON_LINK_SHARED) add_definitions(-DLL_COMMON_LINK_SHARED=1) endif(LLCOMMON_LINK_SHARED) -- cgit v1.2.3 From 82eb18fce5c3d21a49a299ee5e454cbcc9d6f559 Mon Sep 17 00:00:00 2001 From: "palmer@945battery-guestB-224.lindenlab.com" Date: Fri, 10 Jul 2009 11:09:54 -0700 Subject: Expanded tabs in cmake files --- indra/cmake/LLAddBuildTest.cmake | 12 ++++++------ indra/cmake/Linking.cmake | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 5717bc620a..0c6ddef50f 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -118,12 +118,12 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) 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}) - ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:/usr/lib) - ENDIF(WINDOWS) + + IF(WINDOWS) + set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) + ELSE(WINDOWS) + set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:/usr/lib) + ENDIF(WINDOWS) SET(TEST_SCRIPT_CMD ${CMAKE_COMMAND} diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index ad52a82b20..4063034837 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -5,7 +5,7 @@ if (NOT STANDALONE) 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) - set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs) + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs) elseif (LINUX) if (VIEWER) set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client) -- cgit v1.2.3 From c2e425e5395c1b1b43a2f477565e374d919f10ee Mon Sep 17 00:00:00 2001 From: Dave Hiller Date: Tue, 14 Jul 2009 16:52:40 +0000 Subject: QAR-1651 svn merge -r126784:126785 svn+ssh://svn.lindenlab.com/svn/linden/branches/mock-3 into trunk --- indra/cmake/GoogleMock.cmake | 27 +++++++++++++++++++++++++++ indra/cmake/LLAddBuildTest.cmake | 11 ++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 indra/cmake/GoogleMock.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake new file mode 100644 index 0000000000..ca5a8034ba --- /dev/null +++ b/indra/cmake/GoogleMock.cmake @@ -0,0 +1,27 @@ +# -*- cmake -*- +include(Prebuilt) +include(Linking) + +use_prebuilt_binary(googlemock) + +set(GOOGLEMOCK_INCLUDE_DIRS + ${LIBS_PREBUILT_DIR}/include) + +if (LINUX) + set(GOOGLEMOCK_LIBRARIES + gmock + gtest) +elseif(WINDOWS) + set(GOOGLEMOCK_LIBRARIES + gmock) + set(GOOGLEMOCK_INCLUDE_DIRS + ${LIBS_PREBUILT_DIR}/include + ${LIBS_PREBUILT_DIR}/include/gmock + ${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1) +elseif(DARWIN) + set(GOOGLEMOCK_LIBRARIES + gmock + gtest) +endif(LINUX) + + diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 4a61725e09..4da0824120 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -13,6 +13,8 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) # # WARNING: do NOT modify this code without working with poppy or daveh - # there is another branch that will conflict heavily with any changes here. +INCLUDE(GoogleMock) + IF(LL_TEST_VERBOSE) MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}") @@ -32,8 +34,10 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) ${LLMATH_INCLUDE_DIRS} ${LLCOMMON_INCLUDE_DIRS} ${LIBS_OPEN_DIR}/test + ${GOOGLEMOCK_INCLUDE_DIRS} ) SET(alltest_LIBRARIES + ${GOOGLEMOCK_LIBRARIES} ${PTHREAD_LIBRARY} ${WINDOWS_LIBRARIES} ) @@ -42,6 +46,11 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) ${CMAKE_SOURCE_DIR}/test/test.h ) + # Use the default flags + if (LINUX) + SET(CMAKE_EXE_LINKER_FLAGS "") + endif (LINUX) + # start the source test executable definitions SET(${project}_TEST_OUTPUT "") FOREACH (source ${sources}) @@ -84,9 +93,9 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_INCLUDE_DIRS ${${name}_test_additional_INCLUDE_DIRS}") ENDIF(LL_TEST_VERBOSE) + # Setup target ADD_EXECUTABLE(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES}) - # # Per-codefile additional / external project dep and lib dep property extraction # -- cgit v1.2.3 From b029846e81f104789d001e56ca0d83fe8c9e93cd Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Tue, 28 Jul 2009 13:20:23 -0700 Subject: DEV-35399 - Making the server build llcommon.dll compatible. Now using RunBuildTest.cmake to run tut and lscript_lsl tests, inorder to set path to llcommon.dll Exported a few llcommon apis needed by server components/tests. --- indra/cmake/LLCommon.cmake | 2 +- indra/cmake/Linking.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake index 19d61008da..d1ab264a41 100644 --- a/indra/cmake/LLCommon.cmake +++ b/indra/cmake/LLCommon.cmake @@ -19,5 +19,5 @@ add_definitions(${TCMALLOC_FLAG}) set(LLCOMMON_LINK_SHARED ON CACHE BOOL "Build the llcommon target as a shared library.") if(LLCOMMON_LINK_SHARED) - add_definitions(-DLL_COMMON_LINK_SHARED=1) + add_definitions(-DLL_COMMON_LINK_SHARED=1) endif(LLCOMMON_LINK_SHARED) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 4063034837..578edf9989 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -5,7 +5,7 @@ if (NOT STANDALONE) 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) - set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs) + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs") elseif (LINUX) if (VIEWER) set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client) -- cgit v1.2.3 From fe339408cefb51023cae8a7fd3def2a4b8a75a65 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Tue, 28 Jul 2009 18:03:28 -0700 Subject: DEV-35399 - Making the server build llcommon.dll compatible. Fixing up string escaping on calls to RunBuildTest.cmake Also added ilasm.bat to the FindMono.cmake search --- indra/cmake/FindMono.cmake | 2 +- indra/cmake/LLAddBuildTest.cmake | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/FindMono.cmake b/indra/cmake/FindMono.cmake index c36d7259e8..d956c48656 100644 --- a/indra/cmake/FindMono.cmake +++ b/indra/cmake/FindMono.cmake @@ -42,7 +42,7 @@ FIND_PROGRAM (GACUTIL_EXECUTABLE gacutil /usr/local/bin ) FIND_PROGRAM (ILASM_EXECUTABLE - ilasm + NAMES ilasm.bat ilasm NO_DEFAULT_PATH PATHS "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" "$ENV{PROGRAMFILES}/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin ) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 0c6ddef50f..aa77bbac65 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -114,7 +114,8 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION) 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) @@ -125,18 +126,17 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:/usr/lib) ENDIF(WINDOWS) - SET(TEST_SCRIPT_CMD - ${CMAKE_COMMAND} - -DLD_LIBRARY_PATH=${LD_LIBRARY_PATH} - -DTEST_CMD:STRING="${TEST_CMD}" - -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake - ) IF(LL_TEST_VERBOSE) MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}") ENDIF(LL_TEST_VERBOSE) # Add test ADD_CUSTOM_COMMAND( OUTPUT ${TEST_OUTPUT} + COMMAND ${CMAKE_COMMAND} + ARGS + -DLD_LIBRARY_PATH=${LD_LIBRARY_PATH} + "-DTEST_CMD:STRING=\"${TEST_CMD}\"" + -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake COMMAND ${TEST_SCRIPT_CMD} DEPENDS PROJECT_${project}_TEST_${name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -- cgit v1.2.3 From 1e1a38d5745a680c712be9bcc088a75f6eafa7da Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 30 Jul 2009 18:51:17 -0400 Subject: DEV-34837: Improve Mac support for LLCOMMON_LINK_SHARED. Update Mac apr_suite package, introducing libapr-1.0.3.7.dylib and libaprutil-1.0.3.8.dylib. We want to use dynamic APR libraries, but libllcommon.dylib isn't allowed to depend on .so libraries: must be .dylibs themselves. Tweak APR.cmake to reference the aforementioned .dylibs when on Mac with LLCOMMON_LINK_SHARED set. Eliminate some redundancy in Windows section. For .dylibs, RunBuildTest.cmake must set DYLD_LIBRARY_PATH: LD_LIBRARY_PATH only affects search for .so files. PENDING: CMake dependencies broken? With LLCOMMON_LINK_SHARED on, it seems we need to build libllcommon.dylib explicitly before full build can succeed. This snapshot does NOT yet copy the llcommon, apr or aprutil dylibs into the app bundle. --- indra/cmake/APR.cmake | 53 ++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index efd47f756a..f4706dd4f2 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -14,40 +14,37 @@ else (STANDALONE) use_prebuilt_binary(apr_suite) if (WINDOWS) if (LLCOMMON_LINK_SHARED) - set(APR_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.lib - ) - set(APRICONV_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapriconv-1.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapriconv-1.lib - ) - set(APRUTIL_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.lib ${APRICONV_LIBRARIES} - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.lib ${APRICONV_LIBRARIES} - ) + set(APR_selector "lib") else (LLCOMMON_LINK_SHARED) - set(APR_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/apr-1.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apr-1.lib - ) - set(APRICONV_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/apriconv-1.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apriconv-1.lib - ) - set(APRUTIL_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/aprutil-1.lib ${APRICONV_LIBRARIES} - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1.lib ${APRICONV_LIBRARIES} - ) + set(APR_selector "") endif (LLCOMMON_LINK_SHARED) + set(APR_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apr-1.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib + ) + set(APRICONV_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apriconv-1.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib + ) + set(APRUTIL_LIBRARIES + debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES} + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES} + ) elseif (DARWIN) + if (LLCOMMON_LINK_SHARED) + set(APR_selector "0.3.7.dylib") + set(APRUTIL_selector "0.3.8.dylib") + else (LLCOMMON_LINK_SHARED) + set(APR_selector "a") + set(APRUTIL_selector "a") + endif (LLCOMMON_LINK_SHARED) set(APR_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.${APR_selector} + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.${APR_selector} ) set(APRUTIL_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.${APRUTIL_selector} + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.${APRUTIL_selector} ) set(APRICONV_LIBRARIES iconv) else (WINDOWS) -- cgit v1.2.3 From 1af41b3ba733938541d7cc92ae56dd883638e32f Mon Sep 17 00:00:00 2001 From: "palmer@eniac54.lindenlab.com" Date: Thu, 30 Jul 2009 18:52:34 -0700 Subject: Fixes to build on linux for DEV-35401. Moves libllcommon.so to a staging dir for unit tests to work and gets rid of LL_COMMON_API in forward declarations --- indra/cmake/LLAddBuildTest.cmake | 2 +- indra/cmake/Linking.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index aa77bbac65..013cc5109f 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -123,7 +123,7 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) IF(WINDOWS) set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:/usr/lib) + set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib) ENDIF(WINDOWS) IF(LL_TEST_VERBOSE) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 578edf9989..30b3cc9994 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -14,6 +14,7 @@ if (NOT STANDALONE) endif (VIEWER) set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS}) set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS}) + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged .sos") elseif (DARWIN) set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release) set(ARCH_PREBUILT_DIRS ${ARCH_PREBUILT_DIRS_RELEASE}) -- cgit v1.2.3 From 47e547fcba802af3145f06fa5b8aa9af2942d294 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 4 Aug 2009 13:51:50 -0400 Subject: DEV-34837: Allow Mac SL executable to find libllcommon.dylib in app bundle's Resources subdir without requiring user to explicitly set DYLD_LIBRARY_PATH. Engage the SHARED_LIB_STAGING_DIR mechanism for Mac as well as Windows and Linux so unit-test executables, too, can find libllcommon.dylib. Perform the POST_BUILD copy of libllcommon.dylib to SHARED_LIB_STAGING_DIR everywhere but Windows -- but make it conditional on SHARED_LIB_STAGING_DIR. --- indra/cmake/Linking.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 30b3cc9994..1f3553539f 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -19,6 +19,7 @@ if (NOT STANDALONE) 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}) + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs") endif (WINDOWS) endif (NOT STANDALONE) -- cgit v1.2.3 From 491f9fc9869cf15bf8a46e917bd2cc17f65b1257 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 29 Aug 2009 10:35:41 -0400 Subject: Add magic -D switch to work around OS X 10.5 bug in ucontext.h --- indra/cmake/00-Common.cmake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 2a70263446..0dc0e9e80c 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -179,11 +179,17 @@ endif (LINUX) if (DARWIN) - add_definitions(-DLL_DARWIN=1) + # NOTE (per http://lists.apple.com/archives/darwin-dev/2008/Jan/msg00232.html): + # > Why the bus error? What am I doing wrong? + # This is a known issue where getcontext(3) is writing past the end of the + # ucontext_t struct when _XOPEN_SOURCE is not defined (rdar://problem/5578699 ). + # As a workaround, define _XOPEN_SOURCE before including ucontext.h. + add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE) 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") + set(DARWIN_extra_cstar_flags "-mlong-branch") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}") # 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}") -- cgit v1.2.3 From 5da7db5571520a31684a9b093ae6b501fcc8a628 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 1 Sep 2009 16:01:55 -0400 Subject: RunBuildTest.cmake definitely needs the separate_arguments() command, else when you pass in a command string with command-line arguments, RunBuildTest.cmake attempts to search for a program whose filename is the entire command line. Uncommented separate_arguments(). Added SHARED_LIB_STAGING_DIR to LL_ADD_INTEGRATION_TEST LD_LIBRARY_PATH. --- indra/cmake/LLAddBuildTest.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index fac0c9d955..e6ef4f1f6b 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -210,9 +210,15 @@ 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}) + ELSE(WINDOWS) + set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib) + ENDIF(WINDOWS) + SET(TEST_SCRIPT_CMD ${CMAKE_COMMAND} - -DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib + -DLD_LIBRARY_PATH="${LD_LIBRARY_PATH}" -DTEST_CMD:STRING="${test_command}" -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake ) -- cgit v1.2.3 From afe09c1385b55bdf2d8d245ea7c8c73b3fa87e28 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 4 Sep 2009 11:30:19 -0400 Subject: QAR-1619: Replace RunBuildTest.cmake with run_build_test.py for LSL tests. RunBuildTest.cmake can't handle pathnames containing spaces. run_build_test.py accepts an arbitrary number of individually-quoted command-line arguments, passing each through to Python's subprocess.call(). --- indra/cmake/run_build_test.py | 97 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 indra/cmake/run_build_test.py (limited to 'indra/cmake') diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py new file mode 100644 index 0000000000..1882b644a0 --- /dev/null +++ b/indra/cmake/run_build_test.py @@ -0,0 +1,97 @@ +#!/usr/bin/python +"""\ +@file run_build_test.py +@author Nat Goodspeed +@date 2009-09-03 +@brief Helper script to allow CMake to run some command after setting + environment variables. + +CMake has commands to run an external program. But remember that each CMake +command must be backed by multiple build-system implementations. Unfortunately +it seems CMake can't promise that every target build system can set specified +environment variables before running the external program of interest. + +This helper script is a workaround. It simply sets the requested environment +variables and then executes the program specified on the rest of its command +line. + +Example: + +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$ +Copyright (c) 2009, Linden Research, Inc. +$/LicenseInfo$ +""" + +import os +import sys +import subprocess + +def main(command, libpath=[], vars={}): + """Pass: + command is a sequence (e.g. a list) of strings. The first item in the list + must be the command name, the rest are its arguments. + + libpath is a sequence of directory pathnames. These will be appended to + the platform-specific dynamic library search path environment variable. + + vars is a dict of arbitrary (var, value) pairs to be added to the + environment before running 'command'. + + This function runs the specified command, waits for it to terminate and + returns its return code. This will be negative if the command terminated + with a signal, else it will be the process's specified exit code. + """ + # Handle platform-dependent libpath first. + if sys.platform == "win32": + lpvars = ["PATH"] + elif sys.platform == "darwin": + lpvars = ["LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"] + elif sys.platform.startswith("linux"): + lpvars = ["LD_LIBRARY_PATH"] + else: + # No idea what the right pathname might be! But only crump if this + # feature is requested. + if libpath: + raise NotImplemented("run_build_test: unknown platform %s" % sys.platform) + lpvars = [] + for var in lpvars: + # Split the existing path + dirs = os.environ[var].split(os.pathsep) + # Append the sequence in libpath + dirs.extend(libpath) + # Now rebuild the path string. This way we use a minimum of separators + # -- and we avoid adding a pointless separator when libpath is empty. + os.environ[var] = os.pathsep.join(dirs) + # Now handle arbitrary environment variables. The tricky part is ensuring + # that all the keys and values we try to pass are actually strings. + os.environ.update(dict([(str(key), str(value)) for key, value in vars.iteritems()])) + # Run the child process. + return subprocess.call(command) + +if __name__ == "__main__": + from optparse import OptionParser + parser = OptionParser(usage="usage: %prog [options] command args...") + parser.add_option("-D", "--define", dest="vars", default=[], action="append", + metavar="VAR=value", + help="Add VAR=value to the env variables defined") + parser.add_option("-l", "--libpath", dest="libpath", default=[], action="append", + metavar="DIR", + help="Add DIR to the platform-dependent DLL search path") + opts, args = parser.parse_args() + # What we have in opts.vars is a list of strings of the form "VAR=value" + # or possibly just "VAR". What we want is a dict. We can build that dict by + # constructing a list of ["VAR", "value"] pairs -- so split each + # "VAR=value" string on the '=' sign (but only once, in case we have + # "VAR=some=user=string"). To handle the case of just "VAR", append "" to + # the list returned by split(), then slice off anything after the pair we + # want. + rc = main(command=args, libpath=opts.libpath, + vars=dict([(pair.split('=', 1) + [""])[:2] for pair in opts.vars])) + print >>sys.stderr, "Failure running: %s" % " ".join(args) + print >>sys.stderr, "Error: %s" % rc + sys.exit((rc < 0) and 255 or rc) -- cgit v1.2.3 From b9546a33e90df60e2d47735b4627de4eb97ba6b9 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 8 Sep 2009 12:03:32 -0400 Subject: QAR-1619: Finish replacing RunBuildTest.cmake with run_build_test.py. Because the details of RunBuildTest.cmake versus run_build_test.py had to be changed in so many different places, introduce LL_TEST_COMMAND CMake macro (in LLTestCommand.cmake) to encapsulate construction of the actual command line. Use LL_TEST_COMMAND in LL_ADD_PROJECT_UNIT_TESTS, LL_ADD_INTEGRATION_TEST, the big indra/test monolith and the various LslCompilerMacros. Fix run_build_test.py to pass through the test executable's own options (e.g. --touch, --output) without inspection. Defend it against the case when the platform-specific library path environment variable doesn't yet exist. Make it report errors only on nonzero test-program rc. Remove RunBuildTest.cmake. --- indra/cmake/CMakeLists.txt | 2 +- indra/cmake/LLAddBuildTest.cmake | 16 +++++----------- indra/cmake/LLTestCommand.cmake | 13 +++++++++++++ indra/cmake/run_build_test.py | 22 ++++++++++++++++++---- 4 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 indra/cmake/LLTestCommand.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 3ce393b659..4563b59ad2 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -53,6 +53,7 @@ set(cmake_SOURCE_FILES LLPrimitive.cmake LLRender.cmake LLScene.cmake + LLTestCommand.cmake LLUI.cmake LLVFS.cmake LLWindow.cmake @@ -69,7 +70,6 @@ set(cmake_SOURCE_FILES PNG.cmake Python.cmake Prebuilt.cmake - RunBuildTest.cmake TemplateCheck.cmake Tut.cmake UI.cmake diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index e6ef4f1f6b..8cd5796849 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -1,4 +1,5 @@ # -*- cmake -*- +include(LLTestCommand) MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) # Given a project name and a list of sourcefiles (with optional properties on each), @@ -126,17 +127,14 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib) ENDIF(WINDOWS) + LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${TEST_CMD}) + SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value}) IF(LL_TEST_VERBOSE) MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}") ENDIF(LL_TEST_VERBOSE) # Add test ADD_CUSTOM_COMMAND( OUTPUT ${TEST_OUTPUT} - COMMAND ${CMAKE_COMMAND} - ARGS - -DLD_LIBRARY_PATH=${LD_LIBRARY_PATH} - "-DTEST_CMD:STRING=\"${TEST_CMD}\"" - -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake COMMAND ${TEST_SCRIPT_CMD} DEPENDS PROJECT_${project}_TEST_${name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} @@ -216,12 +214,8 @@ FUNCTION(LL_ADD_INTEGRATION_TEST set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib) ENDIF(WINDOWS) - SET(TEST_SCRIPT_CMD - ${CMAKE_COMMAND} - -DLD_LIBRARY_PATH="${LD_LIBRARY_PATH}" - -DTEST_CMD:STRING="${test_command}" - -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake - ) + LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${test_command}) + SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value}) if(TEST_DEBUG) message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}") diff --git a/indra/cmake/LLTestCommand.cmake b/indra/cmake/LLTestCommand.cmake new file mode 100644 index 0000000000..fae5640493 --- /dev/null +++ b/indra/cmake/LLTestCommand.cmake @@ -0,0 +1,13 @@ +MACRO(LL_TEST_COMMAND 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 + ${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}") +ENDMACRO(LL_TEST_COMMAND) diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index 1882b644a0..17bce6f434 100644 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -60,22 +60,35 @@ def main(command, libpath=[], vars={}): raise NotImplemented("run_build_test: unknown platform %s" % sys.platform) lpvars = [] for var in lpvars: - # Split the existing path - dirs = os.environ[var].split(os.pathsep) + # Split the existing path. Bear in mind that the variable in question + # might not exist; instead of KeyError, just use an empty string. + dirs = os.environ.get(var, "").split(os.pathsep) # Append the sequence in libpath +## print "%s += %r" % (var, libpath) dirs.extend(libpath) # Now rebuild the path string. This way we use a minimum of separators # -- and we avoid adding a pointless separator when libpath is empty. os.environ[var] = os.pathsep.join(dirs) # Now handle arbitrary environment variables. The tricky part is ensuring # that all the keys and values we try to pass are actually strings. +## if vars: +## print "Setting:" +## for key, value in vars.iteritems(): +## print "%s=%s" % (key, value) os.environ.update(dict([(str(key), str(value)) for key, value in vars.iteritems()])) # Run the child process. +## print "Running: %s" % " ".join(command) return subprocess.call(command) if __name__ == "__main__": from optparse import OptionParser parser = OptionParser(usage="usage: %prog [options] command args...") + # We want optparse support for the options we ourselves handle -- but we + # DO NOT want it looking at options for the executable we intend to run, + # rejecting them as invalid because we don't define them. So configure the + # parser to stop looking for options as soon as it sees the first + # positional argument (traditional Unix syntax). + parser.disable_interspersed_args() parser.add_option("-D", "--define", dest="vars", default=[], action="append", metavar="VAR=value", help="Add VAR=value to the env variables defined") @@ -92,6 +105,7 @@ if __name__ == "__main__": # want. rc = main(command=args, libpath=opts.libpath, vars=dict([(pair.split('=', 1) + [""])[:2] for pair in opts.vars])) - print >>sys.stderr, "Failure running: %s" % " ".join(args) - print >>sys.stderr, "Error: %s" % rc + if rc not in (None, 0): + print >>sys.stderr, "Failure running: %s" % " ".join(args) + print >>sys.stderr, "Error: %s" % rc sys.exit((rc < 0) and 255 or rc) -- cgit v1.2.3 From a84b98e31e99b361ea08dddee6183902cefbca59 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Thu, 17 Sep 2009 15:51:29 -0400 Subject: Rebuilt windows boost for CRT version DLL hell, upgrading to 1.39 in the process. --- indra/cmake/Boost.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 0578ae95ff..efe9ad74d3 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -15,7 +15,7 @@ else (STANDALONE) set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) if (WINDOWS) - set(BOOST_VERSION 1_34_1) + set(BOOST_VERSION 1_39) if (MSVC71) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized libboost_program_options-vc71-mt-s-${BOOST_VERSION} -- cgit v1.2.3 From 844d017f4369dd1430493aba78b8c6d823c24f20 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 2 Oct 2009 14:12:34 -0700 Subject: Moved a couple of C++-specific warning flags from GCC_WARNINGS to GCC_CXX_WARNINGS. This fixes a couple of non-fatal warning messages about unknown flags on the mac. --- indra/cmake/00-Common.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 2a70263446..c356feb13a 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -192,13 +192,13 @@ endif (DARWIN) if (LINUX OR DARWIN) - set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-non-virtual-dtor -Woverloaded-virtual") + 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(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual") set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}") -- cgit v1.2.3 From b52b97b6e1fa1ac709ba951c32ff422ed55fbdf1 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 20 Oct 2009 08:51:23 -0400 Subject: It seems that ADD_INTEGRATION_TEST tests now require GoogleMock to build --- indra/cmake/LLAddBuildTest.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 499bf19afd..d8f64199cf 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- include(LLTestCommand) +include(GoogleMock) MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) # Given a project name and a list of sourcefiles (with optional properties on each), @@ -190,6 +191,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST SET(libraries ${library_dependencies} + ${GOOGLEMOCK_LIBRARIES} ${PTHREAD_LIBRARY} ) -- cgit v1.2.3 From f67e44c5036e7f44b5489e25ffd8e0fd7e634aa2 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Thu, 22 Oct 2009 15:38:26 -0700 Subject: Fixing the build for PE. Now building with llkdu can be skipped by specifying INSTALL_PROPRIETARY=OFF when configuring the build. Reviewed by palmer --- indra/cmake/LLKDU.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index f103dcf664..6b69388896 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -1,7 +1,7 @@ # -*- cmake -*- include(Prebuilt) -if (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu) +if (INSTALL_PROPRIETARY AND NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu) use_prebuilt_binary(kdu) if (WINDOWS) set(KDU_LIBRARY debug kdu_cored optimized kdu_core) @@ -15,4 +15,4 @@ if (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/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) +endif (INSTALL_PROPRIETARY AND NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu) -- cgit v1.2.3 From 91b54876b7422422326646e5b4581631883f1e69 Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 30 Oct 2009 10:48:10 -0700 Subject: Adds an example plugin and corresponding changes to LLMediaPluginTest test app. We do not copy over the example plugin to the Second Life client plugin dir. --- indra/cmake/ExamplePlugin.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 indra/cmake/ExamplePlugin.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/ExamplePlugin.cmake b/indra/cmake/ExamplePlugin.cmake new file mode 100644 index 0000000000..599787ad21 --- /dev/null +++ b/indra/cmake/ExamplePlugin.cmake @@ -0,0 +1,16 @@ +# -*- cmake -*- +include(Linking) +include(Prebuilt) + +if (STANDALONE) + set(EXAMPLEPLUGIN OFF CACHE BOOL + "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") +else (STANDALONE) + set(EXAMPLEPLUGIN ON CACHE BOOL + "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") +endif (STANDALONE) + +if (WINDOWS) +elseif (DARWIN) +elseif (LINUX) +endif (WINDOWS) -- cgit v1.2.3 From cf0c0e182441e442db78ded1a7139818502ae066 Mon Sep 17 00:00:00 2001 From: palange Date: Mon, 2 Nov 2009 12:12:32 -0800 Subject: Added build time script to help deploy shared libs for an arbitrary executable. indra/cmake/DeploySharedLibs.cmake is the script. LLSharedLibs.cmake contains a macro to ease adding DeployShaerdLibs to a targets build. Example usage to the mac-crash-reporter. Multiplatform and more to come soon. Reviewed by brad. --- indra/cmake/DeploySharedLibs.cmake | 67 ++++++++++++++++++++++++++++++++++++++ indra/cmake/LLSharedLibs.cmake | 31 ++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 indra/cmake/DeploySharedLibs.cmake create mode 100644 indra/cmake/LLSharedLibs.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/DeploySharedLibs.cmake b/indra/cmake/DeploySharedLibs.cmake new file mode 100644 index 0000000000..a7e772bd75 --- /dev/null +++ b/indra/cmake/DeploySharedLibs.cmake @@ -0,0 +1,67 @@ +# DeploySharedLibs.cmake +# This is a script to be run at build time! Its not part of the cmake configuration! +# See indra/cmake/LLSharedLibs.cmake for a macro that simplifies adding a command to a target to run this script. + +# This script requires a few cmake variable to be set on the command line: +# BIN_NAME= The full path the the binary to search for dependecies. +# SEARCH_DIRS= The full paths to dirs to search for dependencies. +# DST_PATH= The full path where the dependecies will be copied. +include(GetPrerequisites) +message("Getting recursive dependencies for file: ${BIN_NAME}") +set(EXCLUDE_SYSTEM 1) +set(RECURSE 1) +get_filename_component(EXE_PATH ${BIN_NAME} PATH) + +get_prerequisites( ${BIN_NAME} RESULTS ${EXCLUDE_SYSTEM} ${RECURSE} "${EXE_PATH}" "${SEARCH_DIRS}" ) + +foreach(DEP ${RESULTS}) + Message("Processing dependency: ${DEP}") + get_filename_component(DEP_FILE ${DEP} NAME) + set(DEP_FILES ${DEP_FILES} ${DEP_FILE}) +endforeach(DEP) + +if(DEP_FILES) + list(REMOVE_DUPLICATES DEP_FILES) +endif(DEP_FILES) + +foreach(DEP_FILE ${DEP_FILES}) + if(FOUND_FILES) + list(FIND FOUND_FILES ${DEP_FILE} FOUND) + else(FOUND_FILES) + set(FOUND -1) + endif(FOUND_FILES) + + if(FOUND EQUAL -1) + find_path(DEP_PATH ${DEP_FILE} PATHS ${SEARCH_DIRS} NO_DEFAULT_PATH) + if(DEP_PATH) + set(FOUND_FILES ${FOUND_FILES} "${DEP_PATH}/${DEP_FILE}") + set(DEP_PATH NOTFOUND) #reset DEP_PATH for the next find_path call. + else(DEP_PATH) + set(MISSING_FILES ${MISSING_FILES} ${DEP_FILE}) + endif(DEP_PATH) + endif(FOUND EQUAL -1) +endforeach(DEP_FILE) + +if(MISSING_FILES) + message("Missing:") + foreach(FILE ${MISSING_FILES}) + message(" ${FILE}") + endforeach(FILE) + message("Searched in:") + foreach(SEARCH_DIR ${SEARCH_DIRS}) + message(" ${SEARCH_DIR}") + endforeach(SEARCH_DIR) + message(FATAL_ERROR "Failed") +endif(MISSING_FILES) + +if(FOUND_FILES) + foreach(FILE ${FOUND_FILES}) + get_filename_component(DST_FILE ${FILE} NAME) + set(DST_FILE "${DST_PATH}/${DST_FILE}") + message("Copying ${FILE} to ${DST_FILE}") + execute_process( + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FILE} ${DST_FILE} + ) + endforeach(FILE ${FOUND_FILES}) +endif(FOUND_FILES) +message("Success!") diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake new file mode 100644 index 0000000000..3be22ab401 --- /dev/null +++ b/indra/cmake/LLSharedLibs.cmake @@ -0,0 +1,31 @@ +# ll_deploy_sharedlibs_command +# target_exe: the cmake target of the executable for which the shared libs will be deployed. +# search_dirs: a list of dirs to search for the dependencies +# dst_path: path to copy deps to, relative to the output location of the target_exe +macro(ll_deploy_sharedlibs_command target_exe search_dirs dst_path) + get_target_property(OUTPUT_LOCATION ${target_exe} LOCATION) + + if(DARWIN) + get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE) + if(IS_BUNDLE) + get_filename_component(TARGET_FILE ${OUTPUT_LOCATION} NAME) + set(OUTPUT_PATH ${OUTPUT_LOCATION}.app/Contents/MacOS) + set(OUTPUT_LOCATION ${OUTPUT_PATH}/${TARGET_FILE}) + endif(IS_BUNDLE) + else(APPLE) + message(FATAL_ERROR "Only darwin currently supported!") + endif(DARWIN) + + add_custom_command( + TARGET ${target_exe} POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS + "-DBIN_NAME=\"${OUTPUT_LOCATION}\"" + "-DSEARCH_DIRS=\"${search_dirs}\"" + "-DDST_PATH=\"${OUTPUT_PATH}/${dst_path}\"" + "-P" + "${CMAKE_SOURCE_DIR}/cmake/DeploySharedLibs.cmake" + ) + +endmacro(ll_deploy_sharedlibs_command) + -- cgit v1.2.3