cmake_minimum_required(VERSION 3.0) set(CMAKE_Fortran_COMPILER C:/mingw-64/mingw64/bin/gfortran.exe) project(SNOPT Fortran CXX) include(CMakeAddFortranSubdirectory) set(CMAKE_GNUtoMS ON) cmake_add_fortran_subdirectory(src PROJECT SNOPT_CORE ARCHIVE_DIR src RUNTIME_DIR src LIBRARIES snopt NO_EXTERNAL_INSTALL) #replace this with any valid subproject; I can compile the Fortran code alone in minGW, but I can't fold in the C++ interface I want without additional code. For now, I've isolated out anything actually related to two languages to just get Visual Studio to play nice with minGW. #include_directories(interfaces/include) #add_library(snopt_cpp interfaces/src/snoptProblem.cpp) #target_link_libraries(snopt_cpp snopt)