Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: CMake support added  (Read 18602 times)

0 Members and 1 Guest are viewing this topic.

Mr. X

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
CMake support added
« Reply #15 on: August 24, 2010, 12:42:21 pm »
Quote
This has actually nothing to do with CMake in the first place. I'm sorry that I brought this to a public table.


I do not think that you brought this to a public table...


But you are right, that discussion has nothing to do with CMake.

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
CMake support added
« Reply #16 on: August 24, 2010, 04:23:36 pm »
was just, curious, when CMake generates a vs2010 project file, the build options are, Release, Debug, MinSizeRel, and RelWithDebInfo,

does any of these produce static version of the lib?
John Carmack can Divide by zer0.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CMake support added
« Reply #17 on: August 24, 2010, 05:11:07 pm »
To get a static version of the libraries, you must set BUILD_SHARED_LIBS to FALSE.
Laurent Gomila - SFML developer

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
CMake support added
« Reply #18 on: August 24, 2010, 07:00:07 pm »
I'd prefer an option to build both a static and a dynamic library at the same time.

See here: http://www.itk.org/Wiki/CMake_FAQ#Can_I_build_both_shared_and_static_libraries_with_one_ADD_LIBRARY_command.3F

EDIT: So basically I want BUILD_STATIC as an optional flag for building static libs.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CMake support added
« Reply #19 on: August 24, 2010, 11:13:08 pm »
Quote
I'd prefer an option to build both a static and a dynamic library at the same time.

Why? Are you really using both?
And you don't need to have an option in the CMake files, you can simply generate both configurations separately and compile them together when you want both versions.
Laurent Gomila - SFML developer

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
CMake support added
« Reply #20 on: August 24, 2010, 11:26:30 pm »
I'll typically use dynamic SFML but for Windows deployment I prefer cross-compiling and linking static instead of shared. Also, since I'm packaging SFML for Arch, it would be neat if I would have to do less manual work to provide my users with both versions.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CMake support added
« Reply #21 on: August 24, 2010, 11:39:35 pm »
Don't forget that once you generate the makefiles, you never have to do this step again. So the "manual work" of generating another version of the libraries is almost free.

This is one of the cool things with CMake: people can really customize all the configurations they want, and they only have to do it once.
Laurent Gomila - SFML developer

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
CMake support added
« Reply #22 on: August 25, 2010, 09:05:09 am »
Quote from: "Laurent"
To get a static version of the libraries, you must set BUILD_SHARED_LIBS to FALSE.


Worked great, thanks!
John Carmack can Divide by zer0.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
CMake support added
« Reply #23 on: August 27, 2010, 12:12:20 am »
So, uh, how exactly do you use the CMake system? I tried cmake -P CMakeLists.txt at the top of the sfml2 directory, but it gave some error about project() on line 11.
I use the latest build of SFML2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CMake support added
« Reply #24 on: August 27, 2010, 08:05:03 am »
Running "cmake" is enoughIt's often better to run it from a different directory, so that the source tree is not polluted wit hteh build files.

Anyway, what error do you get?
Laurent Gomila - SFML developer

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
CMake support added
« Reply #25 on: August 28, 2010, 06:58:28 am »
Quote from: "Laurent"
Running "cmake" is enoughIt's often better to run it from a different directory, so that the source tree is not polluted wit hteh build files.

Anyway, what error do you get?
Running just "cmake" gives me the usage info.
It gives me this: "Command project() is not scriptable".
I use the latest build of SFML2

Xorlium

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
CMake support added
« Reply #26 on: August 28, 2010, 10:52:05 am »
Just use cmake -i : it runs in "wizard" mode and asks for everything.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
CMake support added
« Reply #27 on: August 28, 2010, 07:27:32 pm »
Quote from: "Xorlium"
Just use cmake -i : it runs in "wizard" mode and asks for everything.
That works so much better. Thanks!
I use the latest build of SFML2

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
CMake support added
« Reply #28 on: October 05, 2010, 02:28:41 am »
hey, Im trying to build a static SFML2 version made with cmake (again) but this time on visual studios 9 (instead of 10), however when i do so i get 2 errors,
Code: [Select]

Error 1 fatal error LNK1107: invalid or corrupt file: cannot read at 0xA5 C:\Documents 1 sfml-audio
Error 2 fatal error LNK1107: invalid or corrupt file: cannot read at 0xA5 C:\Documents 1 sfml-graphics




I could swear I've seen this before but cant quite remember, (google search/forum search doesn't help either)

any idea as to what's going on when trying to build the static libs?

(when i use CMAKE to generate the shared library, it builds successfully)

much appreciated
John Carmack can Divide by zer0.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CMake support added
« Reply #29 on: October 05, 2010, 08:08:44 am »
Maybe it doesn't like the spaces in your path.

I'll see if I can do something about it, but avoid spaces anyway, they are evil.
Laurent Gomila - SFML developer