Install CGAL and Demos in win10+msvc2017x64
Published:
To install cgal in the win10 with vs2017x64, you have to install several Dependency Libraries at first.
Package & verison
cgal 4.13
cmake 3.14
qt 5.12.3
boost 1.70.0
Steps
1. Qt
First of all, download the qt5 in the latest version and i choosed 5.12.3.Then install as following steps.Just make sure you have clicked msvc2017x64 and scriptsTool in install components options. Add C:\Qt\Qt5.12.3\5.12.3\msvc2017_64\bin to system path.
2. CMake
Install cmake in the latest version and i choosed 3.14. Someone said need add the cmake modules paths to the system. I haven’t added and it still worked.
3. Boost
Boost library has open resource in
http://www.boost.org/users/download/
and you can compile it to get the binary libaraies in you pc. For convenience, i downloaded the Boost(1.70.0) binary libraries in https://sourceforge.net/projects/boost/files/boost-binaries/
Unzip the Boost to any path, then add path/to/boost/lib64-msvc-14.1 to system Path. Add BOOST_INCLUDEDIR as path/to/Boost (mine is C:\local\boost_1_70_0) in your system path, Add BOOST_LIBRARYDIR as path/to/Boost library (mine is C:\local\boost_1_70_0\lib64-msvc-14.1) in your system path.
4. Install CGAL
- If none of the above steps goes wrong, you can begin to install CGAL libraries.Download the CGAL and unzip to your pc.Please remember the path to it cause we will use it later. Add CGAL_DIR as path/to/CGAL (mine is C:\dev\CGAL-4.13.1) and C:\dev\CGAL-4.13.1\auxiliary\gmp\lib in system path.
- Open CmakeGUI which you installed in step2, set the source code dir to path/to/CGAL (mine is C:/dev/CGAL-4.13.1), build the binaries dir to path wherever you like.(mine is C:\dev\CGAL-4.13.1\build).Then click the configure button and choose vs2017 win64. If there is no errors shown in screen, click build button.
- Open the .sln file with vs2017 64 in your build path you set in CmakeGUI, and build all projects both in debug and release mode.
Congratulations, you are finished to build the CGAL binary libraries in the path/to/build/bin. For convenience, you should add this path to system path to use the CGAL in projects you like.
Install CGAL demos and examples
For now, you maybe wanna build the CGAL demos and examples to learn how to use CGAL libraries.It still need additional several Dependency Libraries. I just had installed Eigen3, TBB, Metis to build Polyhedron demo. Maybe you want to install all Dependency Libraries and I admire your courage and endurance. The instructions are similar as belows.
1. Eigen3
Download the Eigen3 library and unzip in anywhere you like.Set EIGEN3_DIR as path/to/Eigen3 (mine D:\Env\eigen3) in system path.
2. TBB
Download TBB and unzip in anywhere you like.Add path/to/tbb/bin/intel64/vc14 (D:\Env\tbb2019\bin\intel64\vc14),add TBB_ARCH_PLATFORM as intel64\vc14 and TBBROOT as path/to/tbb (D:\Env\tbb2019) to system path. Notes: No matter what your computer CPU is Intel or AMD, it all worked. Besides, AMD YES!
3. Metis
Download Metis and unzip in D:\Env\metis-5.1.0. Using CmakeGUI to build the Metis binary files in D:\Env\metis-5.1.0\build.
I found the module which set to find the Metis libraries have many mistakes in 4.13.1 version. So I rewrited it as simple as possible in C:\dev\CGAL-4.13.1\cmake\modules\FindMETIS.cmake. You can download new FindMETIS.cmake to replace the old version.Then add METIS_INCLUDE_DIR as D:\Env\metis-5.1.0\include and “METIS_LIBRARY_DIR” as D:\Env\metis-5.1.0\build\libmetis\Release to system path.
If you have any question or problem in above steps, you can make comment on my website. I will check it sometimes and reply.