diff options
Diffstat (limited to 'emu-radio/wifi-emulator')
-rw-r--r-- | emu-radio/wifi-emulator/CMakeLists.txt | 71 |
1 files changed, 38 insertions, 33 deletions
diff --git a/emu-radio/wifi-emulator/CMakeLists.txt b/emu-radio/wifi-emulator/CMakeLists.txt index 558a751f..eb551fe2 100644 --- a/emu-radio/wifi-emulator/CMakeLists.txt +++ b/emu-radio/wifi-emulator/CMakeLists.txt @@ -38,46 +38,51 @@ install(TARGETS wifi_emulator DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) 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") -SET(PACKAGE_NAME wifi-emulator) - -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") +set(BUILD_NUMBER "1" CACHE STRING "Build Number") +set(PACKAGE_NAME wifi-emulator) + +set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") +set(CPACK_PACKAGE_VENDOR ${VENDOR}) +set(CPACK_PACKAGE_CONTACT ${CONTACT}) # Get the version execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/version OUTPUT_VARIABLE PACKAGE_VERSION) -string(STRIP ${PACKAGE_VERSION} 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 "libns3sx-3v5, ns3sx, libboost-system1.58.0") + set(TYPE "DEBIAN") + set(GENERATOR "DEB") + set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}_${ARCHITECTURE}") + set(CPACK_${TYPE}_PACKAGE_DEPENDS "libns3sx-3v5, ns3sx, libboost-system1.58.0") 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 "") + 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 "") 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 "Wifi N channel emulator.") -SET(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Vicn") - -INCLUDE(CPack) +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 "Wifi N channel emulator.") +set(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Vicn") + +include(CPack) |