Skip to content

Commit

Permalink
Fix to cope with Microsoft VC arbitrary versioning numer policy (sigh)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jun 11, 2017
1 parent 25feb86 commit c30d211
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmakemodules/script_version_number.cmake
Expand Up @@ -17,11 +17,12 @@ IF(WIN32)
# 1800 = VC 12.0 (2013)
# ... (13 was skipped!)
# 1900 = VC 14.0 (2015)
math(EXPR MSVC_VERSION_2D "(${MSVC_VERSION}/100)-6")
IF (MSVC_VERSION_2D GREATER 12)
math(EXPR MSVC_VERSION_2D "${MSVC_VERSION_2D}+1")
# 1910 = VC 14.1 (2017)
math(EXPR MSVC_VERSION_3D "(${MSVC_VERSION}/10)-60")
IF (MSVC_VERSION_3D GREATER 120)
math(EXPR MSVC_VERSION_3D "${MSVC_VERSION_3D}+10")
ENDIF()
SET(CMAKE_MRPT_COMPILER_NAME "_msvc${MSVC_VERSION_2D}")
SET(CMAKE_MRPT_COMPILER_NAME "_msvc${MSVC_VERSION_3D}")
ELSE()
SET(CMAKE_MRPT_COMPILER_NAME "_${CMAKE_CXX_COMPILER_ID}")
ENDIF()
Expand Down

0 comments on commit c30d211

Please sign in to comment.