DiscussionsIssue archiveOCCT:Configuration

Archived issue #0028701

Configuration - add support of VS 2017

Open CASCADEOCCT:Configurationclosed19 public notes

Search issues

Description

Since Visual Studio 2017 is now released, we need to support it for building OCCT.

There are two problems.

1. Deviating versions of Visual Studio and compiler

Previously, each new release of Visual Studio came with new version of VC++ compiler, and their versions matched each other. This is used by OCCT build system: the same id (VCVER, e.g. "vc10") is used to denote both. With VS 2017, this is not the case anymore: Visual Studio version is 15, but compuler version remains 14 (actuallt, 14.1).

There is one good point in that: compiler has the same major version as in VS 2015, and it uses the same run-time library, thus it is fully compatible with binaries built by VS 2015. This means that, we do not need to regenerate third-party libraries for use with VS 2017: the ones for 2015 can be reused.

However, we need to distinguish now version of Visual Studio (15) and compiler (14.1). It is logical to use id "vc15" for VS 2017, but binaries will be installed to sub-folder "vc14". This can be confusing and we need to think how to avoid this confusion.

2. Visual Studio does not define any more environment varuiable VS1xxCOMNTOOLS

That variable has been used by OCCT old build system (genproj etc.) to detect presence and location of Visual Studio. This is not working any more.

