project-navigation
Personal tools

Author Topic: Using cmake to setup build env  (Read 37217 times)

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #45 on: September 30, 2015, 10:06:29 pm »
Well, when I try my mingw compiled version, I get the output in the dos prompt...

Might be something with appVeyor or maybe the stage at which we launch the tests do not allow to have a command output
« Last Edit: September 30, 2015, 10:09:09 pm by hwoarangmy »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Using cmake to setup build env
« Reply #46 on: October 02, 2015, 09:07:06 am »
see cmake/macros.cmake - ufo_add_executable - the WINDOWED flag adds WIN32 to add_executable. This should be done to distinguish between console and windowed apps, too.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Using cmake to setup build env
« Reply #47 on: October 02, 2015, 12:06:04 pm »
started a new pull request to work on the cmake build system: https://github.com/ufoai/ufoai/pull/27

Offline anonymissimus

  • Sergeant
  • *****
  • Posts: 347
    • View Profile
Re: Using cmake to setup build env
« Reply #48 on: November 02, 2015, 09:57:00 pm »
Are the CodeBlocks files in build/projects/ for Linux or windows or both ?
The downloadable dependency package is for windows + MinGw or windows + MSVC only I presume ?

I tried setting up a environment with integrated debugging by generating a project file with cmake. win xp + MSVC 2008 seems too problematic, as UFO:AI is using newer C++ features while MSVC is behind g++/Linux or MinGw in supporting them, but Linux + CodeBlocks works pretty well.
cmake seems to find and use the dependencies from the OS rather than the ones in src/libs/.

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #49 on: November 04, 2015, 12:40:52 am »
Are the CodeBlocks files in build/projects/ for Linux or windows or both ?
I guess it is for both (but tested only on windows.

The downloadable dependency package is for windows + MinGw or windows + MSVC only I presume ?
It works with both MinGW and MSVS2013 (at least - only tested). This can be checked on github by looking at appVeyor's results.

I tried setting up a environment with integrated debugging by generating a project file with cmake. win xp + MSVC 2008 seems too problematic, as UFO:AI is using newer C++ features while MSVC is behind g++/Linux or MinGw in supporting them, but Linux + CodeBlocks works pretty well.
I've not tested with MSVS2008. But if you say the code uses newer features, I guess nobody will want to rollback to such an old version.


cmake seems to find and use the dependencies from the OS rather than the ones in src/libs/.
It depends on how your PATH is set. However, src/libs are sources files AFAIK. So, the needed ones have been used. The others are not.

Offline anonymissimus

  • Sergeant
  • *****
  • Posts: 347
    • View Profile
Re: Using cmake to setup build env
« Reply #50 on: November 04, 2015, 03:58:29 pm »
Something about the Version shown on the start screen is wrong. CMAKE_BUILD_TYPE is set to Debug with cmake -i and the resulting executable after make does contain debugging information (file size is much larger, line numbers are shown in backtraces) but it keeps showing Release on the start screen.

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #51 on: November 05, 2015, 09:52:44 pm »
Something about the Version shown on the start screen is wrong. CMAKE_BUILD_TYPE is set to Debug with cmake -i and the resulting executable after make does contain debugging information (file size is much larger, line numbers are shown in backtraces) but it keeps showing Release on the start screen.
That probably means that in debug mode, we should define some flag that we don't

Offline anonymissimus

  • Sergeant
  • *****
  • Posts: 347
    • View Profile
Re: Using cmake to setup build env
« Reply #52 on: August 28, 2020, 08:21:29 pm »
That probably means that in debug mode, we should define some flag that we don't
Yes, I found it. We should add_definitions(-DDEBUG). I've submitted a patch:
https://ufoai.org/bugs/ufoalieninvasion/issues/5748