My IDE doesn't update the CMakeLists.txt (Ubuntu)

Hi everybody,

My project works perfectly in Mac with Xcode, but now I need to compile and run the project on Ubuntu and I can not do it.

I try with some IDE’s, like NetBeans, Eclipse, CodeBlocks, VisualStudio, etc.

My problem is that my IDE does not update the CMakeLists.txt file, well, I suppose is this.
Because I create a new project and cocos generates the AppDelegate and HelloWorldSample files.
But when I add new classes (.h and .cpp), the IDE does not update that file in the part:
Set (GAME_SRC …) and set (GAME_HEADERS …)

So, how can I work on my classes without wanting to worry about that file.

Thanks.

Hi i have the same problem, did you resole it ?

I don’t have this trouble with code::blocks.

The CMakeLists.txt file isn’t supposed to be updated automatically, especially not the GAME_SRC and GAME_HEADERS section, and if they are supposed to (or there is a way to do it), then that’s news to me.

You should be updating the CMakeLists.txt any time you add a new source files to your project.

Well yeah you manually update it but I read this like it isn’t staying updated after they change it. Hmm maybe I read this wrong.

masterojitos mentioned using several IDEs, and adding a source file through the UI doesn’t update CMakeLists.txt. That is the correct behavior, since those IDEs have their own project file format, so the project file is updated, but that won’t change anything in the CMakeLists.txt.

So, for @masterojitos and @jeanporcher you will need to just add the references to the source files manually in CMakeLists.txt, which is not something you would be doing often anyway. From that point on you can generate the relevant project file for VS/XCode/Android without having to do any extra work. While it may seem like it’s an inconvenience, it really isn’t that bad, and it eventually becomes part of your workflow; it quite literally takes a few seconds to add a new entry.