thezbyg / gpick

Advanced color picker written in C++ using GTK+ toolkit
BSD 3-Clause "New" or "Revised" License
377 stars 33 forks source link

Target "lua" links to itself #156

Closed ryandesign closed 2 years ago

ryandesign commented 5 years ago

I'm trying to use gpick's new cmake build system. It fails for me on macOS High Sierra with:

CMake Error at CMakeLists.txt:100 (add_library):
  Target "lua" links to itself.
thezbyg commented 5 years ago

Should be fixed by 632faeb540caf340425adfd0d29aa6131a5e5777. If problem persists, then please run cmake command with -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON option to build verbose makefile, and, after running make, provide either whole output or last lines before failure.

ryandesign commented 5 years ago

It seems to get through the build, but fail at linking, with missing lua symbols, because -llua isn't in the link line.

https://gist.github.com/ryandesign/092ac49df5a3dafe073dcd89bfb8eefe

thezbyg commented 5 years ago

Please provide lines from CMakeCache.txt file starting with the following strings: pkgcfg_lib_Lua_lua Lua_LIBRARIES Lua_VERSION

And also results of running the following commands: pkg-config --libs lua5.3 pkg-config --libs lua5 pkg-config --libs lua pkg-config --libs lua5.2

ryandesign commented 5 years ago

Please provide lines from CMakeCache.txt file starting with the following strings: pkgcfg_lib_Lua_lua Lua_LIBRARIES Lua_VERSION

Sure, here you go:

pkgcfg_lib_Lua_lua:FILEPATH=/opt/local/lib/liblua.dylib
Lua_LIBRARIES:INTERNAL=lua;m
Lua_VERSION:INTERNAL=5.3.4

And also results of running the following commands: pkg-config --libs lua5.3 pkg-config --libs lua5 pkg-config --libs lua pkg-config --libs lua5.2

$ pkg-config --libs lua5.3
Package lua5.3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua5.3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua5.3' found
$ pkg-config --libs lua5
Package lua5 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua5.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua5' found
$ pkg-config --libs lua
-L/opt/local/lib -llua -lm
$ pkg-config --libs lua5.2
Package lua5.2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua5.2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua5.2' found
thezbyg commented 5 years ago

It turns out that in CMake both system and internally declared libraries live in the same name space, and your Lua library is called lua which was the name of the internal Lua utility library. This should now be fixed.