MantisBT - Open CASCADE
View Issue Details
0028701Open CASCADE[OCCT] OCCT:Configurationpublic2017-04-30 08:472019-10-02 17:53
abv 
bugmaster 
normalminor 
closedfixed 
 
[OCCT] 7.2.0[OCCT] 7.2.0 
Not required
0028701: Configuration - add support of VS 2017
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...
Fix pushed to CR28701, please review
No tags attached.
parent of 0028769closed bugmaster Open CASCADE Unification of msvc.bat files. 
parent of 0029852closed nenadus Community VS2017: install binaries to vc141 folder instead of vc14 
related to 0030938closed bugmaster Open CASCADE Configuration, genproj - Support building with VS 2019 
Issue History
2017-04-30 08:47abvNew Issue
2017-04-30 08:47abvAssigned To => bugmaster
2017-05-01 22:17abvDescription Updatedbug_revision_view_page.php?rev_id=16508#r16508
2017-05-02 08:37gitNote Added: 0065661
2017-05-02 14:30TimoNote Added: 0065676
2017-05-02 15:39abvNote Added: 0065680
2017-05-02 16:37TimoNote Added: 0065681
2017-05-15 20:39gitNote Added: 0066113
2017-05-15 20:57abvAssigned Tobugmaster => kgv
2017-05-15 20:57abvStatusnew => resolved
2017-05-15 20:57abvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16622#r16622
2017-05-15 21:09gitNote Added: 0066114
2017-05-15 21:10kgvNote Added: 0066115
2017-05-15 21:10kgvAssigned Tokgv => bugmaster
2017-05-15 21:10kgvStatusresolved => reviewed
2017-05-17 14:33bugmasterNote Added: 0066199
2017-05-17 14:33bugmasterAssigned Tobugmaster => abv
2017-05-17 14:33bugmasterStatusreviewed => feedback
2017-05-18 08:12gitNote Added: 0066233
2017-05-18 08:47gitNote Added: 0066234
2017-05-18 15:57gitNote Added: 0066282
2017-05-18 15:57abvNote Added: 0066283
2017-05-18 15:57abvAssigned Toabv => bugmaster
2017-05-18 15:57abvStatusfeedback => reviewed
2017-05-19 13:43gitNote Added: 0066316
2017-05-22 15:28bugmasterRelationship addedparent of 0028769
2017-05-23 17:14gitNote Added: 0066487
2017-05-23 17:16gitNote Added: 0066489
2017-05-23 17:16gitNote Added: 0066490
2017-07-14 13:55bugmasterChangeset attached => occt master d6cda17a
2017-07-14 13:55bugmasterStatusreviewed => verified
2017-07-14 13:55bugmasterResolutionopen => fixed
2017-07-17 10:05gitNote Added: 0068332
2017-07-17 10:05gitNote Added: 0068333
2017-07-24 12:43apnRelationship addedparent of 0028941
2017-08-18 13:11bugmasterTest case number => Not required
2017-09-29 16:17aivFixed in Version => 7.2.0
2017-09-29 16:29aivStatusverified => closed
2018-07-02 11:42kgvRelationship addedparent of 0029920
2018-07-17 08:02kgvRelationship addedrelated to 0029852
2018-07-17 08:02kgvRelationship replacedparent of 0029852
2019-09-04 09:45kgvRelationship addedrelated to 0030938
2019-10-02 17:53gitNote Added: 0087706

Notes
(0065661)
git   
2017-05-02 08:37   
Branch CR28701 has been created by abv.

SHA-1: d1500f6aba43d59ed175e6c773b3f43fd7e52cb1


Detailed log of new commits:

Author: abv
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".
(0065676)
Timo   
2017-05-02 14:30   
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.
(0065680)
abv   
2017-05-02 15:39   
Hello Timo, 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?
(0065681)
Timo   
2017-05-02 16:37   
Yes, I am on OCCT 7.0.
(0066113)
git   
2017-05-15 20:39   
Branch CR28701 has been updated by abv.

SHA-1: 7a958f816a7ae1268ad8cbe1c59ad4114da75a6e


Detailed log of new commits:

Author: abv
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

(0066114)
git   
2017-05-15 21:09   
Branch CR28701_1 has been created by abv.

SHA-1: c951187c5a9a977f5618549a0f5104748b63e150


Detailed log of new commits:

Author: abv
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
(0066115)
kgv   
2017-05-15 21:10   
Please test the patch, including project generation by genproj.
(0066199)
bugmaster   
2017-05-17 14:33   
Compilation by cmake:
http://jenkins-test-08.nnov.opencascade.com/view/CR28701_1_master/view/OCCT%20compile/ [^]

All are OK except one warning on Visual Studio:
http://jenkins-test-08.nnov.opencascade.com/view/CR28701_1_master/view/OCCT%20compile/job/CR28701_1_master-OCCT-Windows-32-VC14-opt-compile/2/warningsResult/ [^]

Compilation by genproj:

File vcver absent in the folder adm
(0066233)
git   
2017-05-18 08:12   
Branch CR28701_1 has been updated by abv.

SHA-1: f8e827f8b6aa76316b0390ecc795a177d5d8facb


Detailed log of new commits:

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

    // added missing file

(0066234)
git   
2017-05-18 08:47   
Branch CR28701_1 has been updated forcibly by abv.

SHA-1: be55f0436f58448a9b7828be49c46e7a3eaf736b
(0066282)
git   
2017-05-18 15:57   
Branch CR28701_1 has been updated forcibly by abv.

SHA-1: aab01f275cdcc324dd19914bd145c49d304b6c72
(0066283)
abv   
2017-05-18 15:57   
Corrections are pushed to CR28701_1, please check
(0066316)
git   
2017-05-19 13:43   
Branch CR28701_1 has been updated forcibly by inv.

SHA-1: fcc70f55a888515004988f0446e82b51cefed524
(0066487)
git   
2017-05-23 17:14   
Branch CR28701_710 has been created by kgv.

SHA-1: 27c27aff93799a79851b2c60024418cc274e03b8


Detailed log of new commits:

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

    // added missing file, minor corrections

Author: abv
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
(0066489)
git   
2017-05-23 17:16   
Branch CR28701_OCCT710 has been created by kgv.

SHA-1: 27c27aff93799a79851b2c60024418cc274e03b8


No new revisions were added by this update.
(0066490)
git   
2017-05-23 17:16   
Branch CR28701_710 has been deleted by kgv.

SHA-1: 27c27aff93799a79851b2c60024418cc274e03b8
(0068332)
git   
2017-07-17 10:05   
Branch CR28701 has been deleted by kgv.

SHA-1: 7a958f816a7ae1268ad8cbe1c59ad4114da75a6e
(0068333)
git   
2017-07-17 10:05   
Branch CR28701_1 has been deleted by kgv.

SHA-1: fcc70f55a888515004988f0446e82b51cefed524
(0087706)
git   
2019-10-02 17:53   
Branch CR28701_OCCT710 has been deleted by kgv.

SHA-1: 27c27aff93799a79851b2c60024418cc274e03b8