* first try to fix #700
Use CMAKE_INSTALL_PREFIX for install paths

* check IS_DIRECTORY LIB_INSTALL_DIR
* fix incorrect VAR usage in condition
* changed debian/rules according to @bluca patch
pull/702/head^2
Slyshyk Oleksiy 2018-04-16 21:54:03 +03:00 zatwierdzone przez Jerry Jacobs
rodzic d76e3c7c54
commit 88935336f8
3 zmienionych plików z 14 dodań i 10 usunięć

Wyświetl plik

@ -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)
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)

2
debian/rules vendored
Wyświetl plik

@ -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'

Wyświetl plik

@ -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
)