Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #700 #701

Merged
merged 4 commits into from
Apr 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ 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(LIB_INSTALL_DIR "lib" CACHE PATH "Main library directory")

if(IS_DIRECTORY CMAKE_LIBRARY_PATH)
Nightwalker-87 marked this conversation as resolved.
Show resolved Hide resolved
if( IS_DIRECTORY ${LIB_INSTALL_DIR})
set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR} CACHE PATH "Main library directory")
set(STLINK_LIBRARY_PATH "${LIB_INSTALL_DIR}")
else()
set(CMAKE_LIBRARY_PATH "lib")
set(LIB_INSTALL_DIR "lib" CACHE PATH "Main library directory")
set(STLINK_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}" )
endif()

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

option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)

Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all

override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \
-DLIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
-DSTLINK_UDEV_RULES_DIR='/lib/udev/rules.d'
4 changes: 2 additions & 2 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
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 ${STLINK_INCLUDE_PATH}
)
install(FILES ${STLINK_HEADERS}
DESTINATION include/${CMAKE_LIBRARY_PATH}/stlink
DESTINATION ${STLINK_INCLUDE_PATH}/stlink
)