From 699982eef8b29da7f94fa6d0b8216d660aa8fe40 Mon Sep 17 00:00:00 2001 From: Steven Koo Date: Fri, 30 Jul 2021 13:34:34 -0500 Subject: cmake: Fix VS names and use relative for images cmake has newer variables to identify specific Visual Studio version. This change updates to use those. This also changes how images files are globbed to be relative paths, which is useful if build files are moved from machine to machine. This case is possible in Azure Pipeline's CI. Signed-off-by: Steven Koo --- host/CMakeLists.txt | 2 +- host/cmake/Modules/UHDPackage.cmake | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index fc91ef441..3d60fa833 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -536,7 +536,7 @@ UHD_INSTALL( ######################################################################## if(DEFINED UHD_IMAGES_SRC_DIR AND EXISTS "${UHD_IMAGES_SRC_DIR}") message(STATUS "Reading images from directory `${UHD_IMAGES_SRC_DIR}'") - file(GLOB_RECURSE _image_files "${UHD_IMAGES_SRC_DIR}/*") + file(GLOB_RECURSE _image_files RELATIVE "${CMAKE_SOURCE_DIR}" "${UHD_IMAGES_SRC_DIR}/*") message(STATUS "These images files will be installed/packaged:") foreach(_img ${_image_files}) message(STATUS " ${_img}") diff --git a/host/cmake/Modules/UHDPackage.cmake b/host/cmake/Modules/UHDPackage.cmake index 3ce269180..4d507493b 100644 --- a/host/cmake/Modules/UHDPackage.cmake +++ b/host/cmake/Modules/UHDPackage.cmake @@ -80,16 +80,20 @@ if(${CPACK_GENERATOR} STREQUAL NSIS) check_type_size("void*[8]" BIT_WIDTH BUILTIN_TYPES_ONLY) # If CMake option given, specify MSVC version in installer filename if(SPECIFY_MSVC_VERSION) - if(MSVC90) # Visual Studio 2008 (9.0) + if(MSVC_TOOLSET_VERSION EQUAL 90) # Visual Studio 2008 (9.0) set(MSVC_VERSION "VS2008") - elseif(MSVC10) # Visual Studio 2010 (10.0) + elseif(MSVC_TOOLSET_VERSION EQUAL 100) # Visual Studio 2010 (10.0) set(MSVC_VERSION "VS2010") - elseif(MSVC11) # Visual Studio 2012 (11.0) + elseif(MSVC_TOOLSET_VERSION EQUAL 110) # Visual Studio 2012 (11.0) set(MSVC_VERSION "VS2012") - elseif(MSVC12) # Visual Studio 2013 (12.0) + elseif(MSVC_TOOLSET_VERSION EQUAL 120) # Visual Studio 2013 (12.0) set(MSVC_VERSION "VS2013") - elseif(MSVC14) # Visual Studio 2015 (14.0) + elseif(MSVC_TOOLSET_VERSION EQUAL 140) # Visual Studio 2015 (14.0) set(MSVC_VERSION "VS2015") + elseif(MSVC_TOOLSET_VERSION EQUAL 141) # Visual Studio 2017 (14.1) + set(MSVC_VERSION "VS2017") + elseif(MSVC_TOOLSET_VERSION EQUAL 142) # Visual Studio 2019 (14.2) + set(MSVC_VERSION "VS2019") endif() set(CPACK_PACKAGE_FILE_NAME "uhd_${UHD_VERSION}_Win${BIT_WIDTH}_${MSVC_VERSION}" CACHE INTERNAL "") else() -- cgit v1.2.3