Making a vcpkg package #136
-
So I have a static/shared library that I've made using cmake-init and I am trying to include it in the other cmake-init project. I am trying to run my own registry, but I am stuck with portfile.cmake.:
The library in question is cemplate, and the portfile.cmake I currently have is: vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL git://git.dimitrijedobrota.com/cemplate.git
REF fea2b26d496ab6250f966f7a216b9222be731559
HEAD_REF master
)
set(name cemplate)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-D${name}_INSTALL_CMAKEDIR=share/${name}"
OPTIONS_DEBUG
"-D${name}_INSTALL_HEADERS=OFF"
)
# set(VCPKG_BUILD_TYPE release) # header-only
vcpkg_cmake_install()
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME "${name}")
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
configure_file(
"${SOURCE_PATH}/LICENSE.md"
"${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright"
COPYONLY
) and vcpkg.json: {
"name": "cemplate",
"version": "0.2.0",
"description": "Simple C++ template engine",
"homepage": "https://git.dimitrijedobrota.com/cemplate.git",
"license": "MIT",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
} Interesting thing to note is that when the link target is just I've been at it for hours, what am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You deleted the line that imports the export set in your CMake package: DimitrijeDobrota/cemplate@fea2b26#diff-a2af7ef15ed24fec1d5ad5cf93e0baf38c2d4ce41c3908c1e28febd24007013eR1 Just an fyi, but you call |
Beta Was this translation helpful? Give feedback.
-
Cheers mate, thanks a lot of the answer, that was the issue. I have a question, why is this check necessary before doing the include if I have the dependency |
Beta Was this translation helpful? Give feedback.
You deleted the line that imports the export set in your CMake package: DimitrijeDobrota/cemplate@fea2b26#diff-a2af7ef15ed24fec1d5ad5cf93e0baf38c2d4ce41c3908c1e28febd24007013eR1
Just an fyi, but you call
vcpkg_cmake_install
twice in your port and callvcpkg_fixup_pkgconfig
for a package that doesn't use .pc files.