svkaiser / Doom64EX

Doom64EX is a reverse-engineering project aimed to recreate Doom64 as close as possible with additional modding features.
http://doom64ex.wordpress.com/
GNU General Public License v2.0
243 stars 49 forks source link

Issues with CMake build system #16

Closed alexey-lysiuk closed 8 years ago

alexey-lysiuk commented 8 years ago

As response to #15 I decided to create standalone Doom64EX build environment for OS X. However a few issues are still preventing me from finishing it:

  1. kexlib depends on libpng, at least png.h must be available. However if I don't have it somewhere in default search paths, kexlib will fail to build. Although the main executable target doesn't have this problem and locates libpng correctly.
  2. The same target has a quite strange statement for a static library: target_link_libraries(kexlib m png). In fact this affects executable that is linked with this library. But what if libpng library is named differently, like libpng16.a in my case? I think this statement should be removed and replaced with proper libpng dependency, similar to the main executable target.
  3. The main executable target tries to search for FluidSynth headers inside FLUIDSYNTH_INCLUDE_DIRS. However the corresponding CMake file doesn't provide this variable but it provides FLUIDSYNTH_INCLUDE_DIR (without S at the end) instead.

I can make a pull request with fixes however I have very limited abilities to test on other platforms. Moreover 1. and 2. can be fixed in various ways.

pinkwah commented 8 years ago

Thanks, I'll fix these. Are these the only issues preventing compilation using CMake?

alexey-lysiuk commented 8 years ago

Yes, when I fixed those by hands in generated Xcode project all targets were built successfully. There was no sound in game but it's unrelated to these troubles. Although it's pretty easy to fix and I'll make a pull request.

alexey-lysiuk commented 8 years ago

One Look Is Worth A Thousand Words: #17 Could you please check it in your environment, preferably in a clean build directory?

pinkwah commented 8 years ago

Thanks, works fine.

Regarding the sound issue: D64EX defaults to the sndio audio driver on unknown OS'. I just changed for it to default to coreaudio when __APPLE__ is defined.

You'll need to either delete the config.cfg file from the Doom64EX user directory, or set the s_driver CVar to coreaudio.

alexey-lysiuk commented 8 years ago

OK, I did the same in my OS X branch but decided to wait for CMake fixes :wink:

So far I have one question related to CMake build system: the main executable target doesn't depend on creation of kex.wad, is this intentional? For me it's a bit confusing that making of the game executable doesn't create the file required to run the game.

pinkwah commented 8 years ago

Yeah, kexwad isn't a dependency of the doom64ex target because I don't want to regenerate kex.wad every time I compile the game. I could maybe make it a dependency if CMAKE_BUILD_TYPE is set to Release or something... I'll think about it.

alexey-lysiuk commented 8 years ago

How does the buils system (IDE, make, etc) know that it's up to date? You need to remember to build it when content was updated, right? I understand that the content is rarely changed but anyway.

The problem is that the .wad recreated each time kexwad runs. I will take a look at possibility to update the content of the WAD instead of overwriting it.

pinkwah commented 8 years ago

The kex.wad is now a dependency of the engine target.

It can be disabled by running cmake with -DKEXWAD=OFF.