The CMakeLists.txt overwrites the CMAKE_CXX_FLAGS_xxx (line 174) when using Intel on MSVC. As a result, the Debug configuration will be using /MD instead of /MDd and cause linking errors with binaries compiled with /MDd.
These two solutions will work:
- append instead of overwrite the flags (e.g set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG -g")
- put these four set(CMAKE_CXX_FLAGS_xxxx ....) lines inside an if(NOT WIN32) block.
The CMakeLists.txt overwrites the CMAKE_CXX_FLAGS_xxx (line 174) when using Intel on MSVC. As a result, the Debug configuration will be using /MD instead of /MDd and cause linking errors with binaries compiled with /MDd.
These two solutions will work: