Could not find a package configuration file provided by "boost_atomic" - c++

I am compiling C/C++ to wasm with emscripten. And need boost library as well. Pretty new to emscripten and wasm
After installing emscripten and boost. I ran the following command
emconfigure cmake -DBoost_DEBUG=1
-Dboost_headers_DIR=../boost_1_71_0/build/lib/cmake/boost_headers-1.71.0
-DBoost_DIR=../boost_1_71_0/build/lib/cmake/Boost-1.71.0 -Dboost_program_options_DIR=../boost_1_71_0/build/lib/cmake/boost_program_options-1.71.0
-Dboost_system_DIR=../boost_1_71_0/build/lib/cmake/boost_system-1.71.0 -Dboost_thread_DIR=../boost_1_71_0/build/lib/cmake/boost_thread-1.71.0 -Dboost_unit_test_framework_DIR=../boost_1_71_0/build/lib/cmake/boost_unit_test_framework-1.71.0
-DZLIB_INCLUDE_DIR=${HOME}/.emscripten_ports/zlib/zlib-version_1 -DZLIB_LIBRARY=${HOME}/.emscripten_cache/asmjs -DBUILD_TESTING=0 -DBoost_USE_STATIC_LIBS=ON -DBoost_USE_STATIC_RUNTIME=ON -DBUILD_EXEC=OFF -DBUILD_TESTING=OFF ..
I get the following error
CMake Error at /home/../boost_1_71_0/build/lib/cmake/boost_thread-1.71.0/boost_thread-config.cmake:91 (find_package):
Could not find a package configuration file provided by "boost_atomic"
(requested version 1.71.0) with any of the following names:
boost_atomicConfig.cmake
boost_atomic-config.cmake
Add the installation prefix of "boost_atomic" to CMAKE_PREFIX_PATH or set
"boost_atomic_DIR" to a directory containing one of the above files. If
"boost_atomic" provides a separate development package or SDK, be sure it
has been installed.
The boost_atomic-config.cmake is at /home/../boost_1_71_0/build/lib/cmake/boost_atomic-1.71.0/boost_atomic-config.cmake. How should I set the boost_atomic_DIR path to this file, as required above?

I added a flag -Dboost_atomic_DIR=/path/to/.cmake/file in the above command and it worked.

Related

How to install V2X-Hub on Ubuntu 18.04

I am trying to install V2X-Hub following those steps : https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/docs/installation_and_Setup.md
I did the compilation instructions until this one :
« Now, run the following commands from V2X-Hub directory
cd src/v2i-hub
cmake . -DqserverPedestrian_DIR=/usr/local/share/qserverPedestrian/cmake »
And it tells me :
« Cmake Error at CARMACloudPlugin/CMakeLists.txt:10 (find package):
By not providing «Findv2xhubWebAPI.cmake » in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by « v2xhubWebAPI », but Cmake did not find one.
Could not find a package configuration file provided by « v2xhubWebAPI » with any of the following names:
v2xhubWebAPIConfig.cmake
v2xhubwebapi-config.cmake
Add the installation prefix of « v2xhubWebAPI » to CMAKE_PREFIX_PATH or set « v2xhubWebAPI_DIR » to a directory containing one of the above files. If « v2xhubWebAPI » provides a separate development package or SDK, be sure it has been installed. »
Thanking you in advance for your help i am blocked.

find_package with specified version in configuration script name

I need to use mangrove (mongo ODM lib over mongo-c-driver and mongo-cxx-driver) and included this into my project as CMake ExternalProject_Add command, with a dependency on mongo-c-driver/mongo-cxx-driver
mongocxx generates CMake configuration scripts with a names like :
libmongocxx-config.cmake
libmongocxx-config-version.cmake
and no issues to find these by mangrove with that script:
set(LIBMONGOCXX_REQUIRED_VERSION 3.1.3)
set(LIBMONGOCXX_REQUIRED_ABI_VERSION v_noabi)
find_package(libmongocxx ${LIBMONGOCXX_REQUIRED_VERSION} REQUIRED)
However mongo-c-driver generates those scripts with a name which incudes ABI version into file names.
libmongoc-1.0-config.cmake
libmongoc-1.0-config-version.cmake
and similar CMake code:
set(LIBMONGOC_REQUIRED_VERSION 1.7.0)
set(LIBMONGOC_REQUIRED_ABI_VERSION 1.0)
find_package(LibMongoC ${LIBMONGOC_REQUIRED_VERSION} REQUIRED)
can't find out the scripts.
Of course, if I manually remove the version from file names, it can find those files, but I'd like to fix the problem in a script and on mangove side.
So the question about CMake techniques :
Is there an ability to specify the version of package which will automatically used by (inside CMake scripts names) find_package command to look for?
According to find_package documentation, the version is embedded inside the libmongocxx-config-version.cmake file.
This means that if you want to get the package libmongoc-1.0-config.cmake, you should use:
find_package(libmongoc-1.0 ${LIBMONGOC_REQUIRED_VERSION} REQUIRED)

How can i fix tbb on CMake

