Compiling GiGi: CMake does not find Boost (Win7)

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
StarFire
Space Floater
Posts: 21
Joined: Sat Mar 24, 2007 8:28 am

Compiling GiGi: CMake does not find Boost (Win7)

#1 Post by StarFire »

Hello World,

I have GG in the following folder:
J:\QUARTS\_dev\src\CAD\GG
and I have Boost as a sibling:
J:\QUARTIS\_dev\src\CAD\boost

But CMake in GG does not find boost. I tried setting the INCLUDE, BOOST_ROOT, CMAKE_INCLUDE_PATH (and some other) variables, but to no avail. How can I tell CMake where Boost is?

J: is a subst-ed drive
boost is a junction to boost1_44_0 (I tried the above also with the non-substed and non-junctioned path)

System:
Win 7 Professional with all patches applied
GiGi from SVN (r813)
CMake 2.8
Visual Studio 2010 Ultimate

TIA and best regards
Andreas

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compiling GiGi: CMake does not find Boost (Win7)

#2 Post by Geoff the Medio »

If you're having trouble with CMake, you could import the MSVS 2008 project files that are available in SVN. Hopefully they would work without major problems.

That said, you're likely to have issues with some of the dependencies in the Win32 SDK, if you're using it, being built with MSVS 2008 if you try to link in MSVS 2010. You may need to rebuild several of them. See here: viewtopic.php?p=44021#p44021

As to the CMake issue, try editing CMakeLists.txt in the GG root directory to change

Code: Select all

set(MINIMUM_BOOST_VERSION 1.36.0)
to

Code: Select all

set(MINIMUM_BOOST_VERSION 1.44.0)
You may also need to edit FindBoost.cmake in the CMake directory or add an extra line to CMakeLists.txt for GG to add your Boost version. See this excerpt:
FindBoost.cmake in CMake 2.8 wrote:

Code: Select all

# =========== The mess that is Boost_ADDITIONAL_VERSIONS (sorry?) ============
#
# OK, so the Boost_ADDITIONAL_VERSIONS variable can be used to specify a list of
# boost version numbers that should be taken into account when searching
# for Boost. Unfortunately boost puts the version number into the
# actual filename for the libraries, so this variable will certainly be needed
# in the future when new Boost versions are released.
#
# Currently this module searches for the following version numbers:
# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1,
# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0,
# 1.40, 1.40.0, 1.41, 1.41.0
#
# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should
# add both 1.x and 1.x.0 as shown above.  Official Boost include directories
# omit the 3rd version number from include paths if it is 0 although not all
# binary Boost releases do so.
#
# SET(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0")

User avatar
StarFire
Space Floater
Posts: 21
Joined: Sat Mar 24, 2007 8:28 am

Re: Compiling GiGi: CMake does not find Boost (Win7)

#3 Post by StarFire »

Unfortunately, there are no MSVS project files in the GG directory (I suppose there are somewhere in the FreeOrion directory; if yes: I just want to compile Gigi, not FreeOrion).

I also tried to change the CMakeLists.txt file, but no success either.

Any other hints?

TIA and best regards
Andreas

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compiling GiGi: CMake does not find Boost (Win7)

#4 Post by Geoff the Medio »

StarFire wrote:Unfortunately, there are no MSVS project files in the GG directory (I suppose there are somewhere in the FreeOrion directory; if yes: I just want to compile Gigi, not FreeOrion).
The FreeOrion MSVS 2008 solution has six projects, of which three are for building GiGi libraries. These can be built independently of the FreeOrion projects.
I also tried to change the CMakeLists.txt file, but no success either.
You probably need to edit FindBoost.cmake within the CMake directories, not the FreeOrion CMakeLists.txt.

User avatar
StarFire
Space Floater
Posts: 21
Joined: Sat Mar 24, 2007 8:28 am

Re: Compiling GiGi: CMake does not find Boost (Win7)

#5 Post by StarFire »

I also tried to change the CMakeLists.txt file, but no success either.
You probably need to edit FindBoost.cmake within the CMake directories, not the FreeOrion CMakeLists.txt.
I looked for FindBoost.cmake, but I didn't find a file with that name, neither in the GG nor in the freeorion directories. I have cmake 2.8 for Windows and I looked into the share/Modules folder, and it was missing there too. So I suppose that file was forgotten in the cmake Windows package.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compiling GiGi: CMake does not find Boost (Win7)

#6 Post by Geoff the Medio »

StarFire wrote:I looked for FindBoost.cmake, but I didn't find a file with that name, neither in the GG nor in the freeorion directories. I have cmake 2.8 for Windows and I looked into the share/Modules folder, and it was missing there too. So I suppose that file was forgotten in the cmake Windows package.
In my install of CMake 2.8, FindBoost.cmake is located in C:\Program Files\CMake 2.8\share\cmake-2.8\Modules

The same directory has over 300 files, which 250 appear to be .cmake files.

User avatar
StarFire
Space Floater
Posts: 21
Joined: Sat Mar 24, 2007 8:28 am

Re: Compiling GiGi: CMake does not find Boost (Win7)

#7 Post by StarFire »

Geoff the Medio wrote: In my install of CMake 2.8, FindBoost.cmake is located in C:\Program Files\CMake 2.8\share\cmake-2.8\Modules

The same directory has over 300 files, which 250 appear to be .cmake files.
As a matter of fact, it's in there. I must have missed it, when I looked last time.
I'll try to change it for my needs later.

Thank you
Andreas

User avatar
StarFire
Space Floater
Posts: 21
Joined: Sat Mar 24, 2007 8:28 am

Re: Compiling GiGi: CMake does not find Boost (Win7)

#8 Post by StarFire »

It didn't work, so I give up on CMake.

CMake seems to be a good build tool as long as the libraries and include files are at defined places (as it is on all *nixes), but if the libs and includes are anywhere on the filesystem ...

I'll try with the VS2008 projects from FreeOrion

Thank you for your help
Andreas

Post Reply