aboutsummaryrefslogtreecommitdiffstats
path: root/libccnx-portal/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'libccnx-portal/CMakeLists.txt')
-rw-r--r--libccnx-portal/CMakeLists.txt98
1 files changed, 64 insertions, 34 deletions
diff --git a/libccnx-portal/CMakeLists.txt b/libccnx-portal/CMakeLists.txt
index 25e237e1..deca30ac 100644
--- a/libccnx-portal/CMakeLists.txt
+++ b/libccnx-portal/CMakeLists.txt
@@ -93,46 +93,76 @@ add_subdirectory(documentation)
option(DEB_PACKAGE "Create deb package" OFF)
option(RPM_PACKAGE "Create deb package" OFF)
-SET(VENDOR "Cisco Systems" CACHE STRING "Vendor")
-SET(CONTACT "msardara@cisco.com" CACHE STRING "Contact")
-SET(DISTRIBUTION "xenial" CACHE STRING "Distribution")
-SET(ARCHITECTURE "amd64" CACHE STRING "Architecture")
-SET(PACKAGE_MAINTAINER "Mauro Sardara (msardara@cisco.com)" CACHE STRING "Maintainer")
-SET(BUILD_NUMBER "1" CACHE STRING "Build Number")
-STRING(TOLOWER ${CMAKE_PROJECT_NAME} PACKAGE_NAME)
-
-SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
-SET(CPACK_PACKAGE_VENDOR ${VENDOR})
-SET(CPACK_PACKAGE_CONTACT ${CONTACT})
+set(VENDOR "Cisco Systems" CACHE STRING "Vendor")
+set(CONTACT "msardara@cisco.com" CACHE STRING "Contact")
+set(DISTRIBUTION "xenial" CACHE STRING "Distribution")
+set(ARCHITECTURE "amd64" CACHE STRING "Architecture")
+set(PACKAGE_MAINTAINER "Mauro Sardara (msardara@cisco.com)" CACHE STRING "Maintainer")
+string(TOLOWER ${CMAKE_PROJECT_NAME} PACKAGE_NAME)
+set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
+set(CPACK_PACKAGE_VENDOR ${VENDOR})
+set(CPACK_PACKAGE_CONTACT ${CONTACT})
+set(CPACK_COMPONENTS_ALL library headers documentation)
# Get the version
execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/version
- OUTPUT_VARIABLE PACKAGE_VERSION)
-string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION)
+ OUTPUT_VARIABLE PACKAGE_VERSION)
+
+if (PACKAGE_VERSION)
+ string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION)
+else()
+ set(PACKAGE_VERSION 1.0)
+endif()
if(DEB_PACKAGE)
- SET(TYPE "DEBIAN")
- SET(GENERATOR "DEB")
- SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}_${ARCHITECTURE}")
- SET(CPACK_${TYPE}_PACKAGE_DEPENDS "longbow (>= 1.0), libevent-2.0-5, libssl1.0.0, libparc (>= 1.0), libccnx-common (>= 1.0), libccnx-transport-rta (>= 1.0)")
+ set(TYPE "DEBIAN")
+ set(GENERATOR "DEB")
+
+ set(CPACK_${TYPE}_LIBRARY_PACKAGE_NAME "${PACKAGE_NAME}")
+ set(CPACK_${TYPE}_HEADERS_PACKAGE_NAME "${PACKAGE_NAME}-dev")
+ set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_NAME "${PACKAGE_NAME}-doc")
+
+ set(CPACK_${TYPE}_LIBRARY_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}_${ARCHITECTURE}.deb")
+ set(CPACK_${TYPE}_HEADERS_FILE_NAME "${PACKAGE_NAME}-dev_${PACKAGE_VERSION}_${ARCHITECTURE}.deb")
+ set(CPACK_${TYPE}_DOCUMENTATION_FILE_NAME "${PACKAGE_NAME}-doc_${PACKAGE_VERSION}_${ARCHITECTURE}.deb")
+
+ set(CPACK_DEBIAN_LIBRARY_PACKAGE_SHLIBDEPS ON)
+
+ set(CPACK_${TYPE}_LIBRARY_PACKAGE_DEPENDS "longbow (>= 1.0), libevent-2.0-5, libssl1.0.0, libparc (>= 1.0), libccnx-common (>= 1.0), libccnx-transport-rta (>= 1.0)")
+ set(CPACK_${TYPE}_HEADERS_PACKAGE_DEPENDS "libccnx-portal (>= 1.0), libccnx-transport-rta-dev (>= 1.0), libccnx-common-dev (>= 1.0), libparc-dev (>= 1.0), longbow-dev (>= 1.0)")
+ set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_DEPENDS "")
elseif(RPM_PACKAGE)
- SET(TYPE "RPM")
- SET(GENERATOR "RPM")
- SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}.${ARCHITECTURE}")
- SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/etc" "/usr/lib/python2.7" "/usr/lib/python2.7/site-packages")
- SET(CPACK_${TYPE}_PACKAGE_REQUIRES "longbow >= 1.0, libevent >= 2.0, openssl >= 1.0, libparc >= 1.0, libccnx-common >= 1.0, libccnx-transport-rta >= 1.0")
+ set(TYPE "RPM")
+ set(GENERATOR "RPM")
+
+ set(CPACK_${TYPE}_LIBRARY_PACKAGE_NAME "${PACKAGE_NAME}")
+ set(CPACK_${TYPE}_HEADERS_PACKAGE_NAME "${PACKAGE_NAME}-devel")
+ set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_NAME "${PACKAGE_NAME}-doc")
+
+ set(CPACK_${TYPE}_LIBRARY_FILE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}.${ARCHITECTURE}.rpm")
+ set(CPACK_${TYPE}_HEADERS_FILE_NAME "${PACKAGE_NAME}-devel-${PACKAGE_VERSION}.${ARCHITECTURE}.rpm")
+ set(CPACK_${TYPE}_DOCUMENTATION_FILE_NAME "${PACKAGE_NAME}-doc-${PACKAGE_VERSION}.${ARCHITECTURE}.rpm")
+
+ set(CPACK_${TYPE}_LIBRARY_PACKAGE_AUTOREQ ON)
+
+ set(CPACK_${TYPE}_LIBRARY_PACKAGE_REQUIRES "longbow >= 1.0, libevent-2.0-5, libssl1.0.0, libparc >= 1.0, libccnx-common >= 1.0, libccnx-transport-rta >= 1.0")
+ set(CPACK_${TYPE}_HEADERS_PACKAGE_REQUIRES "libccnx-portal >= 1.0, libccnx-transport-rta-devel >= 1.0, libccnx-common-devel >= 1.0, libparc-devel >= 1.0, longbow-devel >= 1.0")
+ set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_REQUIRES "")
+
+ set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/etc" "/usr/lib/python2.7" "/usr/lib/python2.7/site-packages")
else()
- RETURN()
+ return()
endif()
-SET(CPACK_GENERATOR ${GENERATOR})
-SET(CPACK_${TYPE}_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER})
-SET(CPACK_${TYPE}_PACKAGE_NAME ${PACKAGE_NAME})
-SET(CPACK_${TYPE}_PACKAGE_VERSION ${PACKAGE_VERSION})
-SET(CPACK_${TYPE}_PACKAGE_ARCHITECTURE ${ARCHITECTURE})
-SET(CPACK_${TYPE}_PACKAGE_RELEASE 1)
-SET(CPACK_${TYPE}_PACKAGE_VENDOR ${VENDOR})
-SET(CPACK_${TYPE}_PACKAGE_DESCRIPTION "The CCNx Portal API is a simple API to communicate via Interests and Content Objects. It connects to a transport stack like Transport RTA (libccnx-transport-rta).")
-SET(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Ccnxlib")
-
-INCLUDE(CPack)
+set(CPACK_GENERATOR ${GENERATOR})
+set(CPACK_${GENERATOR}_COMPONENT_INSTALL ON)
+set(CPACK_${TYPE}_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER})
+set(CPACK_${TYPE}_PACKAGE_NAME ${PACKAGE_NAME})
+set(CPACK_${TYPE}_PACKAGE_VERSION ${PACKAGE_VERSION})
+set(CPACK_${TYPE}_PACKAGE_ARCHITECTURE ${ARCHITECTURE})
+set(CPACK_${TYPE}_PACKAGE_RELEASE 1)
+set(CPACK_${TYPE}_PACKAGE_VENDOR ${VENDOR})
+set(CPACK_${TYPE}_PACKAGE_DESCRIPTION "The CCNx Portal API is a simple API to communicate via Interests and Content Objects. It connects to a transport stack like Transport RTA (libccnx-transport-rta).")
+set(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Ccnxlib")
+
+include(CPack)