EasyRPG / liblcf

Library to handle RPG Maker 2000/2003 and EasyRPG projects
https://easyrpg.org
MIT License
116 stars 55 forks source link

Could NOT find liblcf (missing: LIBLCF_LIBRARY) (found version "0.7.0") #446

Closed papoteur-mga closed 1 year ago

papoteur-mga commented 1 year ago

Trying to build easyrpg for Mageia and update it, I found an error which was already reported, but solved with the way of static library, what we avoid in distribution.

 /usr/bin/cmake -Wno-dev -S . -B build -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-DNDEBUG -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64 -DCMAKE_INSTALL_LIBEXECDIR:PATH=/usr/libexec -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_RUNSTATEDIR:PATH=/run -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIB_SUFFIX=64 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON '-DCMAKE_MODULE_LINKER_FLAGS=-Wl,--as-needed  -Wl,-z,relro -Wl,-O1 -Wl,--build-id=sha1 -Wl,--enable-new-dtags' -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF
-- The CXX compiler identification is GNU 12.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SDL2: /usr/lib64/libSDL2.so (Required is at least version "2.0.5") 
-- Configuring incomplete, errors occurred!
See also "/builddir/build/BUILD/easyrpg-player-0.7.0/build/CMakeFiles/CMakeOutput.log".
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find liblcf (missing: LIBLCF_LIBRARY) (found version "0.7.0")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/lib64/cmake/liblcf/liblcf-config.cmake:78 (find_package_handle_standard_args)
  CMakeLists.txt:615 (find_package)

What surprise me is that something is found, because version number is reported. The shared library is at 0.7.0 version.

The problem was already present before I try to update to 0.7.0: http://pkgsubmit.mageia.org/autobuild/cauldron/x86_64/core/2022-11-15/easyrpg-player-0.6.2.3-2.mga9.src.rpm/build.x86_64.0.20221115174342.log

carstene1ns commented 1 year ago

Can you surround the liblcf finding in cmake with this: and post the output of cmake?

set(CMAKE_FIND_DEBUG_MODE TRUE)

set(CMAKE_FIND_DEBUG_MODE FALSE) 
papoteur-mga commented 1 year ago

Thanks for your quick reply. I'm not sure of the place. What I obtain:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find liblcf (missing: LIBLCF_LIBRARY) (found version "0.7.0")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/lib64/cmake/liblcf/liblcf-config.cmake:78 (find_package_handle_standard_args)
  CMakeLists.txt:616 (find_package)

CMake Debug Log at CMakeLists.txt:616 (find_package):
  find_package considered the following paths for Findliblcf.cmake:

    /builddir/build/BUILD/easyrpg-player-0.7.0/builds/cmake/Modules/Findliblcf.cmake
    /usr/share/cmake/Modules/Findliblcf.cmake

  The file was not found.

  The internally managed CMAKE_FIND_PACKAGE_REDIRECTS_DIR.

    /builddir/build/BUILD/easyrpg-player-0.7.0/build/CMakeFiles/pkgRedirects

  <PackageName>_ROOT CMake variable [CMAKE_FIND_USE_PACKAGE_ROOT_PATH].

    none

  CMAKE_PREFIX_PATH variable [CMAKE_FIND_USE_CMAKE_PATH].

    none

  CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables
  [CMAKE_FIND_USE_CMAKE_PATH].

    none

  Env variable liblcf_DIR [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  CMAKE_PREFIX_PATH env variable [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables
  [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  Paths specified by the find_package HINTS option.

    none

  Standard system environment variables
  [CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH].

    /usr
    /
    /usr/local/games
    /usr/games
    /usr/local

  CMake User Package Registry [CMAKE_FIND_USE_PACKAGE_REGISTRY].

    none

  CMake variables defined in the Platform file
  [CMAKE_FIND_USE_CMAKE_SYSTEM_PATH].

    /usr/X11R6
    /usr/pkg
    /opt

  CMake System Package Registry
  [CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY].

    none

  Paths specified by the find_package PATHS option.

    none

  find_package considered the following locations for liblcf's Config module:

    /builddir/build/BUILD/easyrpg-player-0.7.0/build/CMakeFiles/pkgRedirects/liblcfConfig.cmake
    /builddir/build/BUILD/easyrpg-player-0.7.0/build/CMakeFiles/pkgRedirects/liblcf-config.cmake
    /usr/liblcfConfig.cmake
    /usr/liblcf-config.cmake
    /usr/lib64/cmake/liblcf/liblcfConfig.cmake
    /usr/lib64/cmake/liblcf/liblcf-config.cmake

  The file was found at

    /usr/lib64/cmake/liblcf/liblcf-config.cmake

I have the debug commands between thesse 2 lines : https://github.com/EasyRPG/Player/blob/d9fa057dba51f040749edb340f30cbd5d2cb053d/CMakeLists.txt#L787-L788

carstene1ns commented 1 year ago

Can you verify where liblcf.so is located?

papoteur-mga commented 1 year ago

I found a fix (at least for me). The issue is that PATHS in liblcf-config.make is set to /usr//usr/lib64 in our build of liblcf. This comes from here: https://github.com/EasyRPG/liblcf/blob/0ed38af4e781c2f523979ce26c8843b78bcfa1ff/builds/liblcf-config.cmake.in#L61 and https://github.com/EasyRPG/liblcf/blob/0ed38af4e781c2f523979ce26c8843b78bcfa1ff/builds/liblcf-config.cmake.in#L67 It seems that CMAKE_INSTALL_LIBDIR already includes the PREFIX, thus ${_IMPORT_PREFIX}/ isn't needed.

Ghabry commented 1 year ago

moved to liblcf as obviously a problem with the cmake-config file