wesnoth icon indicating copy to clipboard operation
wesnoth copied to clipboard

find_package failed

Open ezgameworkplace opened this issue 1 year ago • 13 comments

Game and System Information

Version: 1.18.2 OS: Windows

Description of the bug

cmake can't find the path to the vcpkg packages

1> [CMake] CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message): 1> [CMake] Could NOT find Boost (missing: Boost_INCLUDE_DIR iostreams program_options 1> [CMake] regex system thread random coroutine locale filesystem graph) (Required is 1> [CMake] at least version "1.67") 1> [CMake] Call Stack (most recent call first): 1> [CMake] C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) 1> [CMake] C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.28/Modules/FindBoost.cmake:2392 (find_package_handle_standard_args) 1> [CMake] CMakeLists.txt:98 (find_package) 1> [CMake] -- Configuring incomplete, errors occurred! 1> “C:\WINDOWS\system32\cmd.exe”“/c "%SYSTEMROOT%\System

Steps to reproduce the behavior

vcpkg install mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release

Expected behavior

No response

Additional context

I checked that I do have the package installed for vcpkg using list cmd: D:\Cloned\wesnoth\build>vcpkg list | findstr boost boost-algorithm:x64-windows 1.84.0 Boost algorithm module boost-align:x64-windows 1.84.0 Boost align module boost-any:x64-windows 1.84.0 Boost any module boost-array:x64-windows 1.84.0 Boost array module boost-asio:x64-windows 1.84.0 Boost asio module boost-assert:x64-windows 1.84.0 Boost assert module boost-atomic:x64-windows 1.84.0 Boost atomic module boost-bimap:x64-windows 1.84.0 Boost bimap module boost-bind:x64-windows 1.84.0 Boost bind module boost-build:x64-windows 1.84.0 Boost.Build boost-chrono:x64-windows 1.84.0 Boost chrono module boost-circular-buffer:x64-windows 1.84.0 Boost circular_buffer module boost-concept-check:x64-windows 1.84.0 Boost concept_check module boost-config:x64-windows 1.84.0 Boost config module boost-container-hash:x64-windows 1.84.0 Boost container_hash module boost-container:x64-windows 1.84.0 Boost container module boost-context:x64-windows 1.84.0 Boost context module boost-conversion:x64-windows 1.84.0 Boost conversion module boost-core:x64-windows 1.84.0 Boost core module boost-coroutine:x64-windows 1.84.0 Boost coroutine module boost-date-time:x64-windows 1.84.0 Boost date_time module boost-describe:x64-windows 1.84.0 Boost describe module boost-detail:x64-windows 1.84.0 Boost detail module boost-dynamic-bitset:x64-windows 1.84.0 Boost dynamic_bitset module boost-endian:x64-windows 1.84.0 Boost endian module boost-exception:x64-windows 1.84.0 Boost exception module boost-filesystem:x64-windows 1.84.0 Boost filesystem module boost-foreach:x64-windows 1.84.0 Boost foreach module boost-format:x64-windows 1.84.0 Boost format module boost-function-types:x64-windows 1.84.0 Boost function_types module boost-function:x64-windows 1.84.0 Boost function module boost-functional:x64-windows 1.84.0 Boost functional module boost-fusion:x64-windows 1.84.0 Boost fusion module boost-graph:x64-windows 1.84.0 Boost graph module boost-integer:x64-windows 1.84.0 Boost integer module boost-intrusive:x64-windows 1.84.0 Boost intrusive module boost-io:x64-windows 1.84.0 Boost io module boost-iostreams:x64-windows 1.84.0 Boost iostreams module boost-iostreams[bzip2]:x64-windows Support bzip2 filters boost-iostreams[lzma]:x64-windows Support LZMA/xz filters boost-iostreams[zlib]:x64-windows Support zlib filters boost-iostreams[zstd]:x64-windows Support zstd filters boost-iterator:x64-windows 1.84.0 Boost iterator module boost-lambda:x64-windows 1.84.0 Boost lambda module boost-lexical-cast:x64-windows 1.84.0 Boost lexical_cast module boost-locale:x64-windows 1.84.0 Boost locale module boost-locale[icu]:x64-windows ICU backend for Boost.Locale boost-logic:x64-windows 1.84.0 Boost logic module boost-math:x64-windows 1.84.0 Boost math module boost-modular-build-helper:x64-windows 1.84.0#2 Internal vcpkg port used to build Boost libraries boost-move:x64-windows 1.84.0 Boost move module boost-mp11:x64-windows 1.84.0 Boost mp11 module boost-mpl:x64-windows 1.84.0 Boost mpl module boost-multi-index:x64-windows 1.84.0 Boost multi_index module boost-numeric-conversion:x64-windows 1.84.0 Boost numeric_conversion module boost-optional:x64-windows 1.84.0 Boost optional module boost-parameter:x64-windows 1.84.0 Boost parameter module boost-phoenix:x64-windows 1.84.0 Boost phoenix module boost-pool:x64-windows 1.84.0 Boost pool module boost-predef:x64-windows 1.84.0 Boost predef module boost-preprocessor:x64-windows 1.84.0 Boost preprocessor module boost-process:x64-windows 1.84.0 Boost process module boost-program-options:x64-windows 1.84.0 Boost program_options module boost-property-map:x64-windows 1.84.0 Boost property_map module boost-property-tree:x64-windows 1.84.0 Boost property_tree module boost-proto:x64-windows 1.84.0 Boost proto module boost-ptr-container:x64-windows 1.84.0 Boost ptr_container module boost-random:x64-windows 1.84.0 Boost random module boost-range:x64-windows 1.84.0 Boost range module boost-ratio:x64-windows 1.84.0 Boost ratio module boost-regex:x64-windows 1.84.0 Boost regex module boost-regex[icu]:x64-windows ICU backend for Boost.Regex boost-scope-exit:x64-windows 1.84.0 Boost scope_exit module boost-serialization:x64-windows 1.84.0 Boost serialization module boost-smart-ptr:x64-windows 1.84.0 Boost smart_ptr module boost-spirit:x64-windows 1.84.0 Boost spirit module boost-static-assert:x64-windows 1.84.0 Boost static_assert module boost-system:x64-windows 1.84.0 Boost system module boost-test:x64-windows 1.84.0 Boost test module boost-thread:x64-windows 1.84.0 Boost thread module boost-throw-exception:x64-windows 1.84.0 Boost throw_exception module boost-tokenizer:x64-windows 1.84.0 Boost tokenizer module boost-tti:x64-windows 1.84.0 Boost tti module boost-tuple:x64-windows 1.84.0 Boost tuple module boost-type-index:x64-windows 1.84.0 Boost type_index module boost-type-traits:x64-windows 1.84.0 Boost type_traits module boost-typeof:x64-windows 1.84.0 Boost typeof module boost-uninstall:x64-windows 1.84.0 Internal vcpkg port used to uninstall Boost boost-unordered:x64-windows 1.84.0 Boost unordered module boost-utility:x64-windows 1.84.0 Boost utility module boost-variant2:x64-windows 1.84.0 Boost variant2 module boost-variant:x64-windows 1.84.0 Boost variant module boost-vcpkg-helpers:x64-windows 1.84.0 Internal vcpkg port used to modularize Boost boost-winapi:x64-windows 1.84.0 Boost winapi module boost-xpressive:x64-windows 1.84.0 Boost xpressive module

