diff --git a/ports/fmilib/CONTROL b/ports/fmilib/CONTROL index 859098e309..aa6b868d59 100644 --- a/ports/fmilib/CONTROL +++ b/ports/fmilib/CONTROL @@ -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/ diff --git a/ports/fmilib/portfile.cmake b/ports/fmilib/portfile.cmake index df72dd7eec..5692b7d123 100644 --- a/ports/fmilib/portfile.cmake +++ b/ports/fmilib/portfile.cmake @@ -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