Error during the compilation of DicomToMesh - c++

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.

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.

How wxWidgets cmake find in window

I can't find wxWidget on window. The error is:
CMake Error at E:/Program Files/JetBrains/CLion 2020.2.1/bin/cmake/win/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
wxWidgets_INCLUDE_DIRS)`
My Env:
win10
cmake 3.17
wxWidgets 3.1.4
I use cmake to build and install the wxWidgets
mkdir build
cd build
cmake .. -config Release
cmake --build .
cmake --install .
Which install wxWidgets in D:/Program Files(x86)/wxWidgets.
The I set the env variable wxWidgets_ROOT_DIR to D:\Program Files (x86), because that's a code snnipt in cmake's script FindWxWidgets.cmake.
find_path(wxWidgets_ROOT_DIR
NAMES include/wx/wx.h
PATHS
ENV wxWidgets_ROOT_DIR
ENV WXWIN
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" # WX 2.6.x
C:/
D:/
ENV ProgramFiles
PATH_SUFFIXES
wxWidgets-3.1.0
wxWidgets-3.0.2
wxWidgets-3.0.1
wxWidgets-3.0.0
wxWidgets-2.9.5
wxWidgets-2.9.4
wxWidgets-2.9.3
wxWidgets-2.9.2
wxWidgets-2.9.1
wxWidgets-2.9.0
wxWidgets-2.8.9
wxWidgets-2.8.8
wxWidgets-2.8.7
wxWidgets-2.8.6
wxWidgets-2.8.5
wxWidgets-2.8.4
wxWidgets-2.8.3
wxWidgets-2.8.2
wxWidgets-2.8.1
wxWidgets-2.8.0
wxWidgets-2.7.4
wxWidgets-2.7.3
wxWidgets-2.7.2
wxWidgets-2.7.1
wxWidgets-2.7.0
wxWidgets-2.7.0-1
wxWidgets-2.6.4
wxWidgets-2.6.3
wxWidgets-2.6.2
wxWidgets-2.6.1
wxWidgets-2.5.4
wxWidgets-2.5.3
wxWidgets-2.5.2
wxWidgets-2.5.1
wxWidgets
DOC "wxWidgets base/installation directory"
)
I think I have config right the wxWidgets_ROOT_DIR. Because I message the varialbe message(wxWidgets_ROOT_DIR " " ${wxWidgets_ROOT_DIR}) and It show the right value:
D:/Program Files(x86)/wxWidgets
The I use find_libarray(wxWidgets Required) in my project to find wxWidgets, and it shows the above error.
My question is:
How to fix it.
Or what find_package(xxx) do on window?
Update:
I finally find it's clion issue that use his cmake not the stand cmake. I use the stand cmake with vscode. And they works fine.
I also had problems with wxWidgets installation on Windows and CLion, I' ve followed these steps:
Download MinGW(32) and set as the default compiler for CLion (I had problems with other compilers)
Download the windows installer of wxWidgets from the official site (https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxMSW-3.1.4-Setup.exe)
The installer will download all the files of the library in "C:\wxWidgets-3.1.4" and will also create the environment variable WXWIN that will contain the path of the folder "C:\wxWidgets-3.1.4"
Compile the library following this tutorial for MinGW https://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW (make a coffee, it will take a while)
The compiler will but object files in "C:\wxWidgets-3.1.4\lib\gcc_dll", in "C:\wxWidgets-3.1.4\build\msw\gcc_mswudll" and probably in other places based on the instruction files in the "C:\wxWidgets-3.1.3\build" folder
After the compilation you need to add "C:/wxWidgets-3.1.4/lib/gcc_dll" in the environment variable PATH of the OS
After a restart write this code in the CMakeLists of your project:
cmake_minimum_required(VERSION 3.17)
project(your project name)
set(CMAKE_CXX_STANDARD 20)
SET(wxWidgets_USE_LIBS)
#for using RichTextCtrl
FIND_PACKAGE(wxWidgets REQUIRED richtext aui adv html core xml net base)
IF(wxWidgets_FOUND)
INCLUDE("${wxWidgets_USE_FILE}")
add_executable(your list of executables)
TARGET_LINK_LIBRARIES(note ${wxWidgets_LIBRARIES})
ELSE(wxWidgets_FOUND)
#for convenience. When we cannot continue,inform the user
MESSAGE("wxWidgets not found!")
ENDIF(wxWidgets_FOUND)
And now wxWidgets should work
I was able to build the samples using CLion and CMake on Mac OS, but much of what I learned should be similar, given CLion's cross-platform nature. The directions are very long, so here is a link:
https://forums.wxwidgets.org/viewtopic.php?p=197038#p187276

Could not find a package configuration file provided by "boost_atomic"

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.

Qt - How to write a FindXXX.cmake file for a certain Qt library

So I really want to start developing my Qt project inside a different IDE (Clion to be exact). I've written my CMake file for the project. It successfully finds Qt Core, Widgets and other libraries but when it comes to including Qt Charts Cmake throws an error:
CMake Error at CMakeLists.txt:44 (find_package):
By not providing "FindQt5Charts.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Charts", but CMake did not find one.
This error is successfully removed when I add by hand a "FindQt5Charts.cmake" file in my CLion>bin>Cmake>share>modules (where FindQt.cmake and othere search package files are) but as of now this file is empty.
The Cmake compiles successfully but since it hasn't found the library I'm looking for, my project won't compile. I need your help to write "FindQt5Charts.cmake" file because I'm not 100% sure of its syntax.
NOTE: Qt Charts is installed and its folder could be found in Qt's installation directory. I just need the code for the FindQt5Charts.cmake.
Here's a reference to the FindQt.cmake file
Here is how the beggining of my project's cmake looks:
#Pull needed header files generated by QT first
set(QT_GENERATED qtGenerated)
add_custom_target(${QT_GENERATED})
#Get all header files in the directory
file(GLOB QT_GEN_HEADERS ${QT_BIN}/*.h)
#Copy them to the project dir
foreach (QT_GEN_HEADERS ${QT_GEN_HEADERS})
add_custom_command(TARGET ${QT_GENERATED} PRE_BUILD COMMAND
${CMAKE_COMMAND} -E copy_if_different
${QT_GEN_HEADERS} ${CMAKE_SOURCE_DIR})
endforeach ()
# Find the Qt libraries
foreach (QT_LIBRARIES_REQUIRED ${QT_LIBRARIES_REQUIRED})
find_package(${QT_LIBRARIES_REQUIRED} REQUIRED)
endforeach ()

CMake not providing "Findlibusb-1.0.cmake" error

I am receiving the following CMake Error:
Errors << project_ros:cmake
/home/nando/project_ws/logs/project_ros/build.cmake.020.log CMake
Error at /home/nando/project_ws/src/project_ros/CMakeLists.txt:22
(find_package): By not providing "Findlibusb-1.0.cmake" in
CMAKE_MODULE_PATH this project has asked CMake to find a package
configuration file provided by "libusb-1.0", but CMake did not find
one.
Could not find a package configuration file provided by "libusb-1.0"
with any of the following names:
libusb-1.0Config.cmake
libusb-1.0-config.cmake
Add the installation prefix of "libusb-1.0" to CMAKE_PREFIX_PATH or
set "libusb-1.0_DIR" to a directory containing one of the above
files. If "libusb-1.0" provides a separate development package or
SDK, be sure it has been installed.
However, I think I am providing "Findlibusb-1.0.cmake" in CMAKE_MODULE_PATH correctly.
This is in my CMakeLists.txt:
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/project_ros/cmakeModules/")
And in src/project_ros/cmakeModules I have Findlibusb-1.0.cmake.
In this thread the same error was appearing but the reason was a typo I don't have.
Any other idea?