FrictionalGames / AmnesiaTheDarkDescent

GNU General Public License v3.0
3.51k stars 366 forks source link

Build issues - how to get Steam library? #1

Open ericonr opened 4 years ago

ericonr commented 4 years ago

Hi! Thanks for the awesome release!

I'm trying to build this game from source, but I've noticed a few issues.

In HPL2:

It would be nice to have a dependency list, too. I have used at least glu-devel and MesaLib-devel.

My main issue, however, is with the steam library:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
STEAM_LIBRARY
    linked by target "AmnesiaSteam" in directory /builddir/AmnesiaTheDarkDescent-ea45a1e253aa1a50aa89654f56f352dbf13b0e0f/amnesia/src/game

How would I get one, if that's even possible? Would perhaps something like https://gitlab.com/Mr_Goldberg/goldberg_emulator be enough?

VHSCODE commented 4 years ago

In my case i just created a new folder and set the variable to the path, however, it seems that the tests folder is also missing.

ericonr commented 4 years ago

@VHSCODE sorry, I should have mentioned. Removing the tests line allows it to go ahead. And thanks for the suggestion.

VHSCODE commented 4 years ago

Btw, somebody just fixed the linux build files #2

ericonr commented 4 years ago

So, as an addition to the dependencies, it requires perl. And thanks!

darmon77 commented 4 years ago

The steam library you can disable without problems by deleting or commenting.. src/game/CMakeLists.txt

add_executable(AmnesiaSteam MACOSX_BUNDLE EXCLUDE_FROM_ALL
    ${full_sources}
)
find_library(STEAM_LIBRARY steam_api PATHS ${DEP_LIB_DIR} PATH_SUFFIXES lib NO_DEFAULT_PATH)
target_link_libraries(AmnesiaSteam HPL2 ${STEAM_LIBRARY})
set_target_properties(AmnesiaSteam PROPERTIES
    COMPILE_DEFINITIONS "${compile_defs};USE_STEAM"
    MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Game-Info.plist"
    MACOSX_BUNDLE_ICON_FILE "Lux.icns"
    MACOSX_BUNDLE_BUNDLE_VERSION ${VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${VERSION}
    MACOSX_BUNDLE_GUI_IDENTIFIER "com.frictionalgames.AmnesiaSteam"
    MACOSX_BUNDLE_BUNDLE_NAME "Amnesia: The Dark Descent"
)
if(LINUX)
    set_target_properties(AmnesiaSteam PROPERTIES
        LINK_FLAGS "-Wl,--allow-shlib-undefined" # Voodoo to ignore the libs that steam_api is linked to (will be resolved at runtime)
    )
endif()

The test folder can disable.. HPL2/core/CMakeLists.txt

add_subdirectory(../tests tests) delete or comment line
add_subdirectory(../tools tools)