我有一个使用cmake
和vcpkg
的c++项目。我想安装和使用luajit。
我在vcpkg.json
中添加了它:
{
"name": "myproj",
"version": "1.0.0",
"dependencies": [
"boost",
"zeromq",
"cppzmq",
"yas",
"luajit"
]
}
字符串
但是我不能在CMakeFiles.txt
中使用它。如果我尝试添加它:
cmake_minimum_required (VERSION 3.22)
project (myproj-luaclientlib)
add_definitions (-DMYPROJ_LUACLIENTLIB_EXPORTS)
find_package (LuaJIT REQUIRED)
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../)
set (PROJECT_SRC
Author.cpp
)
add_library (${PROJECT_NAME} SHARED ${PROJECT_SRC})
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
型CMake
找不到:
1> [CMake] CMake Error at P:/lib/vcpkg/scripts/buildsystems/vcpkg.cmake:855 (_find_package):
1> [CMake] By not providing "FindLuaJIT.cmake" in CMAKE_MODULE_PATH this project has
1> [CMake] asked CMake to find a package configuration file provided by "LuaJIT", but
1> [CMake] CMake did not find one.
1> [CMake]
1> [CMake] Could not find a package configuration file provided by "LuaJIT" with any
1> [CMake] of the following names:
1> [CMake]
1> [CMake] LuaJITConfig.cmake
1> [CMake] luajit-config.cmake
1> [CMake]
1> [CMake] Add the installation prefix of "LuaJIT" to CMAKE_PREFIX_PATH or set
1> [CMake] "LuaJIT_DIR" to a directory containing one of the above files. If "LuaJIT"
1> [CMake] provides a separate development package or SDK, be sure it has been
1> [CMake] installed.
1> [CMake] Call Stack (most recent call first):
1> [CMake] src/myproj/LuaClientLib/CMakeLists.txt:9 (find_package)
型
其他的图书馆工作得很好。
我做错了什么?在我的项目中使用luajit
需要做什么?
1条答案
按热度按时间k75qkfdt1#
LuaJIT没有
-config.cmake
。但是,它安装了一个*.pc
文件,因此您可以只使用FindPkgConfig
。因此,在清单中添加pkgconf
作为主机依赖项,并执行以下操作:字符串