Reputation: 1277
My CMakeLists.txt looks like following (I don't think the content of CMakeLists.txt is important since the code compiles well with CLion on Linux, but including the details should not do any harm):
cmake_minimum_required(VERSION 3.12)
project(ambulance)
set(CMAKE_CXX_STANDARD 14)
if (UNIX)
set(CMAKE_CXX_FLAGS " -pthread ")
include_directories(ambulance builder control include include/unix io main model view)
add_executable(ambulance
control/Ambulance.cpp
control/Ambulance.h
main/main.cpp
view/AmbulanceUI.cpp
view/AmbulanceUI.h
model/Doctor.cpp
model/Doctor.h
model/Patient.cpp
model/Patient.h
control/PatientAdmin.cpp
control/PatientAdmin.h
model/Person.cpp
model/Person.h
control/DoctorAdmin.cpp
control/DoctorAdmin.h
model/Treatment.cpp
model/Treatment.h
io/PeopleIO.h
io/AmbulancePersistence.cpp
io/AmbulancePersistence.h
io/AmbulancePeopleIOElement.cpp
io/AmbulancePeopleIOElement.h
builder/PatientBuilder.cpp
builder/PatientBuilder.h
builder/DoctorBuilder.cpp
builder/DoctorBuilder.h
builder/PersonBuilder.cpp
builder/PersonBuilder.h
include/json_macro.h
include/system_macro.h
control/ScheduleAdmin.cpp
control/ScheduleAdmin.h
model/ScheduleElement.cpp
model/ScheduleElement.h
model/DailySchedule.cpp
model/DailySchedule.h
include/unix/Logger.h
include/unix/Logger.cpp
include/json.hpp
logger/Logger.h
logger/Logger.cpp)
else ()
include_directories(ambulance builder control include include/win io main model view)
add_executable(ambulance
include/json.hpp
control/Ambulance.cpp
control/Ambulance.h
main/main.cpp
view/AmbulanceUI.cpp
view/AmbulanceUI.h
model/Doctor.cpp
model/Doctor.h
model/Patient.cpp
model/Patient.h
control/PatientAdmin.cpp
control/PatientAdmin.h
model/Person.cpp
model/Person.h
control/DoctorAdmin.cpp
control/DoctorAdmin.h
model/Treatment.cpp
model/Treatment.h
io/PeopleIO.h
io/AmbulancePersistence.cpp
io/AmbulancePersistence.h
io/AmbulancePeopleIOElement.cpp
io/AmbulancePeopleIOElement.h
builder/PatientBuilder.cpp
builder/PatientBuilder.h
builder/DoctorBuilder.cpp
builder/DoctorBuilder.h
builder/PersonBuilder.cpp
builder/PersonBuilder.h
include/json_macro.h
include/system_macro.h
include/win/Logger.h
include/win/Logger.cpp
control/ScheduleAdmin.cpp
control/ScheduleAdmin.h
model/ScheduleElement.cpp
model/ScheduleElement.h
model/DailySchedule.cpp
model/DailySchedule.h
logger/Logger.cpp
logger/Logger.h)
endif (UNIX)
And here is the content of CMakeSettings.txt
{
"configurations": [
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [
"msvc_x64_x64"
],
"buildRoot": "${env.USERPROFILE}\CMakeBuilds\${workspaceHash}\build\${name}",
"installRoot": "${env.USERPROFILE}\CMakeBuilds\${workspaceHash}\install\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}
]
}
I made the code primarily on Linux and compile in a virtual Windows 10 machine with Visual Studio Enterprise. The building was still successful yesterday, but since today every time I try to compile it, I have a endless loop that says:
[0/1] "...cmake.exe" ".../x64-Release" -- Configuring done -- Generating done -- Build files have been written to: ...
Finally the error Description says:
manifest 'build.ninja' still dirty after 100 tries
What could be a solution to this? Must I reinstall visual studio (What is incredible uncomfortable since my virtual machine is incredible slow).
Thank you
Upvotes: 3
Views: 5959
Reputation: 6093
I ran into exactly the same issue. In my case, running a tool that recursively sets all file timestamps on the source folder (source, not build folder) helped. I assume some tool updated one of the source files to a time in the future and that made cmake think it has to regenerate because the source file is newer than the build file. Maybe this helps you as well?
This is the tool I used: http://web.archive.org/web/20101226014112/www.touchdotexe.com/
Just use it on the command line:
touch.exe -R C:/my/source/folder
Upvotes: 3