![]() Then CMake successfully built the library that depends on a recent version of Boost. I also changed the variables pointing to the non-header, compiled parts of the Boost library to point to the version I want. The install() command generates a file, cmakeinstall.cmake, inside the build directory, which is used internally by the generated install target and by CPack. Then I set the Boost-related variables in CMakeCache.txt Boost_DIR:PATH=Boost_DIR-NOTFOUNDīoost_INCLUDE_DIR:PATH=/opt/boost/include/īoost_LIBRARY_DIR_DEBUG:PATH=/opt/boost/libīoost_LIBRARY_DIR_RELEASE:PATH=/opt/boost/lib There I found that the Boost-related variables are still pointing to the default Boost 1.53.0, so no wonder CMake doesn't honor my changes in CMakeLists.txt. ![]() Then I found an article online: CMake can use a local Boost, and realized that I need to change the variables in CMakeCache.txt. Set(BOOST_INCLUDEDIR /opt/boost/include/)īut CMake doesn't honor those changes. After the script is found, it is simply executed in the context of the caller. The most 'magic' in findpackage command is how it searches Config.cmake script. As suggested in previous answers, I set variables in CMakeLists.txt to specify where to look for Boost 1.67.0 as follows include_directories(/opt/boost/include/) I expected that the variables set in MyProjectConfig.cmake would be picked up automatically by cmake to find the library by name. The version I want to use is 1.67.0, as a minimum version of 1.65.1 is required for another C++ library I'm installing it's in /opt/boost, which has include and lib subdirectories. One is the precompiled 1.53.0 version which counts as old in 2018 it's in /usr/include and /usr/lib64. ![]() I ran into a similar problem on a Linux server, where two versions of Boost have been installed. When you compile from source include( ExternalProject ) This makes a theoretically correct incantation: cmake -DBoost_NO_SYSTEM_PATHS=TRUE \ CMake may be installed to any directory, so root privileges are not required for installation. (Boost install locations may contain the version) Select the desired release and follow the download instructions. List of Boost versions not known to this module Youll also sometime see a python folder for python bindings, or a cmake folder for helper CMake files, like Find.cmake files.tests/, and the application folder may be called something else (or not exist for a library-only project). libīoost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not The names are not absolute youll see contention about test/ vs. See the CMake Configuration Options section below for the most common configuration options especially the install directory. includeīOOST_LIBRARYDIR - Preferred library directory e.g. This module reads hints about search locations from variables: BOOST_ROOT - Preferred installation prefixīOOST_INCLUDEDIR - Preferred include directory e.g. Officially speaking the FindBoost page states these variables should be used to 'hint' the location of Boost. Normally this is passed on the CMake command-line using the syntax -D=value. Set( Boost_NO_SYSTEM_PATHS on CACHE BOOL "Do not search system for Boost" ) set( BOOST_ROOT "" CACHE PATH "Boost library path" ) In which case add Boost_NO_SYSTEM_PATHS is set to false. You only need BOOST_ROOT, but you're going to want to disable searching the system for your local Boost if you have multiple installations or cross-compiling for iOS or Android. Set(CPACK_COMPONENTS_ALL applications ResourcesCalibration ResourcesCursors. (repeat for every folder of my resources folder) So far, I do component wise installation the following way: set(RESOURCES_CALIBRATION_DIR resources/calibration)įile(GLOB RESOURCES_CALIBRATION "$ COMPONENT ResourcesCursors) Everything works fine, but I would like to reduce the amount of code drastically by copying my resources folder entirely with one call instead of one for every subfolder. I'm trying to create an installation package with CMake and CPack.
0 Comments
Leave a Reply. |