msvc.bat is not necessary

Hello

Launching Visual Studio via msvc.bat looks outdated. I always forget to do it and I need to find our each time what are the parameters. We do not use it.

Have a look at
http://dynoinsight.com/Prod/Examples/opencascade-7.5.0.zip
(there are only solution and project files)

We are using OCCTDef.vcxproj (open in any text editor) to define all CSF_ variables in one place. Each .vcxproj has line
...Import Project="OCCTDef.vcxproj...
which refers to it. This again is not visible in VS and has to be added directly.

This way the OCCT.sln can be opened directly and built right away. Notice we have moved the solution up where msvc.bat normally is.

We have also merged 32 bit into this single OCCT.sln, so, as normally a VS developer expects, just change the configuration.

I suggest making it official in Windows OCCT installer. It would save us and many others time on upgrading.

We also do some other replacements specific to our software. In Visual Studio's Find and replace dialogue we replace in adm\msvc\vc142\*.vcxproj :

.\..\..\..\win64\vc14\bind\
with
.\..\..\..\..\..\..\Bin\x64\Debug\

.\..\..\..\win64\vc14\bind\
with
$(OutDir)

This is to build the binaries where they are needed to avoid copying and any issues with debug info location, etc.
Inserting OCCTDef.vcxproj references can be done this way in a minute as well.

Andrey BETENEV's picture

Hello,

The modern and recommended tool for configuring and building OCCT is CMake. Have you considered using it?

genproj.bat and msvc.bat are the (remaining) part of a legacy build system of OCCT. It is kept and maintained for use by people and projects which are historically bound to this approach. Hence, changing this approach is not desirable - that would break compatibility with previously used environments and habits, but unlikely make it any better than CMake.

Andrey

Dzmitry Razmyslovich's picture

Hello, NickZ,

As Andrey has mentioned, CMake can solve all your problems. We successfully use CMake build system since 7.1.0 version and are able to upgrade without no issues, being able to build OCC libraries for different operating systems, compilers and bitness without a single change.

I would also definitely recommend you to use CMake.

Regards,
Dima

Nikolai Zubchenko's picture

Thank you, guys.
I do not need anything. I thought this might be useful for people like me who do not want to learn CMake. It looks like shallow functionality. On Windows everything can be done in VS.