If I mannul set the path from D:\Cloned\wesnoth\vcpkg_installed\vcpkg\pkgs\ , it will work

ezgameworkplace avatar Aug 26 '24 09:08 ezgameworkplace

What does

If I mannul set the path from D:\Cloned\wesnoth\vcpkg_installed\vcpkg\pkgs\ , it will work

mean?

Pentarctagon avatar Aug 26 '24 13:08 Pentarctagon

What does

If I mannul set the path from D:\Cloned\wesnoth\vcpkg_installed\vcpkg\pkgs\ , it will work

mean?

setting the path like this-> set(OPENSSL_ROOT_DIR "D:\Cloned\wesnoth\vcpkg_installed\vcpkg\pkgs\openssl_x64-windows")

ezgameworkplace avatar Aug 26 '24 13:08 ezgameworkplace

Probably because you're not using the arguments to tell cmake where vcpkg is building the dependencies, like CI does: https://github.com/wesnoth/wesnoth/blob/837e50a3e2e3733c256b60bf9d0a8bf6d8031e83/.github/workflows/ci-main.yml#L321-L325

Pentarctagon avatar Aug 26 '24 15:08 Pentarctagon

Probably because you're not using the arguments to tell cmake where vcpkg is building the dependencies, like CI does:

https://github.com/wesnoth/wesnoth/blob/837e50a3e2e3733c256b60bf9d0a8bf6d8031e83/.github/workflows/ci-main.yml#L321-L325

Do I need change this 'C:\vcpkg\scripts\buildsystems\vcpkg.cmake' path to my vcpkg.cmake path?

ezgameworkplace avatar Aug 27 '24 04:08 ezgameworkplace

I don't know, the expected way to use this is via Visual Studio.

Pentarctagon avatar Aug 27 '24 05:08 Pentarctagon

I don't know, the expected way to use this is via Visual Studio.

