cmake: use cmake includedir
authorKevron Rees <kevron.m.rees@intel.com>
Wed, 11 Nov 2015 21:43:46 +0000 (13:43 -0800)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 1 Dec 2015 15:07:36 +0000 (15:07 +0000)
We need to use CMake variables to avoid installing things in the wrong places on
systems that have multilib enabled.

Signed-off-by: Kevron Rees <kevron.m.rees@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
examples/CMakeLists.txt
src/CMakeLists.txt

index de29ff3..5ca1431 100644 (file)
@@ -35,7 +35,7 @@ target_link_libraries (spi_max7219 mraa)
 
 add_subdirectory (c++)
 
-install (DIRECTORY ${PROJECT_SOURCE_DIR}/examples/ DESTINATION share/mraa/examples)
+install (DIRECTORY ${PROJECT_SOURCE_DIR}/examples/ DESTINATION ${CMAKE_INSTALL_DATADIR}/mraa/examples)
 
 if (INSTALLGPIOTOOL)
    install (TARGETS mraa-gpio DESTINATION bin)
index 2f4cd73..8859183 100644 (file)
@@ -93,8 +93,8 @@ set_target_properties(
    SOVERSION ${mraa_VERSION_MAJOR}
    VERSION ${mraa_VERSION_STRING}
 )
-install (FILES ${mraa_LIB_GLOB_HEADERS} DESTINATION include/)
-install (DIRECTORY ${PROJECT_SOURCE_DIR}/api/mraa/ DESTINATION include/mraa)
+install (FILES ${mraa_LIB_GLOB_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+install (DIRECTORY ${PROJECT_SOURCE_DIR}/api/mraa/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mraa)
 
 macro (mraa_CREATE_INSTALL_PKGCONFIG generated_file install_location)
   configure_file (${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)