Skip to content

Commit

Permalink
Fix installation path for shared objects (#581)
Browse files Browse the repository at this point in the history
On 64bit linux all shared objects should go to /usr/lib64. With this
path package maintainters should be able to override library path by
setting STLINK_LIBRARY_PATH.
  • Loading branch information
karol-szuster authored and xor-gate committed Apr 5, 2017
1 parent 6902f47 commit 47ab290
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ project(stlink C)
set(PROJECT_DESCRIPTION "Open source version of the STMicroelectronics Stlink Tools")
set(STLINK_UDEV_RULES_DIR "/etc/udev/rules.d" CACHE PATH "Udev rules directory")
set(STLINK_MODPROBED_DIR "/etc/modprobe.d" CACHE PATH "modprobe.d directory")
set(STLINK_LIBRARY_PATH "lib/${CMAKE_LIBRARY_PATH}" CACHE PATH "Target lib directory")

option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)

Expand Down Expand Up @@ -108,7 +109,7 @@ else()
endif()

install(TARGETS ${STLINK_LIB_SHARED}
DESTINATION lib/${CMAKE_LIBRARY_PATH}
DESTINATION ${STLINK_LIBRARY_PATH}
)

###
Expand Down Expand Up @@ -138,7 +139,7 @@ endif()
set_target_properties(${STLINK_LIB_STATIC} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})

install(TARGETS ${STLINK_LIB_STATIC}
ARCHIVE DESTINATION lib/${CMAKE_LIBRARY_PATH}
ARCHIVE DESTINATION ${STLINK_LIBRARY_PATH}
)

###
Expand Down
2 changes: 1 addition & 1 deletion usr/lib/pkgconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ configure_file(
)

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION lib/${CMAKE_LIBRARY_PATH}/pkgconfig/
DESTINATION ${STLINK_LIBRARY_PATH}/pkgconfig/
)

0 comments on commit 47ab290

Please sign in to comment.