vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

Don't find package unofficial-nana

Open Darkcacok opened this issue 6 years ago • 15 comments

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.

Darkcacok avatar Mar 20 '20 07:03 Darkcacok

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)

linquize avatar Mar 22 '20 05:03 linquize

This work only on windows, but on ubuntu 18.04 don't.

Darkcacok avatar Mar 22 '20 09:03 Darkcacok

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

linquize avatar Mar 22 '20 15:03 linquize

I use Ubuntu 18.04 + gcc 7

linquize avatar Mar 22 '20 15:03 linquize

I use Ubuntu 18.04 + gcc 7

Lubuntu 18.04

Darkcacok avatar Mar 23 '20 03:03 Darkcacok

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".

Darkcacok avatar Mar 23 '20 03:03 Darkcacok

https://mega.nz/#!G88iiQxS!f5DgGc44RV4yrlHZnrGwZlkuQ7Z3_RJjAEOAx1kjdKU https://mega.nz/#!vps0jIBZ!d_6jaKA_KtfTbtycMfZwoDLmF0jLexF-6KCVkx7f_IM

Darkcacok avatar Mar 23 '20 03:03 Darkcacok

@Darkcacok Did you install nana successfully on your Linux machine?

LilyWangL avatar Mar 30 '20 06:03 LilyWangL

@Darkcacok Did you install nana successfully on your Linux machine?

Yes. I tried this on my machine and in clear virtual machine.

Darkcacok avatar Mar 30 '20 11:03 Darkcacok

@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

LilyWangL avatar Mar 31 '20 09:03 LilyWangL

@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)

Darkcacok avatar Apr 02 '20 17:04 Darkcacok

Could you please provide the repro code?

LilyWangL avatar Apr 03 '20 01:04 LilyWangL

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

Darkcacok avatar Apr 03 '20 05:04 Darkcacok

Please help me https://github.com/Darkcacok/vcpkg/pull/1

Darkcacok avatar Apr 06 '20 09:04 Darkcacok

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.

NancyLi1013 avatar Dec 30 '20 08:12 NancyLi1013