I am using VS, but I can't build with it

ezgameworkplace avatar Aug 27 '24 06:08 ezgameworkplace

I don't know, the expected way to use this is via Visual Studio.

I really need a video tutorial for this

ezgameworkplace avatar Aug 27 '24 06:08 ezgameworkplace

Maybe @Vultraz can help you (I'm on Linux), but you should just need to open the repository folder in VS and click the Build button.

Pentarctagon avatar Aug 27 '24 13:08 Pentarctagon

INSTALL.md also mentions to run vcpkg integrate install.

soliton- avatar Aug 27 '24 13:08 soliton-

Maybe @Vultraz can help you (I'm on Linux), but you should just need to open the repository folder in VS and click the Build button.

I just found out that I need to manually install vcpkg instead of using the vcpkg provided by VS Installer. This should resolve the find_package problem. However, I got stuck when trying to start the .exe file after the build—nothing pops up when I run the .exe file.

ezgameworkplace avatar Aug 27 '24 13:08 ezgameworkplace

Run it from a terminal with --no-log-to-file and check the output.

soliton- avatar Aug 27 '24 13:08 soliton-

It shouldn’t matter if you’re using built in vcpkg or not, honestly. Wesnoth doesn’t use global vcpkg packages (that method is discouraged). Instead, it builds and installs them with your wesnoth git clone. As long as wesnoth is opened in Visual Studio, it should automatically find the cmake config file and install the packages itself.

Vultraz avatar Aug 27 '24 17:08 Vultraz

As Vultraz mentioned, the way Wesnoth is currently set-up does not depend on what you have installed for stand-alone vcpkg. I remember I had some trouble with initial set-up as well, but I think as long as cmake support is installed for Visual Studio, opening the wesnoth git tree should allow VS to find and run the cmake configuration automatically. It will build the necessary vcpkg packages by itself and then you should be able to build and run the Wesnoth components.

Wedge009 avatar Aug 27 '24 22:08 Wedge009

Run it from a terminal with --no-log-to-file and check the output.

I don't think there is this option: 20240829 14:55:47 error server: unknown option: --no-log-to-file

ezgameworkplace avatar Aug 29 '24 06:08 ezgameworkplace

It shouldn’t matter if you’re using built in vcpkg or not, honestly. Wesnoth doesn’t use global vcpkg packages (that method is discouraged). Instead, it builds and installs them with your wesnoth git clone. As long as wesnoth is opened in Visual Studio, it should automatically find the cmake config file and install the packages itself.

I tried with a demo project, but for some reason, the built-in vcpkg didn't work well for me, whereas the manually installed one works fine.

ezgameworkplace avatar Aug 29 '24 07:08 ezgameworkplace

As Vultraz mentioned, the way Wesnoth is currently set-up does not depend on what you have installed for stand-alone vcpkg. I remember I had some trouble with initial set-up as well, but I think as long as cmake support is installed for Visual Studio, opening the wesnoth git tree should allow VS to find and run the cmake configuration automatically. It will build the necessary vcpkg packages by itself and then you should be able to build and run the Wesnoth components.

I followed the instructions from INSTALL.md using CMake, but that was for Linux, and I'm currently using Windows. I really need a step-by-step guide for setting it up on Windows.

ezgameworkplace avatar Aug 29 '24 07:08 ezgameworkplace

I tried cloning and starting from the beginning. After opening the folder in VS, CMake encountered an error with find_package, and I noticed that vcpkg hadn't downloaded the dependencies yet. What should I do at this point?

ezgameworkplace avatar Aug 29 '24 07:08 ezgameworkplace

Show the exact error.

soliton- avatar Aug 29 '24 07:08 soliton-

Run it from a terminal with --no-log-to-file and check the output.

I don't think there is this option: 20240829 14:55:47 error server: unknown option: --no-log-to-file

I assumed you were starting wesnoth. If you start the multiplayer server wesnothd then it is expected that nothing pops up.

soliton- avatar Aug 29 '24 07:08 soliton-

Show the exact error.

CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) (Required is at least version "1.0") C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake 230

ezgameworkplace avatar Aug 31 '24 07:08 ezgameworkplace

Run it from a terminal with --no-log-to-file and check the output.

I don't think there is this option: 20240829 14:55:47 error server: unknown option: --no-log-to-file

I assumed you were starting wesnoth. If you start the multiplayer server wesnothd then it is expected that nothing pops up.

I guess I will try to start from the beginning by solving the find package issue

ezgameworkplace avatar Aug 31 '24 07:08 ezgameworkplace

What is the status of this issue? Can it be closed as unconfirmed?

Wedge009 avatar Feb 14 '25 04:02 Wedge009