Browse Source

cmake : Define library suffix in case of 64 bits multilib archs in linux

Install library using cmake defined library directories. Install python
packages using cmake defined library directories

Signed-off-by: Helio Chisisni de Castro <helio@kde.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Helio Chissini de Castro 10 years ago
parent
commit
cb37c87467
2 changed files with 6 additions and 2 deletions
  1. 4
    0
      CMakeLists.txt
  2. 2
    2
      src/CMakeLists.txt

+ 4
- 0
CMakeLists.txt View File

@@ -14,6 +14,10 @@ message (INFO " found libmraa version: ${MRAA_VERSION}")
14 14
 
15 15
 # Appends the cmake/modules path to MAKE_MODULE_PATH variable.
16 16
 set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
17
+set (LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries")
18
+
19
+# Set CMAKE_LIB_INSTALL_DIR if not defined
20
+include(GNUInstallDirs)
17 21
 
18 22
 # Make a version file containing the current version from git.
19 23
 include (GetGitRevisionDescription)

+ 2
- 2
src/CMakeLists.txt View File

@@ -27,7 +27,7 @@ macro(upm_SWIG_PYTHON)
27 27
      )
28 28
     install (FILES ${CMAKE_CURRENT_BINARY_DIR}/_pyupm_${libname}.so
29 29
          ${CMAKE_CURRENT_BINARY_DIR}/pyupm_${libname}.py
30
-         DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/
30
+         DESTINATION ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/
31 31
          COMPONENT ${libname})
32 32
   endif()
33 33
 endmacro()
@@ -114,7 +114,7 @@ macro(upm_module_init)
114 114
   if (BUILDDOC)
115 115
     upm_doxygen()
116 116
   endif()
117
-  install (TARGETS ${libname} DESTINATION lib COMPONENT ${libname})
117
+  install(TARGETS ${libname} DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} )
118 118
   install (FILES ${module_h} DESTINATION include/upm COMPONENT ${libname})
119 119
 
120 120
   if (IPK)