Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find package when installing using vcpkg #116

Closed
Bambofy opened this issue Jan 16, 2023 · 1 comment
Closed

Can't find package when installing using vcpkg #116

Bambofy opened this issue Jan 16, 2023 · 1 comment
Labels

Comments

@Bambofy
Copy link

Bambofy commented Jan 16, 2023

Hi, when i install tmxlite through vcpkg, for some reason, cmake doesn't locate its package.

Here is the vcpkg installation logs...

x@x-MacBook-Air ~ % vcpkg install tmxlite
Computing installation plan...
The following packages will be built and installed:
tmxlite[core]:x64-osx -> 1.3.0#1
Detecting compiler hash for triplet x64-osx...
Restored 0 package(s) from /Users/x/.cache/vcpkg/archives in 955.6 us. Use --debug to see more details.
Installing 1/1 tmxlite:x64-osx...
Building tmxlite[core]:x64-osx...
-- Downloading https://github.com/fallahn/tmxlite/archive/v1.3.0.tar.gz -> fallahn-tmxlite-v1.3.0.tar.gz...
-- Extracting source /Users/x/vcpkg/downloads/fallahn-tmxlite-v1.3.0.tar.gz
-- Using source at /Users/x/vcpkg/buildtrees/tmxlite/src/v1.3.0-2dee8955a2.clean
-- Found external ninja('1.11.1').
-- Configuring x64-osx
-- Building x64-osx-dbg
-- Building x64-osx-rel
-- Installing: /Users/x/vcpkg/packages/tmxlite_x64-osx/share/tmxlite/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: "/Users/x/.cache/vcpkg/archives/8d/8d923e67f10c721514926fa30aa2c1b006e549f180ecc49cb91e1e6d1e878126.zip"
Elapsed time to handle tmxlite:x64-osx: 37.01 s

Total elapsed time: 40.47 s

The CMakeLists.txt contains this...

cmake_minimum_required(VERSION 3.23)
project(testapp CXX)

set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0")
set(CMAKE_CXX_STANDARD 17)

file(GLOB_RECURSE SRC ${CMAKE_SOURCE_DIR}/src/*.cpp)
file(GLOB_RECURSE HDR ${CMAKE_SOURCE_DIR}/src/*.h)

add_executable(testapp ${SRC} ${HDR})

find_package(tmxlite REQUIRED)
target_link_libraries(testapp PRIVATE ${TMXLITE_LIBRARIES})

And the following is the cmake errors when i try to generate project files...

CMake Error at /Users/x/vcpkg/scripts/buildsystems/vcpkg.cmake:833 (_find_package):
By not providing "Findtmxlite.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "tmxlite", but
CMake did not find one.

Could not find a package configuration file provided by "tmxlite" with any
of the following names:

tmxliteConfig.cmake
tmxlite-config.cmake

Add the installation prefix of "tmxlite" to CMAKE_PREFIX_PATH or set
"tmxlite_DIR" to a directory containing one of the above files. If
"tmxlite" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:12 (find_package)

@fallahn
Copy link
Owner

fallahn commented Jan 16, 2023

Hi,
I wasn't aware tmxlite was available via vcpkg! 😁 However, the problem may lie in your cmake file - try adding something like

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/")

near the top, and set the path to point to the directory containing FindTMXLITE.cmake. This assumes of course that the FindTMXLITE.cmake file knows where to search for vcpkg installs. If not you'll either need to modify it, or build/install tmxlite first yourself, using the included cmake file. This will install the library somewhere that the module file knows about.

Repository owner locked and limited conversation to collaborators Sep 13, 2023
@fallahn fallahn converted this issue into discussion #145 Sep 13, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants