diff options
Diffstat (limited to 'libdash')
-rw-r--r-- | libdash/CMakeLists.txt | 98 |
1 files changed, 63 insertions, 35 deletions
diff --git a/libdash/CMakeLists.txt b/libdash/CMakeLists.txt index 7913a03f..08e48635 100644 --- a/libdash/CMakeLists.txt +++ b/libdash/CMakeLists.txt @@ -170,53 +170,81 @@ add_library(dash SHARED ${SOURCE_FILES}) set_target_properties(dash PROPERTIES LINKER_LANGUAGE CXX) target_link_libraries(dash ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES}) message("libxml ${LIBXML2_LIBRARIES} ${LIBXML2_INCLUDE_DIR}") -install(TARGETS dash DESTINATION ${CMAKE_INSTALL_PREFIX}/lib PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) -install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/libdash) +install(TARGETS dash DESTINATION ${CMAKE_INSTALL_PREFIX}/lib PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ COMPONENT library) +install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/libdash COMPONENT headers) # Generate DEB / RPM packages 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) +execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/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 "zlib1g, git-core, libxml2, libcurl4-openssl-dev") + 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_${TYPE}_PACKAGE_SHLIBDEPS ON) + set(CPACK_${TYPE}_LIBRARY_PACKAGE_DEPENDS "") + set(CPACK_${TYPE}_HEADERS_PACKAGE_DEPENDS "libdash (>= 1.0), libxml2-dev, libcurl4-openssl-dev") + 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 "libxml2, libcurl, zlib") + 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}_PACKAGE_AUTOREQ ON) + set(CPACK_${TYPE}_LIBRARY_PACKAGE_REQUIRES "") + set(CPACK_${TYPE}_HEADERS_PACKAGE_REQUIRES "libdash >= 1.0, libxml2-devel, libcurl-openssl-devel") + 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 "Open-source library that provides an object orient (OO) interface to the MPEG-DASH standard") +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 "Open-source library that provides an object orient (OO) interface to the MPEG-DASH standard") -INCLUDE(CPack) +include(CPack) |