CMAKE即使在Cmakesettings中指定了目录。
我正在尝试构建一个需要从源代码安装 OsgEarth 而不是 vcpkg 的项目。我构建了 Osgearth,现在我已将 OSGEARTH_DIR (在 CmakeSettings.json 中)设置为我从源代码构建它的位置。我在 Windows 11 64 位上使用 Visual Studio。即使将所有 OSGEARTH 变量设置为 CMakeSettings.json 中的适当路径(通过单击顶部菜单中的“项目”并单击“hsave-top-level 的 CMake 设置”获得),我仍收到以下错误。
我检查了很多次以确保 OSGEARTH_INCLUDE_DIR 设置为 C:/Users/14077/osgearth/install/include 但仍然收到此错误。我也尝试过删除缓存并重新配置,但没有成功。请帮助我解决此 NOTFOUND 错误。
PS C:\Users\14077\HSA_VE\build> cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:/Users/14077/HSA_VE/install -DCMAKE_TOOLCHAIN_FILE=C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
CMake Warning (dev) at C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:816 (_find_package):
Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
CMake variable OpenVR_ROOT is set to:
C:/Users/14077/vcpkg/installed/x64-windows
For compatibility, CMake is ignoring the variable.
Call Stack (most recent call first):
src/hsave/CMakeLists.txt:6 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found the OpenVR
-- Found ZLIB: optimized;C:/Users/14077/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Users/14077/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found suitable version "1.2.12", minimum required is "1")
-- Found ZLIB: optimized;C:/Users/14077/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Users/14077/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.12")
-- Reading C:/Users/14077/vcpkg/installed/x64-windows/share/GeoTIFF/geotiff-config.cmake
-- GeoTIFF configuration, version 1.7.1
-- include directory: ${GeoTIFF_INCLUDE_DIRS}
-- ${GeoTIFF_LIBRARIES} set to shared library
-- Found ZLIB: optimized;C:/Users/14077/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Users/14077/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found suitable version "1.2.12", minimum required is "1")
-- Found ZLIB: optimized;C:/Users/14077/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Users/14077/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.12")
COMPONENT = openvdb
-- OpenVDB ABI Version: 9
CMake Warning at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1369 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1492 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:2102 (_Boost_MISSING_DEPENDENCIES)
C:/Users/14077/vcpkg/installed/x64-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/FindOpenVDB.cmake:499 (find_package)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/vcpkg-cmake-wrapper.cmake:10 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
src/VoxelDatabase/CMakeLists.txt:8 (find_package)
CMake Warning at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1369 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1492 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:2102 (_Boost_MISSING_DEPENDENCIES)
C:/Users/14077/vcpkg/installed/x64-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/FindOpenVDB.cmake:499 (find_package)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/vcpkg-cmake-wrapper.cmake:10 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
src/VoxelDatabase/CMakeLists.txt:8 (find_package)
CMake Warning at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1369 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1492 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:2102 (_Boost_MISSING_DEPENDENCIES)
C:/Users/14077/vcpkg/installed/x64-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/FindOpenVDB.cmake:499 (find_package)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/vcpkg-cmake-wrapper.cmake:10 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
src/VoxelDatabase/CMakeLists.txt:8 (find_package)
CMake Warning (dev) at C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:816 (_find_package):
Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
CMake variable OpenVR_ROOT is set to:
C:/Users/14077/vcpkg/installed/x64-windows
For compatibility, CMake is ignoring the variable.
Call Stack (most recent call first):
src/voxeldb_seed/CMakeLists.txt:7 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found the OpenVR
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
C:/Users/14077/HSA_VE/src/VoxelDatabase/OSGEARTH_INCLUDE_DIR
used as include directory in directory C:/Users/14077/HSA_VE/src/VoxelDatabase
C:/Users/14077/HSA_VE/src/hsave/OSGEARTH_INCLUDE_DIR
used as include directory in directory C:/Users/14077/HSA_VE/src/hsave
C:/Users/14077/HSA_VE/src/voxeldb_seed/OSGEARTH_INCLUDE_DIR
used as include directory in directory C:/Users/14077/HSA_VE/src/voxeldb_seed
OSGEARTH_LIBRARY
linked by target "hsave" in directory C:/Users/14077/HSA_VE/src/hsave
linked by target "VoxelDatabase" in directory C:/Users/14077/HSA_VE/src/VoxelDatabase
linked by target "voxeldb_seed" in directory C:/Users/14077/HSA_VE/src/voxeldb_seed
CMake Error at C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:568 (_add_executable):
Cannot find source file:
OSGEARTH_INCLUDE_DIR-NOTFOUND/osgEarth/ImGui/ImGui.cpp
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
Call Stack (most recent call first):
src/hsave/CMakeLists.txt:120 (add_executable)
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
I am trying to build a project which requires to have OsgEarth installed from source code and not vcpkg. I build the Osgearth and now I have set the OSGEARTH_DIR (in the CmakeSettings.json) to the place where I build it from the source. I am using visual studio on Windows 11 64 bit. Even after setting ALL the OSGEARTH variables to its appropriate path in CMakeSettings.json (obtained by clicking on Project from the top menu and clicking "CMake Settings for hsave-top-level"), I am getting the following error.
I checked it many times to make sure that the OSGEARTH_INCLUDE_DIR is set to C:/Users/14077/osgearth/install/include but still I am getting this error. I also tried delete cache and reconfigure, but no success. Please help me to resolve this NOTFOUND error.
PS C:\Users\14077\HSA_VE\build> cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:/Users/14077/HSA_VE/install -DCMAKE_TOOLCHAIN_FILE=C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
CMake Warning (dev) at C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:816 (_find_package):
Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
CMake variable OpenVR_ROOT is set to:
C:/Users/14077/vcpkg/installed/x64-windows
For compatibility, CMake is ignoring the variable.
Call Stack (most recent call first):
src/hsave/CMakeLists.txt:6 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found the OpenVR
-- Found ZLIB: optimized;C:/Users/14077/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Users/14077/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found suitable version "1.2.12", minimum required is "1")
-- Found ZLIB: optimized;C:/Users/14077/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Users/14077/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.12")
-- Reading C:/Users/14077/vcpkg/installed/x64-windows/share/GeoTIFF/geotiff-config.cmake
-- GeoTIFF configuration, version 1.7.1
-- include directory: ${GeoTIFF_INCLUDE_DIRS}
-- ${GeoTIFF_LIBRARIES} set to shared library
-- Found ZLIB: optimized;C:/Users/14077/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Users/14077/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found suitable version "1.2.12", minimum required is "1")
-- Found ZLIB: optimized;C:/Users/14077/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Users/14077/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.12")
COMPONENT = openvdb
-- OpenVDB ABI Version: 9
CMake Warning at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1369 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1492 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:2102 (_Boost_MISSING_DEPENDENCIES)
C:/Users/14077/vcpkg/installed/x64-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/FindOpenVDB.cmake:499 (find_package)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/vcpkg-cmake-wrapper.cmake:10 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
src/VoxelDatabase/CMakeLists.txt:8 (find_package)
CMake Warning at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1369 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1492 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:2102 (_Boost_MISSING_DEPENDENCIES)
C:/Users/14077/vcpkg/installed/x64-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/FindOpenVDB.cmake:499 (find_package)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/vcpkg-cmake-wrapper.cmake:10 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
src/VoxelDatabase/CMakeLists.txt:8 (find_package)
CMake Warning at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1369 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:1492 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindBoost.cmake:2102 (_Boost_MISSING_DEPENDENCIES)
C:/Users/14077/vcpkg/installed/x64-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/FindOpenVDB.cmake:499 (find_package)
C:/Users/14077/vcpkg/installed/x64-windows/share/openvdb/vcpkg-cmake-wrapper.cmake:10 (_find_package)
C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
src/VoxelDatabase/CMakeLists.txt:8 (find_package)
CMake Warning (dev) at C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:816 (_find_package):
Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
CMake variable OpenVR_ROOT is set to:
C:/Users/14077/vcpkg/installed/x64-windows
For compatibility, CMake is ignoring the variable.
Call Stack (most recent call first):
src/voxeldb_seed/CMakeLists.txt:7 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found the OpenVR
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
C:/Users/14077/HSA_VE/src/VoxelDatabase/OSGEARTH_INCLUDE_DIR
used as include directory in directory C:/Users/14077/HSA_VE/src/VoxelDatabase
C:/Users/14077/HSA_VE/src/hsave/OSGEARTH_INCLUDE_DIR
used as include directory in directory C:/Users/14077/HSA_VE/src/hsave
C:/Users/14077/HSA_VE/src/voxeldb_seed/OSGEARTH_INCLUDE_DIR
used as include directory in directory C:/Users/14077/HSA_VE/src/voxeldb_seed
OSGEARTH_LIBRARY
linked by target "hsave" in directory C:/Users/14077/HSA_VE/src/hsave
linked by target "VoxelDatabase" in directory C:/Users/14077/HSA_VE/src/VoxelDatabase
linked by target "voxeldb_seed" in directory C:/Users/14077/HSA_VE/src/voxeldb_seed
CMake Error at C:/Users/14077/vcpkg/scripts/buildsystems/vcpkg.cmake:568 (_add_executable):
Cannot find source file:
OSGEARTH_INCLUDE_DIR-NOTFOUND/osgEarth/ImGui/ImGui.cpp
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
Call Stack (most recent call first):
src/hsave/CMakeLists.txt:120 (add_executable)
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来它找不到与 osgearth 一起分发的 ImGui.cpp 文件。确保您正在构建 master osgearth 而不是 3.2 版本,master 分发 ImGui.cpp 标头,但 3.2 不分发。另外,请确保在构建 osgEarth 时运行 INSTALL 目标,以便将标头复制到正确的位置。要构建 hsave,您也可以随时通过电子邮件发送给我的工作地址,我会尽力帮助您。
It looks like it can't find the ImGui.cpp file that is distributed with osgearth. Make sure you are building the master osgearth and not the 3.2 release, the master distributes the ImGui.cpp headers but 3.2 does not. Also make sure to run the INSTALL target when you build osgEarth so that it copies the headers to the correct location. For building hsave you can also feel free to email my work address and I'll try to help you out.