Open barracuda156 opened 6 months ago
In CMake, args
declare its PUBLIC
include_directory:
https://github.com/Taywee/args/blob/master/CMakeLists.txt#L42-L44
It means dependants will get it when they use target_link_libraries
.
I can add BUILD OPTION to prefer find_package over fetch_content. What do you think?
@ArthurSonzogni That would be definitely helpful. Most of downstream distribution systems prefer using ports rather than fetching anything during the build.
For args
, I think I tried leaving it, and build failed, not being able to find libargs
(unsurprisingly, since there is none), so I had to comment that line out. But I used the last release, I think something changed a bit in the master in that regard, maybe it works correctly now.
Hello @barracuda156,
I used the new cmake's FIND_PACKAGE_ARGS
in FetchContent to attempt using find_package
before fetching the library:
https://github.com/ArthurSonzogni/json-tui/commit/ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81
Does the new solution works for you?
@ArthurSonzogni Looks like everything is working now, thank you!
---> Extracting json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81.tar.gz
Executing: cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/json-tui/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81.tar.gz' | /usr/bin/gnutar --no-same-owner -xf -
---> Configuring json-tui
Executing: cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DCMAKE_OSX_ARCHITECTURES="ppc" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.6" -DCMAKE_OSX_SYSROOT="/" /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81
-- The CXX compiler identification is GNU 13.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/local/bin/g++-mp-13 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (3.4s)
-- Generating done (0.1s)
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_C_COMPILER
CMAKE_OBJCXX_COMPILER
CMAKE_OBJC_COMPILER
CMAKE_POLICY_DEFAULT_CMP0025
CMAKE_POLICY_DEFAULT_CMP0060
-- Build files have been written to: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build
---> Building json-tui
Executing: cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build" && /usr/bin/make -j6 -w all VERBOSE=ON
make: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
/opt/local/bin/cmake -S/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81 -B/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build --check-build-system CMakeFiles/Makefile.cmake 0
/opt/local/bin/cmake -E cmake_progress_start /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build/CMakeFiles /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build//CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
/usr/bin/make -f CMakeFiles/json-tui-lib.dir/build.make CMakeFiles/json-tui-lib.dir/depend
make[2]: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build/CMakeFiles/json-tui-lib.dir/DependInfo.cmake "--color="
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
/usr/bin/make -f CMakeFiles/json-tui-lib.dir/build.make CMakeFiles/json-tui-lib.dir/build
make[2]: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
[ 12%] Building CXX object CMakeFiles/json-tui-lib.dir/src/keybinding.cpp.o
/opt/local/bin/g++-mp-13 -DJSON_NOEXCEPTION -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build/src -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fno-exceptions -Wall -Wextra -pedantic -Werror -Wmissing-declarations -Wshadow -MD -MT CMakeFiles/json-tui-lib.dir/src/keybinding.cpp.o -MF CMakeFiles/json-tui-lib.dir/src/keybinding.cpp.o.d -o CMakeFiles/json-tui-lib.dir/src/keybinding.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src/keybinding.cpp
[ 25%] Building CXX object CMakeFiles/json-tui-lib.dir/src/expander.cpp.o
/opt/local/bin/g++-mp-13 -DJSON_NOEXCEPTION -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build/src -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fno-exceptions -Wall -Wextra -pedantic -Werror -Wmissing-declarations -Wshadow -MD -MT CMakeFiles/json-tui-lib.dir/src/expander.cpp.o -MF CMakeFiles/json-tui-lib.dir/src/expander.cpp.o.d -o CMakeFiles/json-tui-lib.dir/src/expander.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src/expander.cpp
[ 37%] Building CXX object CMakeFiles/json-tui-lib.dir/src/mytoggle.cpp.o
/opt/local/bin/g++-mp-13 -DJSON_NOEXCEPTION -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build/src -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fno-exceptions -Wall -Wextra -pedantic -Werror -Wmissing-declarations -Wshadow -MD -MT CMakeFiles/json-tui-lib.dir/src/mytoggle.cpp.o -MF CMakeFiles/json-tui-lib.dir/src/mytoggle.cpp.o.d -o CMakeFiles/json-tui-lib.dir/src/mytoggle.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src/mytoggle.cpp
[ 50%] Building CXX object CMakeFiles/json-tui-lib.dir/src/button.cpp.o
[ 62%] Building CXX object CMakeFiles/json-tui-lib.dir/src/main_ui.cpp.o
/opt/local/bin/g++-mp-13 -DJSON_NOEXCEPTION -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build/src -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fno-exceptions -Wall -Wextra -pedantic -Werror -Wmissing-declarations -Wshadow -MD -MT CMakeFiles/json-tui-lib.dir/src/main_ui.cpp.o -MF CMakeFiles/json-tui-lib.dir/src/main_ui.cpp.o.d -o CMakeFiles/json-tui-lib.dir/src/main_ui.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src/main_ui.cpp
/opt/local/bin/g++-mp-13 -DJSON_NOEXCEPTION -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build/src -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fno-exceptions -Wall -Wextra -pedantic -Werror -Wmissing-declarations -Wshadow -MD -MT CMakeFiles/json-tui-lib.dir/src/button.cpp.o -MF CMakeFiles/json-tui-lib.dir/src/button.cpp.o.d -o CMakeFiles/json-tui-lib.dir/src/button.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src/button.cpp
[ 75%] Linking CXX static library libjson-tui-lib.a
/opt/local/bin/cmake -P CMakeFiles/json-tui-lib.dir/cmake_clean_target.cmake
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/json-tui-lib.dir/link.txt --verbose=ON
/opt/local/bin/ar qc libjson-tui-lib.a "CMakeFiles/json-tui-lib.dir/src/button.cpp.o" "CMakeFiles/json-tui-lib.dir/src/expander.cpp.o" "CMakeFiles/json-tui-lib.dir/src/main_ui.cpp.o" "CMakeFiles/json-tui-lib.dir/src/keybinding.cpp.o" "CMakeFiles/json-tui-lib.dir/src/mytoggle.cpp.o"
/opt/local/bin/ranlib libjson-tui-lib.a
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
[ 75%] Built target json-tui-lib
/usr/bin/make -f CMakeFiles/json-tui.dir/build.make CMakeFiles/json-tui.dir/depend
make[2]: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build/CMakeFiles/json-tui.dir/DependInfo.cmake "--color="
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
/usr/bin/make -f CMakeFiles/json-tui.dir/build.make CMakeFiles/json-tui.dir/build
make[2]: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
[ 87%] Building CXX object CMakeFiles/json-tui.dir/src/main.cpp.o
/opt/local/bin/g++-mp-13 -DJSON_NOEXCEPTION -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build/src -isystem /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/include -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -Wall -Wextra -pedantic -Werror -Wmissing-declarations -Wshadow -fno-exceptions -MD -MT CMakeFiles/json-tui.dir/src/main.cpp.o -MF CMakeFiles/json-tui.dir/src/main.cpp.o.d -o CMakeFiles/json-tui.dir/src/main.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/json-tui-ec2f88a2a7c9f0bd041a5dee91bd3bcb6ee9ee81/src/main.cpp
[100%] Linking CXX executable json-tui
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/json-tui.dir/link.txt --verbose=ON
/opt/local/bin/g++-mp-13 -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names "CMakeFiles/json-tui.dir/src/main.cpp.o" -o json-tui -Wl,-rpath,/opt/local/lib libjson-tui-lib.a /opt/local/lib/libftxui-component.a /opt/local/lib/libftxui-dom.a /opt/local/lib/libftxui-screen.a
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
[100%] Built target json-tui
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
/opt/local/bin/cmake -E cmake_progress_start /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build/CMakeFiles 0
make: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_json-tui/json-tui/work/build'
(No patches used from our side.)
Could you make a new tag? (MacPort dislikes using commits quite a bit.)
Could say why does it want to link to
args
when that is supposed to be a header-only library, and it does not install anything one can link to?Also, just removing that line seems to work fine, and
json-tui
builds normally and appears to work.P. S. We would like to build it against externally installed libraries, without using any bundled third-party stuff.