diff --git a/development/cmake/CMakeLists.txt b/development/cmake/CMakeLists.txt index 6034711955..ba079173c2 100644 --- a/development/cmake/CMakeLists.txt +++ b/development/cmake/CMakeLists.txt @@ -25,6 +25,19 @@ set(CMAKE_SUPPRESS_REGENERATION FALSE) # where to look first for cmake modules, # before ${CMAKE_ROOT}/Modules is checked set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") + +if(UNIX) + FIND_PROGRAM(DPKG_ARCHITECTURE_EXECUTABLE dpkg-architecture) + if(DPKG_ARCHITECTURE_EXECUTABLE) + EXECUTE_PROCESS(COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH OUTPUT_VARIABLE ARCH_TRIPLET OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() +endif() +if(ARCH_TRIPLET) + set(SYSTEM_LIB_DIRS /usr/lib /usr/lib/${ARCH_TRIPLET} /usr/local/lib) +else() + set(SYSTEM_LIB_DIRS /usr/lib /usr/local/lib) +endif() + include(LyXMacros) diff --git a/development/cmake/modules/FindASPELL.cmake b/development/cmake/modules/FindASPELL.cmake index 3df73f1afd..419fbd8332 100644 --- a/development/cmake/modules/FindASPELL.cmake +++ b/development/cmake/modules/FindASPELL.cmake @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, Peter Kümmel, +# Copyright (c) 2006, Peter K�mmel, # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -54,8 +54,7 @@ FIND_PATH(ASPELL_INCLUDE_DIR aspell.h FIND_LIBRARY(ASPELL_LIBRARY_RELEASE NAMES aspell aspell-15 libaspell libaspell-15 PATHS - /usr/lib - /usr/local/lib + ${SYSTEM_LIB_DIRS} ) # msvc makes a difference between debug and release diff --git a/development/cmake/modules/FindAiksaurusLIB.cmake b/development/cmake/modules/FindAiksaurusLIB.cmake index 7befc8733e..d323abe147 100644 --- a/development/cmake/modules/FindAiksaurusLIB.cmake +++ b/development/cmake/modules/FindAiksaurusLIB.cmake @@ -24,7 +24,7 @@ set(POTENTIAL_AIKSAURUS_LIBS Aiksaurus) find_library(AIKSAURUSLIB_LIBRARY NAMES ${POTENTIAL_AIKSAURUS_LIBS} PATHS - /usr/lib /usr/local/lib) + ${SYSTEM_LIB_DIRS}) # handle the QUIETLY and REQUIRED arguments and set AIKSAURUSLIB_FOUND to TRUE if # all listed variables are TRUE diff --git a/development/cmake/modules/FindEnchant.cmake b/development/cmake/modules/FindEnchant.cmake index ebc90b796f..3abc2b6f47 100644 --- a/development/cmake/modules/FindEnchant.cmake +++ b/development/cmake/modules/FindEnchant.cmake @@ -4,8 +4,7 @@ if(WIN32) else() find_library(ENCHANT_LIBRARY "enchant" "/usr/local/lib" - "/usr/lib" - "/usr/local/lib" + ${SYSTEM_LIB_DIRS} "/opt/local/lib") find_path(ENCHANT_INCLUDE_DIR "enchant++.h" PATHS /usr/local/include diff --git a/development/cmake/modules/FindHunspell.cmake b/development/cmake/modules/FindHunspell.cmake index 452da83d99..36a7c68a57 100644 --- a/development/cmake/modules/FindHunspell.cmake +++ b/development/cmake/modules/FindHunspell.cmake @@ -2,8 +2,7 @@ if(WIN32) find_library(HUNSPELL_LIBRARY "libhunspell") else() - #find_library(HUNSPELL_LIBRARY NAME "hunspell" PATH "/usr/local/lib" "/usr/lib" NO_DEFAULT_PATH) - find_library(HUNSPELL_LIBRARY NAMES "hunspell" "hunspell-1.2" PATHS "/usr/local/lib" "/usr/lib" "/usr/lib64") + find_library(HUNSPELL_LIBRARY NAMES "hunspell" "hunspell-1.2" PATHS "/usr/local/lib" ${SYSTEM_LIB_DIRS} "/usr/lib64") endif() FIND_PATH(HUNSPELL_INCLUDE_DIR "hunspell/hunspell.hxx") diff --git a/development/cmake/modules/FindICONV.cmake b/development/cmake/modules/FindICONV.cmake index 3f2e7ce626..1d22ea37d2 100644 --- a/development/cmake/modules/FindICONV.cmake +++ b/development/cmake/modules/FindICONV.cmake @@ -39,7 +39,7 @@ find_path(ICONV_INCLUDE_DIR iconv.h set(POTENTIAL_ICONV_LIBS iconv libiconv libiconv2) find_library(ICONV_LIBRARY NAMES ${POTENTIAL_ICONV_LIBS} - PATHS /usr/lib /usr/local/lib) + PATHS ${SYSTEM_LIB_DIRS} ) if(WIN32) set(ICONV_DLL_NAMES iconv.dll libiconv.dll libiconv2.dll) diff --git a/development/cmake/modules/FindMyThesLIB.cmake b/development/cmake/modules/FindMyThesLIB.cmake index 42d63a0904..680c7f8a12 100644 --- a/development/cmake/modules/FindMyThesLIB.cmake +++ b/development/cmake/modules/FindMyThesLIB.cmake @@ -18,8 +18,7 @@ find_path(MYTHESLIB_INCLUDE_DIR ${MYTHES_H} set(POTENTIAL_MYTHES_LIBS mythes) find_library(MYTHESLIB_LIBRARY NAMES ${POTENTIAL_MYTHES_LIBS} - PATHS - /usr/lib /usr/local/lib) + PATHS ${SYSTEM_LIB_DIRS} ) # handle the QUIETLY and REQUIRED arguments and set MYTHESLIB_FOUND to TRUE if # all listed variables are TRUE diff --git a/development/cmake/modules/FindZLIB.cmake b/development/cmake/modules/FindZLIB.cmake index 96fb7b6644..49dbc8592f 100644 --- a/development/cmake/modules/FindZLIB.cmake +++ b/development/cmake/modules/FindZLIB.cmake @@ -17,9 +17,9 @@ find_path(ZLIB_INCLUDE_DIR zlib.h set(POTENTIAL_Z_LIBS z zlib zdll) find_library(ZLIB_LIBRARY NAMES ${POTENTIAL_Z_LIBS} - PATHS + PATHS "C:\\Programme\\Microsoft Visual Studio 8\\VC\\lib" - /usr/lib /usr/local/lib + ${SYSTEM_LIB_DIRS} "${GNUWIN32_DIR}"/lib) if(ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)