I don't consider myself new to CMake, but I cannot get it working on a newer Windows machine I've acquired. The only generator that works for me is an actual visual studio project generator (e.g. "Visual Studio 14 2015 Win64"). I've tried a couple of recent versions of CMake (3.12.2, 3.10.3) and always get the below when I try another generator (NMake Makefiles JOM, NMake Makefiles, CodeBlocks - NMake Makefiles, etc). I should add that I'm running this command-line in a VS2015 x64 Native Tools Command Prompt window opened as Administrator.
D:\Projects\build-QWar-newest>cmake -G "NMake Makefiles JOM" ../QWar
Error log:
Determining if the C compiler works failed with the following output:
Change Dir: D:/Projects/build-QWar-newest/CMakeFiles/CMakeTmp
Run Build Command:"jom" "/NOLOGO" "cmTC_8b88c\fast"
jom: parallel job execution disabled for Makefile
C:\Qt\Tools\QtCreator\bin\jom.exe -f CMakeFiles\cmTC_8b88c.dir\build.make /nologo -L CMakeFiles\cmTC_8b88c.dir\build
Building C object CMakeFiles/cmTC_8b88c.dir/testCCompiler.c.obj
C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe @C:\Users\Rich\AppData\Local\Temp\testCCompiler.c.obj.19968.0.jom
testCCompiler.c
Linking C executable cmTC_8b88c.exe
"C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_8b88c.dir --manifests -- C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\link.exe /nologo @CMakeFiles\cmTC_8b88c.dir\objects1.rsp @C:\Users\Rich\AppData\Local\Temp\cmTC_8b88c.exe.19968.375.jom
MT: command "mt /nologo /manifest CMakeFiles\cmTC_8b88c.dir/intermediate.manifest /out:CMakeFiles\cmTC_8b88c.dir/embed.manifest /notify_update" failed (exit code 0x0) with the following output:
The system cannot find the file specifiedjom: D:\Projects\build-QWar-newest\CMakeFiles\CMakeTmp\CMakeFiles\cmTC_8b88c.dir\build.make [cmTC_8b88c.exe] Error 2
jom: D:\Projects\build-QWar-newest\CMakeFiles\CMakeTmp\Makefile [cmTC_8b88c\fast] Error 2
This is a simple project - here's the CMakeLists.txt from D:\Projects\QWar:
cmake_minimum_required(VERSION 3.0)
project(QWar)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Core CONFIG REQUIRED)
add_executable(${PROJECT_NAME}
main.cpp
Card.cpp
Deck.cpp
Player.cpp
Round.cpp
Game.cpp)
target_link_libraries(${PROJECT_NAME} Qt5::Core)
EDIT: reformatting error log
I'm not sure what I'm doing wrong. I've gotten this to work with older versions of CMake, in fact I have another machine with Qt5.7/CMake3.6.1 and what I try above works.