Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Windows vcpkg support #380

Closed
seghcder opened this issue Jul 31, 2019 · 5 comments
Closed

Windows vcpkg support #380

seghcder opened this issue Jul 31, 2019 · 5 comments

Comments

@seghcder
Copy link

It seems libpmemobj-cpp is not in vcpkg yet. I've spent some time trying to build from source on Windows but getting the toolchain aligned is ... challenging :-)

@igchor
Copy link
Contributor

igchor commented Jul 31, 2019

From what I see, there is libpmemobj-cpp 1.6 in vcpkg: https://github.com/microsoft/vcpkg/blob/master/ports/libpmemobj-cpp/portfile.cmake.

If you need newer version, we can ping guys from vcpkg to update to 1.7

@seghcder
Copy link
Author

Yes you are right. It would help to update to 1.7 (strings!!!).

One thing I noticed is that both the PMDK vcpkg and it seems this one too are missing cmake files once installed. This means find_package doesn't work, and it harder to get running in the Windows cmake toolset - eg for using VS build tools (without full Visual Studio) and Clion.

For example, at the end of installing many packages you get this message:

The package fmt:x64-windows provides CMake targets:
    find_package(fmt CONFIG REQUIRED)
    target_link_libraries(main PRIVATE fmt::fmt)

fmt portfile

For the time being, this seems to work across Windows and Linux in cmake for PMDK:

find_path(PMDK_INCLUDE_DIRS libpmemobj.h)
find_library(PMDK_LIBPMEMOBJ_LIBRARY NAMES libpmemobj libpmemobj.so HINTS /usr/local/lib64/)

as long as you point cmake to the vcpkg cmake file -

cmake.exe -CMAKE_TOOLCHAIN_FILE=d:/vcpkg/scripts/buildsystems/vcpkg.cmake

So perhaps this issue could be tagged to add cmake support within vcpkg? Its also possible I am missing something again too.

PS: For some reason I still have trouble typing vcpkg .. is it just me? Its like a tongue twister for my fingers.

@igchor
Copy link
Contributor

igchor commented Aug 1, 2019

Support for find_package is indeed missing both for libpmemobj-cpp and PMDK. For libpmemobj-cpp it should be quite easy to add this to vcpkg - we generate appropriate files during build.

If this is what you need, you can create a request for vcpkg: https://github.com/microsoft/vcpkg/issues :)

PMDK on the other hand does not use CMake as a build system so providing cmake integration would be rather challenging.

As for libpmemobj version, I just noted that there is already a PR to update libpmemobj-cpp to 1.7: microsoft/vcpkg#7494

@seghcder
Copy link
Author

seghcder commented Aug 10, 2019

Submitted microsoft/vcpkg#7632

v1.7 now installing too.

Is it possible to provide cmake targets even if the build system is not cmake? It seems it just helps CMake find the appropriate include/lib dirs, regardless of what built the libraries in the first place. Still fairly new to CMake :-)

Will close this one anyway for libpmemobj-cpp.

@igchor
Copy link
Contributor

igchor commented Aug 12, 2019

In libpmemobj-cpp we have created a cmake script which allows to use fund_package() for libpmemobj:
https://github.com/pmem/libpmemobj-cpp/blob/master/cmake/FindLIBPMEMOBJ.cmake

I think it could be possible to distribute this script along with PMDK in vcpkg. We should probably investigate that

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants