Skip to content

Commit

Permalink
first try to fix stlink-org#700
Browse files Browse the repository at this point in the history
Use CMAKE_INSTALL_PREFIX for install paths
  • Loading branch information
slyshykO committed Mar 30, 2018
1 parent 095ef91 commit ea9d12d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
12 changes: 1 addition & 11 deletions CMakeLists.txt
Expand Up @@ -5,17 +5,7 @@ set(PROJECT_DESCRIPTION "Open source version of the STMicroelectronics Stlink To
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(LIB_INSTALL_DIR "lib" CACHE PATH "Main library directory")

if(IS_DIRECTORY CMAKE_LIBRARY_PATH)
else()
set(CMAKE_LIBRARY_PATH "lib")
endif()

if (WIN32)
set(STLINK_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} CACHE PATH "Target lib directory")
else()
set(STLINK_LIBRARY_PATH "${LIB_INSTALL_DIR}/${CMAKE_LIBRARY_PATH}" CACHE PATH "Target lib directory")
endif(WIN32)
set(STLINK_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}" CACHE PATH "Target lib directory")

option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)

Expand Down
4 changes: 2 additions & 2 deletions include/CMakeLists.txt
Expand Up @@ -7,8 +7,8 @@ file(GLOB STLINK_HEADERS
"${CMAKE_BINARY_DIR}/include/stlink/*.h"
)
install(FILES ${CMAKE_SOURCE_DIR}/include/stlink.h
DESTINATION include/${CMAKE_LIBRARY_PATH}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
)
install(FILES ${STLINK_HEADERS}
DESTINATION include/${CMAKE_LIBRARY_PATH}/stlink
DESTINATION include/${CMAKE_INSTALL_PREFIX}/include/stlink
)

0 comments on commit ea9d12d

Please sign in to comment.