[fmilib] fmilib not building on x64-windows (#4999)

* fix fmilib not building on x64-windows

* [fmilib] bump dash version in control file

This will force a rebuild when updating

* only search for MSVC generator on windows
This commit is contained in:
Lars Ivar Hatledal 2019-01-09 00:02:25 +01:00 committed by Phil Christensen
parent fbabe0797c
commit 6ce206c785
2 changed files with 37 additions and 5 deletions

View File

@ -1,3 +1,3 @@
Source: fmilib
Version: 2.0.3
Version: 2.0.3-1
Description: FMI library is intended as a foundation for applications interfacing FMUs (Functional Mockup Units) that follow FMI Standard. This version of the library supports FMI 1.0 and FMI2.0. See http://www.fmi-standard.org/

View File

@ -69,6 +69,36 @@ SET(OPTIONS
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR})
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR})
if (WIN32)
if(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120")
set(GENERATOR "Visual Studio 12 2013")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120")
set(GENERATOR "Visual Studio 12 2013 Win64")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120")
set(GENERATOR "Visual Studio 12 2013 ARM")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015 Win64")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015 ARM")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(GENERATOR "Visual Studio 15 2017")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(GENERATOR "Visual Studio 15 2017 Win64")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(GENERATOR "Visual Studio 15 2017 ARM")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(GENERATOR "Visual Studio 15 2017")
else()
message(FATAL_ERROR "Unable to determine appropriate generator for: ${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}")
endif()
endif()
foreach(BUILDTYPE "rel" "dbg")
message("Building ${TARGET_TRIPLET}-${BUILDTYPE}...")
@ -81,10 +111,12 @@ foreach(BUILDTYPE "rel" "dbg")
file(REMOVE_RECURSE ${BUILD_DIR})
file(MAKE_DIRECTORY ${BUILD_DIR})
if(RELEASE_BUILD)
SET(FMILIB_INSTALL_PREFIX ${CURRENT_PACKAGES_DIR})
else()
SET(FMILIB_INSTALL_PREFIX ${CURRENT_PACKAGES_DIR}/debug)
SET(FMILIB_INSTALL_PREFIX ${CURRENT_PACKAGES_DIR})
if(WIN32)
SET(OPTIONS ${OPTIONS} -G ${GENERATOR})
endif()
if(NOT RELEASE_BUILD)
STRING(APPEND FMILIB_INSTALL_PREFIX "/debug")
endif()
# Step 1: Configure