I have this problem.
CMake Error at CMakeLists.txt:14 (find_package): By not providing
"FindTBB.cmake" in CMAKE_MODULE_PATH this project has asked CMake to
find a package configuration file provided by "TBB", but CMake did
not find one.
I could not find a package configuration file provided by "TBB" with any of the following names:
TBBConfig.cmake
tbb-config.cmake
Add the installation prefix of "TBB" to CMAKE_PREFIX_PATH or set
"TBB_DIR" to a directory containing one of the above files. If
"TBB" provides a separate development package or SDK, be sure it has
been installed.
how can i fix this?
Here is my CMakeLists.txt
cmake_minimum_required(VERSION 3.9)
project(deneme)
set(CMAKE_CXX_STANDARD 11)
include("C:/yunus/Git/inteltbb/tbb/cmake/TBBBuild.cmake")
tbb_build(TBB_ROOT "C:/yunus/Git/inteltbb/tbb" CONFIG_DIR TBB_DIR)
find_package(TBB REQUIRED tbb)
add_executable(deneme main.cpp ToDo.cpp ToDo.h)
TBB does not come by default with a FindTBB.cmake module so the guidelines in the error message are a bit misleading.
If your project provides the corresponding FindTBB.cmake module you need to add the path to it and the path to the TBB installation to your CMake call, i.e.
cmake . -G "<your generator here>" -DTBB_DIR=<path to TBB installation> -DCMAKE_PREFIX_PATH=<path to FindTBB.cmake>
Otherwise you need to download a suitable FindTBB.cmake module e.g. https://github.com/schuhschuh/cmake-basis-modules/blob/develop/FindTBB.cmake
This one uses TBB_ROOT instead of TBB_DIR.
Edit:
Try the binary package integration of TBB first.
Comment the include(...) and the tbb_build(...) command and add
target_link_libraries(deneme ${TBB_IMPORTED_TARGETS})
to your CMakeLists.txt after the add_executable call. Then call
cmake . -G "<your generator here>" -DCMAKE_PREFIX_PATH=<path to your TBB installation>

Error during the compilation of DicomToMesh

I'm trying to compile DicomToMesh following this tutorial. At some point,it says to do :
`ccmake ..` #opens ccmake window
Within the ccmake window, pass the path to your vtk installation or vtk build directory. In my case, it looks like that :
CMAKE_BUILD_TYPE DEBUG
CMAKE_INSTALL_PREFIX /usr/local
USE_VTK_DICOM OFF
VTK_DIR /home/eidelen/Development/libs/vtk/build
Press c and then g. Now you are back in terminal and ready to build.
make
well,since after the compilation of the VTK package I got this message :
Build files have been written to: /mnt/c/Users/"Mario
Zio"/Desktop/OrtogOn/Tools/VTK-Release-build"
on the VTK_DIR I tried to write :
/mnt/c/Users/"Mario Zio"/Desktop/OrtogOn/Tools/VTK-Release-build
or
/mnt/c/Users/"Mario Zio"/Desktop/OrtogOn/Tools/VTK-build
but they aren't accepted. The error message is :
CMake Error at lib/CMakeLists.txt:5 (find_package):
By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "VTK", but CMake did not find one. Could not find a package configuration file provided by "VTK" with any of the following names:
VTKConfig.cmake
vtk-config.cmake
Add the installation prefix of "VTK" to CMAKE_PREFIX_PATH or set "VTK_DIR"
to a directory containing one of the above files. If "VTK" provides a
separate development package or SDK, be sure it has been installed.
Also,according with this thread,I have also used these paths as VTK_DIR inside the ccmake window :
/mnt/c/Users/"Mario Zio"/Desktop/OrtogOn/Tools//VTK-Release-build/bin
/mnt/c/Users/"Mario Zio"/Desktop/OrtogOn/Tools/VTK-build/bin
but the error I get is always the same. What should I do ?
NB 1 : Inside the bin folders of the VTK tool I see no files. Is this correct ?
NB 2 : I'm using the ubuntu bash that I have installed on windows 10.

Cap'n Proto CMake support: CAPNP_LIB_CAPNP-JSON is NOTFOUND

Why do I have to set
set(CAPNP_LIB_CAPNP-JSON "")
in my CMakeLists.txt in order to not get an error? Error as follows:
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:
CAPNP_LIB_CAPNP-JSON (ADVANCED)
linked by target "client" in directory <...>
linked by target "server" in directory <...>
The way I'm using capnproto CMake support is by copying the cmake file included in the capnproto source into my project and including it manually. (Is there a better / standard way to do this? Feels hackish.) The rest is just taken from the CMake file's instructions.
CMake snippet:
# so capnp cmake plugin is found
set(CapnProto_DIR "${CMAKE_CURRENT_SOURCE_DIR}/etc/cmake")
# for some reason there is some json lib or something that isn't found?
#set(CAPNP_LIB_CAPNP-JSON "")
find_package(CapnProto REQUIRED)
include_directories(${CAPNP_INCLUDE_DIRS})
add_definitions(${CAPNP_DEFINITIONS})
set(CAPNPC_SRC_PREFIX "src/capnp")
# capnp out of source config
set(CAPNPC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CAPNPC_OUTPUT_DIR})
# gen cpp
capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS
src/capnp/schema.capnp
)
CMake 3.6.2, building using CLion's integrated build commands. capnp is installed via homebrew, latest version.
Why am I getting the error about the JSON bit? What is that about?
Also, is there a better way for including the official Cap'n Proto CMake file? It seemed to not get distributed with the header and library files when installing via homebrew.
It turns out json encoding/decoding support is an as yet (Oct 2016) unreleased feature of Cap'n Proto and trying to use the .cmake file from the master branch with the last released version produces this conflict.
Possible solutions:
1) Use workaround posted in the question, i.e.
set(CAPNP_LIB_CAPNP-JSON "") # add this before next line
find_package(CapnProto REQUIRED)
2) Use the released version of the .cmake script here: FindCapnProto.cmake
3) Build and install Cap'n Proto from source, use with latest .cmake script.