I get MathGL to be build via cmake-gui but I have issues from the command line. Here is what I'm doing:
1. open command line with Visual Studio x64 tools loaded
2. remove CMakeFiles folder in my mathgl folder
3. Run the following command line
cmake "-DZLIB_INCLUDE_DIR=c:\users\chenning\projects\zlib-1.2.8\" "-DZLIB_LIBRARY=c:\users\chenning\projects\zlib-1.2.8\zlib.lib" "-DPNG_PNG_INCLUDE_DIR=C:\Users\chenning\projects\lpng1620\" "-DPNG_LIBRARY_DEBUG=C:\Users\chenning\projects\lpng1620\projects\vstudio\x64\Debug\libpng16.lib" "-DPNG_LIBRARY_Release=C:\Users\chenning\projects\lpng1620\projects\vstudio\x64\Release\libpng16.lib" .
-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working C compiler using: Visual Studio 12 2013
-- Check for working C compiler using: Visual Studio 12 2013 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 12 2013
-- Check for working CXX compiler using: Visual Studio 12 2013 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY)
CMake Error at CMakeLists.txt:328 (message):
Couldn't find ZLib library.
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY)
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
CMake Error at CMakeLists.txt:341 (message):
Couldn't find PNG library.
CMake Error: The following variables are used in this project, but they are set
to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake file
s:
ZLIB_LIBRARY (ADVANCED)
linked by target "mgl" in directory C:/Users/chenning/projects/mathgl-2.3.3/
src
-- Configuring incomplete, errors occurred!
See also "C:/Users/chenning/projects/mathgl-2.3.3/CMakeFiles/CMakeOutput.log".
I have double checked the path and made sure all files exist.