3dfxdev / EDGE

EDGE Source Code
http://edge2.sf.net
74 stars 10 forks source link

Using CMake as Makefile generator #11

Closed usernameak closed 8 years ago

usernameak commented 8 years ago

Why not? Then we will can build project in VS, MinGW, or something other if you choose it on any platform

Corbachu commented 8 years ago

I have never looked into CMake, guess I'll take a little bit of time and check it out ^_^ In the meantime if you happen to get a CMake generated, let us know ;)

usernameak commented 8 years ago

I almost did it! But it throws some errors:

CMakeFiles/edge.dir/objects.a(i_main.cc.obj):i_main.cc:(.text+0x6c): undefined reference to `SDL_RegisterApp'
CMakeFiles/edge.dir/objects.a(i_main.cc.obj):i_main.cc:(.text+0x7e): undefined reference to `epi::GetExecutablePath(char const*)'
E:\MinGW\bin/ld.exe: CMakeFiles/edge.dir/objects.a(i_main.cc.obj): bad reloc address 0x0 in section
`.data'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [src/edge.exe] Error 1
make[1]: *** [src/CMakeFiles/edge.dir/all] Error 2
make: *** [all] Error 2

Working on linking.

Corbachu commented 8 years ago

Does CMake use GCC to build? SDL linked properly and is everything being built in the correct order? On May 17, 2016 2:48 AM, "usernameak" notifications@github.com wrote:

I did it! But it throws some errors:

CMakeFiles/edge.dir/objects.a(i_main.cc.obj):i_main.cc:(.text+0x6c): undefined reference to SDL_RegisterApp' CMakeFiles/edge.dir/objects.a(i_main.cc.obj):i_main.cc:(.text+0x7e): undefined reference toepi::GetExecutablePath(char const_)' E:\MinGW\bin/ld.exe: CMakeFiles/edge.dir/objects.a(imain.cc.obj): bad reloc address 0x0 in section `.data' collect2.exe: error: ld returned 1 exit status make[2]: ** [src/edge.exe] Error 1 make[1]: * [src/CMakeFiles/edge.dir/all] Error 2 make: * [all] Error 2

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/3dfxdev/hyper3DGE/issues/11#issuecomment-219670526

usernameak commented 8 years ago

Oh, I haven't set the include dirs Now it requires jpeg-8c

usernameak commented 8 years ago

New error (I had incorrect build order)

Scanning dependencies of target edge
[100%] Linking CXX executable edge.exe
CMakeFiles/edge.dir/objects.a(i_main.cc.obj):i_main.cc:(.text+0x6c): undefined reference to `SDL_RegisterApp'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0x5c2): undefined reference to `SDL_PumpEvents'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0x645): undefined reference to `SDL_PumpEvents'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0x6f3): undefined reference to `SDL_PumpEvents'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0x711): undefined reference to `SDL_SetRelativeMouseMode'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0x754): undefined reference to `SDL_PumpEvents'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0x7cc): undefined reference to `SDL_PumpEvents'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0x885): undefined reference to `SDL_JoystickGetAxis'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0x8cd): undefined reference to `SDL_JoystickGetHat'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xa71): undefined reference to `SDL_SetRelativeMouseMode'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xac9): undefined reference to `SDL_JoystickNameForIndex'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xb57): undefined reference to `SDL_JoystickOpen'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xb95): undefined reference to `SDL_JoystickNameForIndex'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xbb2): undefined reference to `SDL_JoystickNumAxes'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xbc4): undefined reference to `SDL_JoystickNumButtons'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xbd6): undefined reference to `SDL_JoystickNumHats'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xbe8): undefined reference to `SDL_JoystickNumBalls'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xc8b): undefined reference to `SDL_InitSubSystem'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xcb3): undefined reference to `SDL_JoystickEventState'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xcb8): undefined reference to `SDL_NumJoysticks'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xd74): undefined reference to `SDL_JoystickClose'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xdc2): undefined reference to `SDL_PumpEvents'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xdd9): undefined reference to `SDL_PumpEvents'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xe0a): undefined reference to `SDL_PollEvent'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xe30): undefined reference to `SDL_GetTicks'
CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj):i_ctrl.cc:(.text+0xe82): undefined reference to `SDL_GetTicks'
E:\MinGW\bin/ld.exe: CMakeFiles/edge.dir/objects.a(i_ctrl.cc.obj): bad reloc address 0x16 in section `.text$_ZN6cvar_cC1Ev[__ZN6cvar_cC1Ev]'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [edge.exe] Error 1
make[1]: *** [CMakeFiles/edge.dir/all] Error 2
make: *** [all] Error 2
usernameak commented 8 years ago

You can see the new build files on my fork: https://github.com/usernameak/hyper3DGE How to make them to work?

Corbachu commented 8 years ago

I will give it a shot tonigh. Did you make sure every directory is building files in the correct order? Also you need to statically link in the Win32 flags (-static).

usernameak commented 8 years ago

Yes, but dirs order is random (files order isn't) P.S. i am installing Linux today.

Corbachu commented 8 years ago

Okay -- I installed CMake, how do I build the fork?

usernameak commented 8 years ago

I will install Linux CMake build on my PC then I'll show

usernameak commented 8 years ago

Fill the Where is the source code and Where to build the binaries fields. Press Configure. Select MinGW Makefiles from the dropdown list in the opened window. Wait until it will configure project. Press Generate. Wait. Makefile will be in the directory selected in the Where to build the binaries field.

Corbachu commented 8 years ago

ZombieKiller successfully added Cmake and VS support, verified buildable :-)