diff options
| author | Don Kjer <don@lindenlab.com> | 2012-10-11 20:10:11 +0000 | 
|---|---|---|
| committer | Don Kjer <don@lindenlab.com> | 2012-10-11 20:10:11 +0000 | 
| commit | e60491fc6994ccd77a7bc101c49c5b7e1eb1a379 (patch) | |
| tree | f08c61995ccef5f0baa51d626f0fdec43ff4c170 | |
| parent | a039b7c489885784fe779d05670825b316fa13d4 (diff) | |
Adding multi-arch hints to CMake, allowing it to correctly find libraries on multi-arch debian-based systems.
| -rw-r--r-- | indra/cmake/Variables.cmake | 17 | 
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 28315e66e0..405d80aeb0 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -73,19 +73,36 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")    # If someone has specified a word size, use that to determine the    # architecture.  Otherwise, let the architecture specify the word size.    if (WORD_SIZE EQUAL 32) +    #message(STATUS "WORD_SIZE is 32")      set(ARCH i686)    elseif (WORD_SIZE EQUAL 64) +    #message(STATUS "WORD_SIZE is 64")      set(ARCH x86_64)    else (WORD_SIZE EQUAL 32) +    #message(STATUS "WORD_SIZE is UNDEFINED")      execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/                      OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)      if (ARCH STREQUAL x86_64) +      #message(STATUS "ARCH is detected as 64; ARCH is ${ARCH}")        set(WORD_SIZE 64)      else (ARCH STREQUAL x86_64) +      #message(STATUS "ARCH is detected as 32; ARCH is ${ARCH}")        set(WORD_SIZE 32)      endif (ARCH STREQUAL x86_64)    endif (WORD_SIZE EQUAL 32) +  if (WORD_SIZE EQUAL 32) +    set(DEB_ARCHITECTURE i386) +  else (WORD_SIZE EQUAL 32) +    set(DEB_ARCHITECTURE amd64) +  endif (WORD_SIZE EQUAL 32) + +  execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH RESULT_VARIABLE DPKG_RESULT OUTPUT_VARIABLE DPKG_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) +  #message (STATUS "DPKG_RESULT ${DPKG_RESULT}, DPKG_ARCH ${DPKG_ARCH}") +  if (DPKG_RESULT EQUAL 0) +    set(CMAKE_LIBRARY_ARCHITECTURE ${DPKG_ARCH}) +  endif (DPKG_RESULT EQUAL 0) +    set(LL_ARCH ${ARCH}_linux)    set(LL_ARCH_DIR ${ARCH}-linux)  endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")  | 
