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
@@ -1,4 +1,4 @@ | |||||
cmake_minimum_required(VERSION 3.10) | |||||
cmake_minimum_required(VERSION 3.12) | |||||
project(WiringPiLib) | project(WiringPiLib) | ||||
# Read version from version.h | # Read version from version.h | ||||
@@ -37,11 +37,17 @@ set(CPACK_PACKAGE_VERSION_PATCH "") | |||||
set(CPACK_GENERATOR "DEB") | set(CPACK_GENERATOR "DEB") | ||||
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) | set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) | ||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Grazer Computer Club - GC2 <wiringpi@gc2.at>") | 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/postinst" | ||||
"${CMAKE_CURRENT_SOURCE_DIR}/debian-template/wiringPi/DEBIAN/postrm") | "${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 | # Check for arm or arm64 architecture | ||||
# Let CMake determine a value otherwise | # Let CMake determine a value otherwise | ||||
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm") | if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm") | ||||
@@ -1,6 +1,4 @@ | |||||
# CMakeLists.txt for devLib | # CMakeLists.txt for devLib | ||||
cmake_minimum_required(VERSION 3.10) | |||||
project(devLib) | project(devLib) | ||||
# Source files | # Source files | ||||
@@ -34,6 +32,6 @@ target_link_libraries(wiringPiDev PRIVATE wiringPi) | |||||
set_target_properties(wiringPiDev PROPERTIES VERSION ${WIRINGPI_VERSION} SOVERSION ${WIRINGPI_VERSION_MAJOR}) | set_target_properties(wiringPiDev PROPERTIES VERSION ${WIRINGPI_VERSION} SOVERSION ${WIRINGPI_VERSION_MAJOR}) | ||||
# Install headers | # Install headers | ||||
install(FILES ${HEADERS} DESTINATION include) | |||||
install(FILES ${HEADERS} DESTINATION include COMPONENT Development) | |||||
# Install the library | # Install the library | ||||
install(TARGETS wiringPiDev LIBRARY DESTINATION lib) | |||||
install(TARGETS wiringPiDev LIBRARY DESTINATION lib COMPONENT Runtime NAMELINK_COMPONENT Development) |
@@ -1,6 +1,4 @@ | |||||
# CMakeLists.txt for gpio | # CMakeLists.txt for gpio | ||||
cmake_minimum_required(VERSION 3.10) | |||||
project(gpio) | project(gpio) | ||||
find_package(PkgConfig REQUIRED) | find_package(PkgConfig REQUIRED) | ||||
@@ -24,7 +22,7 @@ add_executable(gpio ${SRC}) | |||||
target_link_libraries(gpio wiringPi wiringPiDev Threads::Threads m PkgConfig::libcrypt) | target_link_libraries(gpio wiringPi wiringPiDev Threads::Threads m PkgConfig::libcrypt) | ||||
# Install the executable | # Install the executable | ||||
install(TARGETS gpio DESTINATION bin) | |||||
install(TARGETS gpio DESTINATION bin COMPONENT Runtime) | |||||
# Install man page | # Install man page | ||||
install(FILES gpio.1 DESTINATION share/man/man1) | |||||
install(FILES gpio.1 DESTINATION share/man/man1 COMPONENT Runtime) |
@@ -1,6 +1,4 @@ | |||||
# CMakeLists.txt for pins | # CMakeLists.txt for pins | ||||
cmake_minimum_required(VERSION 3.10) | |||||
project(pins LANGUAGES NONE) | project(pins LANGUAGES NONE) | ||||
# Source file | # Source file | ||||
@@ -1,6 +1,4 @@ | |||||
# CMakeLists.txt for wiringPi | # CMakeLists.txt for wiringPi | ||||
cmake_minimum_required(VERSION 3.10) | |||||
project(WiringPi) | project(WiringPi) | ||||
# Source files | # Source files | ||||
@@ -55,6 +53,6 @@ target_include_directories(wiringPi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | |||||
# Add -lm to link with the math library | # Add -lm to link with the math library | ||||
target_link_libraries(wiringPi PUBLIC m crypt) | target_link_libraries(wiringPi PUBLIC m crypt) | ||||
# Install headers | # Install headers | ||||
install(FILES ${HEADERS} DESTINATION include) | |||||
install(FILES ${HEADERS} DESTINATION include COMPONENT Development) | |||||
# Install the library | # Install the library | ||||
install(TARGETS wiringPi LIBRARY DESTINATION lib) | |||||
install(TARGETS wiringPi LIBRARY DESTINATION lib COMPONENT Runtime NAMELINK_COMPONENT Development) |
@@ -1,6 +1,4 @@ | |||||
# CMakeLists.txt for wiringPiD | # CMakeLists.txt for wiringPiD | ||||
cmake_minimum_required(VERSION 3.10) | |||||
project(wiringPiD) | project(wiringPiD) | ||||
# Source files | # Source files | ||||