mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-12 17:33:15 +08:00
Fixed MSVC dashboard (Experimental/Continuous) build scripts.
This commit is contained in:
parent
455e6e38b6
commit
c754023e72
@ -1,103 +0,0 @@
|
|||||||
# - Includes a public function for assisting users in trying to determine the
|
|
||||||
# Visual Studio service pack in use.
|
|
||||||
#
|
|
||||||
# Sets the passed in variable to one of the following values or an empty
|
|
||||||
# string if unknown.
|
|
||||||
# vc80
|
|
||||||
# vc80sp1
|
|
||||||
# vc90
|
|
||||||
# vc90sp1
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# ===========================
|
|
||||||
#
|
|
||||||
# if(MSVC)
|
|
||||||
# include(CMakeDetermineVSServicePack)
|
|
||||||
# DetermineVSServicePack( my_service_pack )
|
|
||||||
#
|
|
||||||
# if( my_service_pack )
|
|
||||||
# message(STATUS "Detected: ${my_service_pack}")
|
|
||||||
# endif()
|
|
||||||
# endif()
|
|
||||||
#
|
|
||||||
# ===========================
|
|
||||||
|
|
||||||
#=============================================================================
|
|
||||||
# Copyright 2009-2010 Kitware, Inc.
|
|
||||||
# Copyright 2009-2010 Philip Lowman <philip@yhbt.com>
|
|
||||||
#
|
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
|
||||||
# see accompanying file Copyright.txt for details.
|
|
||||||
#
|
|
||||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
||||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
# See the License for more information.
|
|
||||||
#=============================================================================
|
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
|
||||||
# License text for the above reference.)
|
|
||||||
|
|
||||||
# [INTERNAL]
|
|
||||||
# Please do not call this function directly
|
|
||||||
function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)
|
|
||||||
if (${_cl_version} VERSION_EQUAL "14.00.50727.42")
|
|
||||||
set(_version "vc80")
|
|
||||||
elseif(${_cl_version} VERSION_EQUAL "14.00.50727.762")
|
|
||||||
set(_version "vc80sp1")
|
|
||||||
elseif(${_cl_version} VERSION_EQUAL "15.00.21022.08")
|
|
||||||
set(_version "vc90")
|
|
||||||
elseif(${_cl_version} VERSION_EQUAL "15.00.30729.01")
|
|
||||||
set(_version "vc90sp1")
|
|
||||||
elseif(${_cl_version} VERSION_EQUAL "16.00.30319.01")
|
|
||||||
set(_version "vc100")
|
|
||||||
else()
|
|
||||||
set(_version "")
|
|
||||||
endif()
|
|
||||||
set(${_OUT_VAR} ${_version} PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
#
|
|
||||||
# A function to call to determine the Visual Studio service pack
|
|
||||||
# in use. See documentation above.
|
|
||||||
function(DetermineVSServicePack _pack)
|
|
||||||
if(NOT DETERMINED_VS_SERVICE_PACK OR NOT ${_pack})
|
|
||||||
if(${CMAKE_BUILD_TOOL} STREQUAL "nmake")
|
|
||||||
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} "/?"
|
|
||||||
ERROR_VARIABLE _output)
|
|
||||||
set(DETERMINED_VS_SERVICE_PACK ${_output})
|
|
||||||
else()
|
|
||||||
file(WRITE "${CMAKE_BINARY_DIR}/return0.cc"
|
|
||||||
"int main() { return 0; }\n")
|
|
||||||
|
|
||||||
try_compile(DETERMINED_VS_SERVICE_PACK
|
|
||||||
"${CMAKE_BINARY_DIR}"
|
|
||||||
"${CMAKE_BINARY_DIR}/return0.cc"
|
|
||||||
OUTPUT_VARIABLE _output
|
|
||||||
COPY_FILE "${CMAKE_BINARY_DIR}/return0.cc")
|
|
||||||
|
|
||||||
file(REMOVE "${CMAKE_BINARY_DIR}/return0.cc")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(DETERMINED_VS_SERVICE_PACK AND _output)
|
|
||||||
string(REGEX MATCH "Compiler Version [0-9]+.[0-9]+.[0-9]+.[0-9]+"
|
|
||||||
_cl_version "${_output}")
|
|
||||||
if(_cl_version)
|
|
||||||
string(REGEX MATCHALL "[0-9]+"
|
|
||||||
_cl_version_list "${_cl_version}")
|
|
||||||
list(GET _cl_version_list 0 _major)
|
|
||||||
list(GET _cl_version_list 1 _minor)
|
|
||||||
list(GET _cl_version_list 2 _patch)
|
|
||||||
list(GET _cl_version_list 3 _tweak)
|
|
||||||
|
|
||||||
set(_cl_version_string ${_major}.${_minor}.${_patch}.${_tweak})
|
|
||||||
|
|
||||||
# Call helper function to determine VS version
|
|
||||||
_DetermineVSServicePackFromCompiler(_sp "${_cl_version_string}")
|
|
||||||
if(_sp)
|
|
||||||
#set(${_pack} "${_sp}(${_cl_version_string})" CACHE INTERNAL
|
|
||||||
set(${_pack} "${_sp}" CACHE INTERNAL
|
|
||||||
"The Visual Studio Release with Service Pack")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
@ -27,10 +27,10 @@ include(CTest)
|
|||||||
# overwrite default DartConfiguration.tcl
|
# overwrite default DartConfiguration.tcl
|
||||||
# The worarounds are different for each version of the MSVC IDE
|
# The worarounds are different for each version of the MSVC IDE
|
||||||
if(MSVC_IDE)
|
if(MSVC_IDE)
|
||||||
if(MSVC_VERSION EQUAL 1600) # MSVC 2010
|
if(CMAKE_MAKE_PROGRAM_SAVE MATCHES "devenv") # devenv
|
||||||
|
set(EIGEN_MAKECOMMAND_PLACEHOLDER "${CMAKE_MAKE_PROGRAM_SAVE} Eigen.sln /build \"Release\" /project buildtests \n# ")
|
||||||
|
else() # msbuild
|
||||||
set(EIGEN_MAKECOMMAND_PLACEHOLDER "${CMAKE_MAKE_PROGRAM_SAVE} buildtests.vcxproj /p:Configuration=\${CTEST_CONFIGURATION_TYPE} \n# ")
|
set(EIGEN_MAKECOMMAND_PLACEHOLDER "${CMAKE_MAKE_PROGRAM_SAVE} buildtests.vcxproj /p:Configuration=\${CTEST_CONFIGURATION_TYPE} \n# ")
|
||||||
else() # MSVC 2008 (TODO check MSVC 2005)
|
|
||||||
set(EIGEN_MAKECOMMAND_PLACEHOLDER "${CMAKE_MAKE_PROGRAM_SAVE} Eigen.sln /build \"Release\" /project buildtests \n# ")
|
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
# for make and nmake
|
# for make and nmake
|
||||||
|
27
cmake/EigenDetermineVSServicePack.cmake
Normal file
27
cmake/EigenDetermineVSServicePack.cmake
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
include(CMakeDetermineVSServicePack)
|
||||||
|
|
||||||
|
# The code is almost identical to the CMake version. The only difference is that we remove
|
||||||
|
# _DetermineVSServicePack_FastCheckVersionWithCompiler which lead to errors on some systems.
|
||||||
|
function(EigenDetermineVSServicePack _pack)
|
||||||
|
if(NOT DETERMINED_VS_SERVICE_PACK OR NOT ${_pack})
|
||||||
|
|
||||||
|
if(NOT DETERMINED_VS_SERVICE_PACK)
|
||||||
|
_DetermineVSServicePack_CheckVersionWithTryCompile(DETERMINED_VS_SERVICE_PACK _cl_version)
|
||||||
|
if(NOT DETERMINED_VS_SERVICE_PACK)
|
||||||
|
_DetermineVSServicePack_CheckVersionWithTryRun(DETERMINED_VS_SERVICE_PACK _cl_version)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(DETERMINED_VS_SERVICE_PACK)
|
||||||
|
|
||||||
|
if(_cl_version)
|
||||||
|
# Call helper function to determine VS version
|
||||||
|
_DetermineVSServicePackFromCompiler(_sp "${_cl_version}")
|
||||||
|
if(_sp)
|
||||||
|
set(${_pack} ${_sp} CACHE INTERNAL
|
||||||
|
"The Visual Studio Release with Service Pack")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
@ -303,8 +303,8 @@ endmacro(ei_set_sitename)
|
|||||||
macro(ei_get_compilerver VAR)
|
macro(ei_get_compilerver VAR)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# on windows system, we use a modified CMake script
|
# on windows system, we use a modified CMake script
|
||||||
include(CMakeDetermineVSServicePack)
|
include(EigenDetermineVSServicePack)
|
||||||
DetermineVSServicePack( my_service_pack )
|
EigenDetermineVSServicePack( my_service_pack )
|
||||||
|
|
||||||
if( my_service_pack )
|
if( my_service_pack )
|
||||||
set(${VAR} ${my_service_pack})
|
set(${VAR} ${my_service_pack})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user