我在CMakeLists.txt中定义了一个变量,如下所示: set(MY_PROJECT_DEPENDENCIES boost-core boost-optional sqlite3) 我想使用find_package()检查是否找到了,如下所示: find_package(MY_PROJECT_DEPENDENCIES REQUIRED)。以下是代码片段: macro(find_packages) find_package(${package} REQUIRED) end 浏览28提问于2020...
set(CMAKE_TOOLCHAIN_FILE $ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake) cmake_minimum_required(VERSION 3.20) project(example) set(CMAKE_BUILD_TYPE "Release") find_package(VTK) add_executable(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/main.cpp) target_link_libraries(${PROJECT_NAME} ${VTK_...
One of the things I always find annoying when dealing with dependencies included as sub-projects in application projects is installation of only the required parts. For example, when installing a Windows application one needs to install only the dll of a library dependency, but not the CMake c...
Actual Behavior using Cmake version 3.10.0-rc5 the find_package(Qt5 REQUIRED COMPONENTS Core) locates the anaconda Qt5 dir setting the cmake parameter Qt5Core_DIR:PATH=C:/ProgramData/Anaconda3/Library/lib/cmake/Qt5Core Expected Behavior ...
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/deps/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file") message(VCPKG_ROOT = "${CMAKE_TOOLCHAIN_FILE}") find_package(CURL CONFIG REQUIRED) find_package(cxxopts CONFIG REQUIRED) CMake output is next: VCPKG_ROOT=...
InstallRequiredSystemLibraries.cmake KDE3Macros.cmake MacOSXBundleInfo.plist.in MacOSXFrameworkInfo.plist.in MacroAddFileDependencies.cmake MatlabTestsRedirect.cmake ProcessorCount.cmake Qt4ConfigDependentSettings.cmake Qt4Macros.cmake SelectLibraryConfigurations.cmake Squish4RunTestCase.bat Squis...
InstallRequiredSystemLibraries.cmake KDE3Macros.cmake MacOSXBundleInfo.plist.in MacOSXFrameworkInfo.plist.in MacroAddFileDependencies.cmake MatlabTestsRedirect.cmake ProcessorCount.cmake Qt4ConfigDependentSettings.cmake Qt4Macros.cmake RepositoryInfo.txt.in SelectLibraryConfigurations.cmake Squ...
InstallRequiredSystemLibraries.cmake KDE3Macros.cmake MacOSXBundleInfo.plist.in MacOSXFrameworkInfo.plist.in MacroAddFileDependencies.cmake MatlabTestsRedirect.cmake ProcessorCount.cmake Qt4ConfigDependentSettings.cmake Qt4Macros.cmake RepositoryInfo.txt.in SelectLibraryConfigurations.cmake Squi...