At work we developed a project under Linux with the cmake build tool and gcc. This project does not use Qt, but I wanted to use Qtcreator as IDE when trying to port the project to Windows.

When trying to compile after solving the dependencis issues, I got

Qt Code:
  1. Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
  2. Copyright (C) Microsoft Corporation. Tous droits réservés.
  3.  
  4. [ 2%] Building CXX object src/common/Data/CMakeFiles/commondata.dir/DataTypes.cpp.obj
  5. clÿ: Ligne de commande error D8004ÿ: '/W' n‚cessite un argument
  6. NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~2.0\VC\bin\cl.exe' : code retour '0x2'
  7. Stop.
  8. NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : code retour '0x2'
  9. Stop.
  10. NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : code retour '0x2'
  11. Stop.
  12. Le processus "C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" s'est terminé avec le code 2.
  13. Erreur à la compilation du projet mmcommon (cible : Desktop)
  14. Lors de l'exécution de l'étape "Make"
To copy to clipboard, switch view to plain text mode 

I searched a lot a lot a lot with no luck. Finall, I found that we forced to use the "-W" switch under Linux to force gcc warning. It was considered also as a switch under Windows by error (while it was -W and not /W).

The bad content of the CMakeLists.txt was:

Qt Code:
  1. set(CMAKE_CXX_FLAGS "-W -Wall")
To copy to clipboard, switch view to plain text mode 

Hope this can help future people having to port cmake based projects to windows...