#40 library path for 64bit systems

closed-fixed
nobody
None
5
2010-10-15
2010-09-07
Petr Vaněk
No

the lib path is hardcoded in CMakeLists.txt. It causes problems in 64bit systems (packaging checks etc). I did small workaround tto compile my rpms:

# some system (rpm builds) setup LIB_SUFFIX for cmake. If there is no set, try to get it from system
IF (NOT LIB_SUFFIX)
MESSAGE(STATUS "")
MESSAGE(STATUS "LIB_SUFFIX variable is not defined. It will be autodetected now.")
MESSAGE(STATUS "You can set it manually with -DLIB_SUFFIX=<value> (64 for example)")
IF (NOT APPLE)
# check 64 bit
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
SET (LIB_SUFFIX "")
else (CMAKE_SIZEOF_VOID_P EQUAL 4)
set (LIB_SUFFIX "64")
MESSAGE(STATUS " LIB_SUFFIX is set to '${LIB_SUFFIX}'")
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
ELSE (NOT APPLE)
SET (LIB_SUFFIX "")
ENDIF (NOT APPLE)
MESSAGE(STATUS "")
ENDIF (NOT LIB_SUFFIX)

and then change all occurences of /lib to /lib${LIB_SUFFIX}, eg. SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")

it will produce
/usr/lib for 32but
/usr/lib64 for 64bit architectures

Discussion

  • Mezomish
    Mezomish
    2010-09-07

    Will do.

     
  • Mezomish
    Mezomish
    2010-10-15

    Fixed in trunk.

     
  • Mezomish
    Mezomish
    2010-10-15

    • status: open --> closed-fixed