Bläddra i källkod

Move development files in a Debian -dev package

Install targets and files in default Runtime and Development CMake
components to determine files included in the two Debian packages.
Move to CMake minimum version to 3.12 to allow using NAMELINK_COMPONENT
option in install() allowing adding .so files in a separate component,
Developement here.
Use CPack to build the two Debian packages.
pull/276/head
Jonathan GUILLOT 1 månad sedan
förälder
incheckning
39229af195
6 ändrade filer med 15 tillägg och 19 borttagningar
  1. +9
    -3
      CMakeLists.txt
  2. +2
    -4
      devLib/CMakeLists.txt
  3. +2
    -4
      gpio/CMakeLists.txt
  4. +0
    -2
      pins/CMakeLists.txt
  5. +2
    -4
      wiringPi/CMakeLists.txt
  6. +0
    -2
      wiringPiD/CMakeLists.txt

+ 9
- 3
CMakeLists.txt Visa fil

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.12)
project(WiringPiLib)

# Read version from version.h
@@ -37,11 +37,17 @@ set(CPACK_PACKAGE_VERSION_PATCH "")
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Grazer Computer Club - GC2 <wiringpi@gc2.at>")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libcrypt1")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
set(CPACK_DEBIAN_RUNTIME_PACKAGE_DEPENDS "libc6, libcrypt1")
set(CPACK_DEBIAN_RUNTIME_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR}/debian-template/wiringPi/DEBIAN/postinst"
"${CMAKE_CURRENT_SOURCE_DIR}/debian-template/wiringPi/DEBIAN/postrm")

set(CPACK_DEB_COMPONENT_INSTALL TRUE)
set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-dev")
set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON)
set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "${CPACK_DEBIAN_RUNTIME_PACKAGE_NAME}")

# Check for arm or arm64 architecture
# Let CMake determine a value otherwise
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm")


+ 2
- 4
devLib/CMakeLists.txt Visa fil

@@ -1,6 +1,4 @@
# CMakeLists.txt for devLib

cmake_minimum_required(VERSION 3.10)
project(devLib)

# Source files
@@ -34,6 +32,6 @@ target_link_libraries(wiringPiDev PRIVATE wiringPi)
set_target_properties(wiringPiDev PROPERTIES VERSION ${WIRINGPI_VERSION} SOVERSION ${WIRINGPI_VERSION_MAJOR})

# Install headers
install(FILES ${HEADERS} DESTINATION include)
install(FILES ${HEADERS} DESTINATION include COMPONENT Development)
# Install the library
install(TARGETS wiringPiDev LIBRARY DESTINATION lib)
install(TARGETS wiringPiDev LIBRARY DESTINATION lib COMPONENT Runtime NAMELINK_COMPONENT Development)

+ 2
- 4
gpio/CMakeLists.txt Visa fil

@@ -1,6 +1,4 @@
# CMakeLists.txt for gpio

cmake_minimum_required(VERSION 3.10)
project(gpio)

find_package(PkgConfig REQUIRED)
@@ -24,7 +22,7 @@ add_executable(gpio ${SRC})
target_link_libraries(gpio wiringPi wiringPiDev Threads::Threads m PkgConfig::libcrypt)

# Install the executable
install(TARGETS gpio DESTINATION bin)
install(TARGETS gpio DESTINATION bin COMPONENT Runtime)

# Install man page
install(FILES gpio.1 DESTINATION share/man/man1)
install(FILES gpio.1 DESTINATION share/man/man1 COMPONENT Runtime)

+ 0
- 2
pins/CMakeLists.txt Visa fil

@@ -1,6 +1,4 @@
# CMakeLists.txt for pins

cmake_minimum_required(VERSION 3.10)
project(pins LANGUAGES NONE)

# Source file


+ 2
- 4
wiringPi/CMakeLists.txt Visa fil

@@ -1,6 +1,4 @@
# CMakeLists.txt for wiringPi

cmake_minimum_required(VERSION 3.10)
project(WiringPi)

# Source files
@@ -55,6 +53,6 @@ target_include_directories(wiringPi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
# Add -lm to link with the math library
target_link_libraries(wiringPi PUBLIC m crypt)
# Install headers
install(FILES ${HEADERS} DESTINATION include)
install(FILES ${HEADERS} DESTINATION include COMPONENT Development)
# Install the library
install(TARGETS wiringPi LIBRARY DESTINATION lib)
install(TARGETS wiringPi LIBRARY DESTINATION lib COMPONENT Runtime NAMELINK_COMPONENT Development)

+ 0
- 2
wiringPiD/CMakeLists.txt Visa fil

@@ -1,6 +1,4 @@
# CMakeLists.txt for wiringPiD

cmake_minimum_required(VERSION 3.10)
project(wiringPiD)

# Source files


Laddar…
Avbryt
Spara