Don't find package unofficial-nana
Severity Code Description Project File Line Suppression State Error CMake Error at src/CMakeLists.txt:9 (find_package): Could not find a package configuration file provided by "unofficial-nana" with any of the following names:
unofficial-nanaConfig.cmake
unofficial-nana-config.cmake
Add the installation prefix of "unofficial-nana" to CMAKE_PREFIX_PATH or set "unofficial-nana_DIR" to a directory containing one of the above files. If "unofficial-nana" provides a separate development package or SDK, be sure it has been installed.
Try this
cmake_minimum_required(VERSION 3.10)
project(main)
add_executable(main main.cpp)
find_package(unofficial-nana CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::nana::nana)
This work only on windows, but on ubuntu 18.04 don't.
On Linux, you have to build nana as dynamic library (see #10078), then when you use it in your cmake project, run
cmake -DVCPKG_TARGET_TRIPLET=x64-linux-dynamic
I use Ubuntu 18.04 + gcc 7
I use Ubuntu 18.04 + gcc 7
Lubuntu 18.04
cmake -DCMAKE_TOOLCHAIN_FILE=/home/test/vcpkg/scripts/buildsystems/vcpkg.cmake ..
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Freetype: /home/test/vcpkg/installed/x64-linux/lib/libfreetype.a (found version "2.10.1")
-- Found ZLIB: /home/test/vcpkg/installed/x64-linux/debug/lib/libz.a (found version "1.2.11")
-- Found BZip2: /home/test/vcpkg/installed/x64-linux/lib/libbz2.a (found version "1.0.6")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found PNG: /home/test/vcpkg/installed/x64-linux/debug/lib/libpng.a (found version "1.6.37")
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found JPEG: /home/test/vcpkg/installed/x64-linux/debug/lib/libjpeg.a
CMake Error at /home/test/vcpkg/installed/x64-linux/share/unofficial-nana/unofficial-nana-config.cmake:45 (target_link_libraries):
Cannot specify link libraries for target "unofficial::nana::nana" which is
not built by this project.
Call Stack (most recent call first):
/home/test/vcpkg/scripts/buildsystems/vcpkg.cmake:288 (_find_package)
CMakeLists.txt:18 (find_package)
-- Configuring incomplete, errors occurred! See also "/home/test/Desktop/724942d43cd11c6ee5b3461ac067c846-e6e86199bd2e7151cd9608dd0719a69daa303243/build/CMakeFiles/CMakeOutput.log". See also "/home/test/Desktop/724942d43cd11c6ee5b3461ac067c846-e6e86199bd2e7151cd9608dd0719a69daa303243/build/CMakeFiles/CMakeError.log".
https://mega.nz/#!G88iiQxS!f5DgGc44RV4yrlHZnrGwZlkuQ7Z3_RJjAEOAx1kjdKU https://mega.nz/#!vps0jIBZ!d_6jaKA_KtfTbtycMfZwoDLmF0jLexF-6KCVkx7f_IM
@Darkcacok Did you install nana successfully on your Linux machine?
@Darkcacok Did you install nana successfully on your Linux machine?
Yes. I tried this on my machine and in clear virtual machine.
@Darkcacok Thanks for posting this issue. The version of cmake which is installed by Linux is low, you can use cmake which is installed by VCPKG. The command is: VCPKG_PATH/downloads/tools/cmake-3.14.0-linux/cmake-3.14.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=VCPKG_PATH/scripts/buildsystems/vcpkg.cmake CMakeLists.txt
@Darkcacok Thanks for posting this issue. The version of cmake which is installed by Linux is low, you can use cmake which is installed by VCPKG. The command is: VCPKG_PATH/downloads/tools/cmake-3.14.0-linux/cmake-3.14.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=VCPKG_PATH/scripts/buildsystems/vcpkg.cmake CMakeLists.txt
Thank you for your time. This is resolved using the new version of cmake.
But now I have another issue. /home/maxim/Projects/vcpkg/scripts/buildsystems/vcpkg.cmake:186: error: Target "gui" links to target "PNG::PNG" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? src/application/CMakeLists.txt:13 (add_executable)
Could you please provide the repro code?
https://gist.github.com/caiorss/724942d43cd11c6ee5b3461ac067c846 I replaced the cmake version with my own and the path to the toolchane.
This error occurs when this cmake file depends from another cmake file. For some reason cmake does not use libpng, which is downloaded using vcpkg.
When I compile this project separately, another error occurs. I think it is connected with the same.
/usr/bin/ld: /home/maxim/Projects/vcpkg/installed/x64-linux/lib/libfontconfig.a(fcfreetype.c.o): undefined reference to symbol 'FT_Get_Postscript_Name'
//usr/lib/x86_64-linux-gnu/libfreetype.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/gui1.dir/build.make:103: recipe for target 'gui1' failed
make[2]: *** [gui1] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/gui1.dir/all' failed
make[1]: *** [CMakeFiles/gui1.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Please help me https://github.com/Darkcacok/vcpkg/pull/1
Sorry for the long delay.
It seems that the original issue has been solved. Please open a new issue if you have other concerns @Darkcacok.