Now the recommended way is to use separate executable, vswhere.exe, which is open source (MIT license) and distributed through GitHub. Since VS 2017.2 it is promised to be installed in dedicated folder (see https://github.com/Microsoft/vswhere/wiki) but until this happened, we would need to store vswhere.exe in OCCT Git...

Steps to reproduce

Fix pushed to CR28701, please review

Public activity

19 archived notes

Participants are labeled by their role within this record.

01Commenter 3
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue May 2 08:36:49 2017 +0300

    0028701: Configuration - add support of VS 2017
    
    Added support of Visual Studio 2017 (15) in CMake build procedure.
    CMake 3.7.2 or above is required to generate projects for VS 2017.
    
    Since version of compiler and toolset remained at 14 (now they are 14.1), and they use the same run-time, the same third-party products as for VS 2015 (14) can be used.
    Also the name of the folder for installation of OCCT binaries in OCCT-standard layout (default on Windows) remains "vc14".
02Commenter 4
Compiling with VS 2017 works with the patch.

Just the dversion Draw command says it is VC 13.1. So, this would have to be fixed.
03Commenter 3
Hello Commenter 4, thank you for fast feedback!

In master the dversion command should report 14.1 correctly: this has been fixed by patch for #0028095, just before release of OCCT 7.1.0. I guess you are not on master and not even on OCCT 7.1, thus do not have that change. Can you please confirm that?
04Commenter 4
Yes, I am on OCCT 7.0.
05Commenter 3
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon May 15 18:18:39 2017 +0300

    0028701: Configuration - add support of VS 2017
    
    Support of Visual Studio 2017 is added in genproj generator and relevant environment, with format specifier "vc141".
    
    The syntax of the genproj command is revised:
    - UWP is considered as separate platform ("uwp" alternative to "wnt"), not part of IDE specification
    - Option "IDE" is renamed to "Format"
    - Obsolete name of local variable "aWokStation" is replaced by equivalent "theFormat"
    
    In environment scripts, additional variables are defined (derived from VCVER, see adm/vcver.bat):
    - VCLIB defines name of the subdirectory specific to VS version; it is the same as VCVER except that for VCVER=vc141 VCLIB=vc14 and for VCVER=141-uwp VCLIB=vc14-uwp
    - VCFMT is VCVER without optional suffix "-uwp"
    - VCPROP is "NativeDesktop" for normal builds or "Universal" for UWP builds
    
    Command genconf is amended to:
    - Detect presence of VS 2017 (separately for desktop and UWP)
    - Use only two first digits after "vc" in format specification for search of third-party libs
    - Have more space in user interface for VS specification
    
    Compiler warnings specific to VS 2017 are eliminated.
    
    All supported variants of VCVER variable are documented in dev guides / buiding / msvc

06Commenter 3
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue May 2 08:36:49 2017 +0300

    0028701: Configuration - add support of VS 2017
    
    Added support of Visual Studio 2017 (15) in CMake build procedure.
    CMake 3.7.2 or above is required to generate projects for VS 2017.
    
    Since version of compiler and toolset remained at 14 (now they are 14.1), and they use the same run-time, the same third-party products as for VS 2015 (14) can be used.
    Also the name of the folder for installation of OCCT binaries in OCCT-standard layout (default on Windows) remains "vc14".
    
    Support of Visual Studio 2017 is added in genproj generator and relevant environment, with format specifier "vc141".
    
    The syntax of the genproj command is revised:
    - UWP is considered as separate platform ("uwp" alternative to "wnt"), not part of IDE specification
    - Option "IDE" is renamed to "Format"
    - Obsolete name of local variable "aWokStation" is replaced by equivalent "theFormat"
    
    In environment scripts, additional variables are defined (derived from VCVER, see adm/vcver.bat):
    - VCLIB defines name of the subdirectory specific to VS version; it is the same as VCVER except that for VCVER=vc141 VCLIB=vc14 and for VCVER=141-uwp VCLIB=vc14-uwp
    - VCFMT is VCVER without optional suffix "-uwp"
    - VCPROP is "NativeDesktop" for normal builds or "Universal" for UWP builds
    
    Command genconf is amended to:
    - Detect presence of VS 2017 (separately for desktop and UWP)
    - Use only two first digits after "vc" in format specification for search of third-party libs
    - Have more space in user interface for VS specification
    
    Compiler warnings specific to VS 2017 are eliminated.
    
    All supported variants of VCVER variable are documented in dev guides / buiding / msvc
07Commenter 5
Please test the patch, including project generation by genproj.
08Commenter 1
09Commenter 3
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu May 18 08:12:07 2017 +0300

    // added missing file

10Commenter 3
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
11Commenter 3
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
12Commenter 12
Corrections are pushed to CR28701_1, please check
13Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
14Commenter 3
Branch [archived branch] has been created by Commenter 5.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu May 18 08:12:07 2017 +0300

    // added missing file, minor corrections

Author: Author
Date: Tue May 2 08:36:49 2017 +0300

    0028701: Configuration - add support of VS 2017
    
    Added support of Visual Studio 2017 (15) in CMake build procedure.
    CMake 3.7.2 or above is required to generate projects for VS 2017.
    
    Since version of compiler and toolset remained at 14 (now they are 14.1), and they use the same run-time, the same third-party products as for VS 2015 (14) can be used.
    Also the name of the folder for installation of OCCT binaries in OCCT-standard layout (default on Windows) remains "vc14".
    
    Support of Visual Studio 2017 is added in genproj generator and relevant environment, with format specifier "vc141".
    
    The syntax of the genproj command is revised:
    - UWP is considered as separate platform ("uwp" alternative to "wnt"), not part of IDE specification
    - Option "IDE" is renamed to "Format"
    - Obsolete name of local variable "aWokStation" is replaced by equivalent "theFormat"
    
    In environment scripts, additional variables are defined (derived from VCVER, see adm/vcver.bat):
    - VCLIB defines name of the subdirectory specific to VS version; it is the same as VCVER except that for VCVER=vc141 VCLIB=vc14 and for VCVER=141-uwp VCLIB=vc14-uwp
    - VCFMT is VCVER without optional suffix "-uwp"
    - VCPROP is "NativeDesktop" for normal builds or "Universal" for UWP builds
    
    Command genconf is amended to:
    - Detect presence of VS 2017 (separately for desktop and UWP)
    - Use only two first digits after "vc" in format specification for search of third-party libs
    - Have more space in user interface for VS specification
    
    Compiler warnings specific to VS 2017 are eliminated.
    
    All supported variants of VCVER variable are documented in dev guides / buiding / msvc
    
    # Conflicts:
    # adm/genproj.tcl
    # src/ViewerTest/ViewerTest.cxx
15Commenter 3
Branch [archived branch] has been created by Commenter 5.

[revision removed]


No new revisions were added by this update.
16Commenter 3
Branch [archived branch] has been deleted by Commenter 5.

[revision removed]
17Commenter 3
Branch [archived branch] has been deleted by Commenter 5.

[revision removed]
18Commenter 3
Branch [archived branch] has been deleted by Commenter 5.

[revision removed]
19Commenter 3
Branch [archived branch] has been deleted by Commenter 5.

[revision removed]

Related records