Author Topic: Opening a CB project made from CMake  (Read 5235 times)

Offline SuperBoi45

  • Multiple posting newcomer
  • *
  • Posts: 14
Opening a CB project made from CMake
« on: September 15, 2014, 10:55:02 pm »
I got CMake to generate Codeblock Makefiles. With the IDE, I opened up the project CMake provided. Now how do I start making my own program with it? I created a main.cpp file and added it to the project. I put in inside src\SFML\Main\ (which is part of the directory structure CMake provided).

The problem I am facing is that when I press F9 (to build and run) the project simply builds but it never runs (or at least I can't tell that it does so). The console window doesn't appear even when I go into Project->Properties... and select "Console Project" as the type. And even when I select the checkbox to pause the screen it still doesn't work.

This is the first time I'm using SFML to build my project. All I want to do now is create a program now that I can compile, but it's not compiling anything at all. In fact, it's not even looking at my main.cpp file at all (I can put nonsense inside the file, no errors).

Maybe I put main.cpp in the wrong place?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Opening a CB project made from CMake
« Reply #1 on: September 15, 2014, 11:01:31 pm »
Did you edit the makefile?
Note: I am guessing that CMake made a CB "custom makefile" project instead of a standard CB Project.

I am also guessing the makefile needs edited.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline SuperBoi45

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Opening a CB project made from CMake
« Reply #2 on: September 15, 2014, 11:06:21 pm »
Did you edit the makefile?
Note: I am guessing that CMake made a CB "custom makefile" project instead of a standard CB Project.

I am also guessing the makefile needs edited.

Tim S.

I didn't touch the Makefile and yes I told CMake to generate Codeblocks MakeFiles and make a project from that. And how can the Makefile be edited?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Opening a CB project made from CMake
« Reply #3 on: September 16, 2014, 12:37:16 am »
And how can the Makefile be edited?

You can use any good text editor to edit a Makefile.
Code::Blocks should be able to edit a makefile; I have never used CB to edit a makefile, myself.

FYI: What to edit in a makefile is likely off topic for this website.

I suggest using standard CB project inside CB.

If you wish to use CMake generated CB custom makefiles you are NOT going to get much help on this site figuring out how to edit the makefile.

Note, to run the exe once you get it made; you might wish to try using the CB Tools or Toolplus Plugin.

If there a reason you are NOT using a standard CB project?

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline SuperBoi45

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Opening a CB project made from CMake
« Reply #4 on: September 16, 2014, 02:27:48 am »
And how can the Makefile be edited?

You can use any good text editor to edit a Makefile.
Code::Blocks should be able to edit a makefile; I have never used CB to edit a makefile, myself.

FYI: What to edit in a makefile is likely off topic for this website.

I suggest using standard CB project inside CB.

If you wish to use CMake generated CB custom makefiles you are NOT going to get much help on this site figuring out how to edit the makefile.

Note, to run the exe once you get it made; you might wish to try using the CB Tools or Toolplus Plugin.

If there a reason you are NOT using a standard CB project?

Tim S.



I'm new to this so I'm just trying to use CMake for SFML development. I'm following a tutorial that tells us how to set up CMake with SFML and it told us to chose the makefile generator that was for your IDE. My IDE is Codeblocks I simply chose CodeBlocks Makefiles from the list.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Opening a CB project made from CMake
« Reply #5 on: September 16, 2014, 06:23:26 am »
If you edit the makefile it will be overriden by cmake the next time you (re-)generate it as far as I know.

I think you have to change the cmake configuartion for the project, but to do this, you should read the cmake-documentation and/or ask on a cmake-related website how to do it.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Opening a CB project made from CMake
« Reply #6 on: September 17, 2014, 06:15:44 am »
If you edit the makefile it will be overriden by cmake the next time you (re-)generate it as far as I know.

I think you have to change the cmake configuartion for the project, but to do this, you should read the cmake-documentation and/or ask on a cmake-related website how to do it.

Why do you post the (nearly) same stuff twice ?
Why do aou not follow my advice ?
Was it no clear enough ?

Why do you break the forum rules ?
You have accepted to follow these rules when registering here !

For the record:
I deleted your other post.
« Last Edit: September 17, 2014, 06:17:55 am by jens »

Offline SuperBoi45

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Opening a CB project made from CMake
« Reply #7 on: October 03, 2014, 04:04:26 am »
Sorry I took so long to reply!

No your answer wasn't unclear. I understand what to do now. Thanks for your help. :)