Remembering Cmake syntax, including generating project files for the Eclipse IDE

c-plus-plus cmake

I always forget the cmake syntax if it is anything below cmake ../src. Here are some common combinations, I usually create an Eclipse project with cmake and then import to the Eclipse IDE.

  • cmake ../src (basic)
  • cmake -DCMAKE_BUILD_TYPE=Release ../src (Release configuration)
  • cmake -DCMAKE_BUILD_TYPE=Debug ../src (Debug configuration)
  • cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE ../src/ (Create an Eclipse project to import – it will be in the build folder)

© Amy Tabb 2018 - 2023. All rights reserved. The contents of this site reflect my personal perspectives and not those of any other entity.