if(NOT PACKAGE_RELEASE_SUFFIX)
    set(PACKAGE_RELEASE_SUFFIX linux)
endif()
set(CPACK_PACKAGE_VERSION ${ASAPO_VERSION})
set(CPACK_PACKAGE_RELEASE ${PACKAGE_RELEASE_SUFFIX})
set(CPACK_PACKAGE_CONTACT "IT")
set(CPACK_PACKAGE_VENDOR "DESY")
IF (WIN32)
    install(FILES ${CURL_LIBRARIES} DESTINATION lib)
    set(CPACK_PACKAGE_FILE_NAME "asapo-${CPACK_PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")
else()
    get_filename_component(CURLLIB_EXT ${CURL_LIBRARIES} EXT)
    if(DEFINED PACK_STATIC_CURL_LIB)
        install(FILES ${PACK_STATIC_CURL_LIB} DESTINATION lib RENAME ${CMAKE_STATIC_LIBRARY_PREFIX}asapo-curl${CMAKE_STATIC_LIBRARY_SUFFIX})
    elseif("R${CMAKE_STATIC_LIBRARY_SUFFIX}" STREQUAL "R${CURLLIB_EXT}")
        install(FILES ${CURL_LIBRARIES} DESTINATION lib RENAME ${CMAKE_STATIC_LIBRARY_PREFIX}asapo-curl${CURLLIB_EXT})
    endif()
    set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
    set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
endif()

set(CPACK_DEBIAN_PACKAGE_DEPENDS "libcurl4-openssl-dev")
set(CPACK_RPM_PACKAGE_REQUIRES "libcurl-devel")

include(CPack)