Skip to content

Commit

Permalink
cmake: use LIB_INSTALL_DIR throughout instead of CMAKE_INSTALL_LIBDIR
Browse files Browse the repository at this point in the history
Signed-off-by: Mihai Tudor Panu <[email protected]>
Signed-off-by: Brendan Le Foll <[email protected]>
  • Loading branch information
Propanu authored and arfoll committed Apr 12, 2016
1 parent 00a0abd commit 62e113e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ FIND_PACKAGE (Threads REQUIRED)

set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -fno-omit-frame-pointer ")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall ")
set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installation path for libraries")

# Older cmake might not pick CMAKE_INSTALL_LIBDIR right
if (CMAKE_INSTALL_LIBDIR)
set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installation path for libraries")
else ()
set (LIB_INSTALL_DIR "lib" CACHE PATH "Installation path for libraries")
endif ()
# Set CMAKE_LIB_INSTALL_DIR if not defined
include(GNUInstallDirs)

Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ macro (mraa_CREATE_INSTALL_PKGCONFIG generated_file install_location)
configure_file (${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} DESTINATION ${install_location})
endmacro (mraa_CREATE_INSTALL_PKGCONFIG)
mraa_create_install_pkgconfig (mraa.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
mraa_create_install_pkgconfig (mraa.pc ${LIB_INSTALL_DIR}/pkgconfig)


if (DOXYGEN_FOUND)
Expand Down Expand Up @@ -208,4 +208,4 @@ set_target_properties(
SOVERSION ${mraa_VERSION_MAJOR}
VERSION ${mraa_VERSION_STRING}
)
install(TARGETS mraa DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS mraa DESTINATION ${LIB_INSTALL_DIR})
6 changes: 3 additions & 3 deletions src/java/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (DOXYGEN_FOUND)
endforeach ()
endif ()

mraa_create_install_pkgconfig (mraajava.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
mraa_create_install_pkgconfig (mraajava.pc ${LIB_INSTALL_DIR}/pkgconfig)

install (TARGETS mraajava LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/mraa.jar DESTINATION ${CMAKE_INSTALL_LIBDIR}/../lib/java)
install (TARGETS mraajava LIBRARY DESTINATION ${LIB_INSTALL_DIR})
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/mraa.jar DESTINATION ${LIB_INSTALL_DIR}/../lib/java)

0 comments on commit 62e113e

Please sign in to comment.