Failed to Create Meshlab Visual Studio 2013 Project - c++

I'm trying to open meshlab project in visual studio 2013. I did install Cmake and Qt 5.3.0 on my windows 10 and then run this command :
cmake .. -G "Visual Studio 12 Win64"
and after running that :
-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working C compiler using: Visual Studio 12 2013 Win64
-- Check for working C compiler using: Visual Studio 12 2013 Win64 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 12 2013 Win64
-- Check for working CXX compiler using: Visual Studio 12 2013 Win64 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
*** Configuring MeshLab Version 1.3.2 ****
-- Found OpenGL: opengl32
-- Looking for include file dlfcn.h
-- Looking for include file dlfcn.h - not found
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Looking for include file memory.h
-- Looking for include file memory.h - found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file stdlib.h
-- Looking for include file stdlib.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - not found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file sys/stat.h
-- Looking for include file sys/stat.h - found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - not found
-- Looking for cos in m
-- Looking for cos in m - not found
-- lmdemo will be linked against levmar;lapack;blas;f2c
CMake Error at E:/MyWorkSpace/Meshinator/Qt/Qt5.3.0/5.3/msvc2013_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:14 (message):
Failed to find "glu32" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE "".
Call Stack (most recent call first):
E:/MyWorkSpace/Meshinator/Qt/Qt5.3.0/5.3/msvc2013_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:50 (_qt5gui_find_extra_libs)
E:/MyWorkSpace/Meshinator/Qt/Qt5.3.0/5.3/msvc2013_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:152 (include)
E:/MyWorkSpace/Meshinator/Qt/Qt5.3.0/5.3/msvc2013_64_opengl/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:94 (find_package)
src/other/structuresynth/CMakeLists.txt:17 (find_package)
-- Configuring incomplete, errors occurred!
See also "E:/MyWorkSpace/Meshinator/meshlab-master/_build/CMakeFiles/CMakeOutput.log".
See also "E:/MyWorkSpace/Meshinator/meshlab-master/_build/CMakeFiles/CMakeError.log".
As you see I get this error from cmak :
CMake Error at E:/MyWorkSpace/Meshinator/Qt/Qt5.3.0/5.3/msvc2013_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:14 (message):
Failed to find "glu32" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE "".
I did google that error and find this answer :
To solve the problem use this line : set (CMAKE_LIBRARY_PATH “C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64”)
Now I don't know where I can add this line? please help me!

Add it to the CMakeList.txt that apperantly recides on the higher level directory from where you try to run CMake.

Related

Using vcpkg to install RTABMap with VSCode as editor

I want to install RTABMap with vcpkg and then use VSCode as editor to include RTABMap into my C++ project. I installed RTABMap as described on their wiki with vcpkg install rtabmap:x64-windows (i also tried the x86 triplet) and then wanted to use it in my project. To get started I wrote the following cmake file based on an example from their repository:
cmake_minimum_required(VERSION 3.5)
project(RTABMap_Test VERSION 0.1.0)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
find_package(RTABMap REQUIRED)
find_package(OpenCV REQUIRED)
set(INCLUDE_DIRS
${RTABMap_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
set(LIBRARIES
${RTABMap_LIBRARIES}
${OpenCV_LIBRARIES}
)
include_directories(${INCLUDE_DIRS})
add_executable(RTABMap_Test main.cpp)
target_link_libraries(RTABMap_Test ${LIBRARIES})
and the following main.cpp file:
#include <rtabmap/core/Rtabmap.h>
int main(void) {
return 0;
}
The cmake settings in VSCode are as follows:
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "G:/.vcpkg/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "x64-windows"
}
However, when I run CMake: Build from VSCode, cmake fails with the following message:
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at G:/.vcpkg/installed/x64-windows/share/rtabmap/RTABMapConfig.cmake:78 (MESSAGE):
Asked for "gui" module but RTABMap hasn't been built with gui support.
Call Stack (most recent call first):
G:/.vcpkg/scripts/buildsystems/vcpkg.cmake:843 (_find_package)
CMakeLists.txt:6 (find_package)
-- Found RTABMap: RTABMap_CORE_RELEASE-NOTFOUND;RTABMap_UTILITE_RELEASE-NOTFOUND;optimized;G:/.vcpkg/installed/x64-windows/lib/zlib.lib;debug;G:/.vcpkg/installed/x64-windows/debug/lib/zlibd.lib
-- Found Protobuf: G:/.vcpkg/installed/x64-windows/tools/protobuf/protoc.exe (found version "3.21.12.0")
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found TIFF: optimized;G:/.vcpkg/installed/x64-windows/lib/tiff.lib;debug;G:/.vcpkg/installed/x64-windows/debug/lib/tiffd.lib (found version "4.5.0")
-- Found HDF5: hdf5::hdf5-shared (found version "1.12.2")
-- Found ZLIB: optimized;G:/.vcpkg/installed/x64-windows/lib/zlib.lib;debug;G:/.vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found suitable version "1.2.13", minimum required is "1")
-- Found JPEG: optimized;G:/.vcpkg/installed/x64-windows/lib/jpeg.lib;debug;G:/.vcpkg/installed/x64-windows/debug/lib/jpeg.lib (found version "62")
-- Found ZLIB: optimized;G:/.vcpkg/installed/x64-windows/lib/zlib.lib;debug;G:/.vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.13")
-- Found PNG: optimized;G:/.vcpkg/installed/x64-windows/lib/libpng16.lib;debug;G:/.vcpkg/installed/x64-windows/debug/lib/libpng16d.lib (found version "1.6.39")
-- Found GIF: optimized;G:/.vcpkg/installed/x64-windows/lib/gif.lib;debug;G:/.vcpkg/installed/x64-windows/debug/lib/gif.lib (found version "5.2.1")
-- Found LibArchive: G:/.vcpkg/installed/x64-windows/debug/lib/archive.lib (found version "3.6.2")
-- Found OpenCV: G:/.vcpkg/installed/x64-windows (found version "4.7.0")
-- 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:
RTABMap_CORE_RELEASE
linked by target "RTABMap_Test" in directory G:/FKIE/rtabmap_test
RTABMap_UTILITE_RELEASE
linked by target "RTABMap_Test" in directory G:/FKIE/rtabmap_test
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
On the other hand, when I run cmake . -DCMAKE_TOOLCHAIN_FILE=G:/.vcpkg/scripts/buildsystems/vcpkg.cmake I get this error:
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
CMake Warning at G:/.vcpkg/installed/x64-windows/share/rtabmap/RTABMapConfig.cmake:78 (MESSAGE):
Asked for "gui" module but RTABMap hasn't been built with gui support.
Call Stack (most recent call first):
G:/.vcpkg/scripts/buildsystems/vcpkg.cmake:843 (_find_package)
CMakeLists.txt:6 (find_package)
-- Found ZLIB: optimized;G:/.vcpkg/installed/x64-windows/lib/zlib.lib;debug;G:/.vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found suitable version "1.2.13", minimum required is "1")
-- Found ZLIB: optimized;G:/.vcpkg/installed/x64-windows/lib/zlib.lib;debug;G:/.vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.13")
-- 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:
RTABMap_CORE_RELEASE
linked by target "RTABMap_Test" in directory G:/FKIE/rtabmap_test
RTABMap_UTILITE_RELEASE
linked by target "RTABMap_Test" in directory G:/FKIE/rtabmap_test
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
The two missing variables are set in the RTABMapConfig.cmake.in located at the root directory of the RTABMap repository and used by the CMakeLists.txt, so I assume that I don't have to set them manually, meaning -- as far as I can tell -- when vcpkg installs RTABMap it doesn't properly configure RTABMap.
What to do?
I had to write this as an answer due to character limitation. It's however more of a hint on what to look at rather then how to fix it.
Let's take a look at how RTABMapConfig.cmake is generated via the precursor file RTABMapConfig.cmake.in:
Lines 18-21:
find_library(RTABMap_CORE_RELEASE NAMES rtabmap_core NO_DEFAULT_PATH HINTS #CONF_LIB_DIR#)
find_library(RTABMap_CORE_DEBUG NAMES rtabmap_cored NO_DEFAULT_PATH HINTS #CONF_LIB_DIR#)
IF(RTABMap_CORE_DEBUG AND RTABMap_CORE_RELEASE)
#...
Not ideal for a .cmake.in but I'm not going to judge that. All that I'm going to say is that parts of the code rely on certain variables being set. The same variables that were "NOT FOUND" in your generation i.e. this line in the generation step:
-- [...] RTABMap_CORE_RELEASE-NOTFOUND [...]
If you would traverse the .cmake.in file down you would notice the same for the other "NOT FOUND" variable.
Later on we have:
Line 47:
set(RTABMap_LIBRARIES ${RTABMap_CORE} ${RTABMap_UTILITE})
Which is (as you probably know by now) empty.
Conclusion and possible solutions:
The RTABMapConfig.cmake can't find the proper libraries (if they exist) this can be caused either by the fact that during the vcpkg install phase something went wrong and the libraries weren't built OR the RTABMapConfig.cmake was poorly generated and needs to be fixed (the paths to the core and utilite libraries specifically)
Check if something like rtabmap_core.lib exists and if not - compilation failed and you need to reinstall rtabmap
If ad1) isn't the case then open up the RTABMapConfig.cmake and look at the paths to these libraries - fix them if needed.
EDIT: If I were you I would open up an issue on vcpkg's github.

How can I skip CMake compiler identification?

I'm running some tests on my software environment. This does hundreds of calls to CMake to configure many projects, always using the same compiler.
For every call to CMake, it checks the compiler:
-- Selecting Windows SDK version to target Windows 10.0.16299.
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
This takes a while and is useless to be done many time as it will always end with the same result on the machine running those tests.
Is there no way to "cache" compiler check result and have it be done once only?
fdan recommended (in a comment) to add a top level CMake projects adding all sub-projects using add_subdirectory. I did not try that but it looks like something that would wok.
In the mean time, I found an alternative is to:
Create an empty CMakeLists.txt file
Run CMake on it, it checks the compiler. This produces some files including a CMakeCache.txt and a CMakeFiles folder.
For every next project you will run CMake on
Copy the output of the first run you did with the empty project (including CMakeCache.txt and a CMakeFiles folder)
Modify CMakeCache.txt content to reference the new project folder instead of the old one (else Cmake will report CMake Error: The current CMakeCache.txt directory ... is different than the directory ... where CMakeCache.txt was created).
Then compiler check will not be processed when you'll configure the next project

How to handle with 'Policy CMP0074 is not set' warning while using Cmake to build PCL tutorials?

I want to complete this basic tutorial:
http://pointclouds.org/documentation/tutorials/writing_pcd.php#writing-pcd
Its very simple. When I prepare CMakeLists.txt and .cpp file, I run them with CMake GUI and I get this warning. I installed PCL 1.9.1 so I build file for Visual Studio 2017 64x.
Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.17763.
The C compiler identification is MSVC 19.15.26726.0
The CXX compiler identification is MSVC 19.15.26726.0
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:5(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.
Environment variable PCL_ROOT is set to:
C:\libraries\PCL 1.9.1
For compatibility, CMake is ignoring the variable. This warning is for project developers. Use -Wno-dev to suppress it.
Found Eigen: C:/libraries/PCL 1.9.1/3rdParty/Eigen/eigen3
Eigen found (include: C:/libraries/PCL 1.9.1/3rdParty/Eigen/eigen3, version: 3.3.5)
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
Found Boost: C:/libraries/PCL 1.9.1/3rdParty/Boost/include/boost-1_68 (found suitable version "1.68.0", minimum required is "1.40.0") found components: system filesystem thread date_time iostreams serialization chrono atomic regex
Found FLANN: C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s.lib FLANN found (include: C:/libraries/PCL 1.9.1/3rdParty/FLANN/include, lib: optimized;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s-gd.lib)
FLANN found (include: C:/libraries/PCL 1.9.1/3rdParty/FLANN/include, lib: optimized;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s-gd.lib)
Found OpenNI2: C:/libraries/OpenNI2/Lib/OpenNI2.lib
OpenNI2 found (include: C:/libraries/OpenNI2/Include, lib: C:/libraries/OpenNI2/Lib/OpenNI2.lib)
OpenNI2 found (include: C:/libraries/OpenNI2/Include, lib: C:/libraries/OpenNI2/Lib/OpenNI2.lib)
Found Qhull: optimized;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic_d.lib
QHULL found (include: C:/libraries/PCL 1.9.1/3rdParty/Qhull/include, lib: optimized;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic_d.lib)
looking for PCL_COMMON
Found PCL_COMMON: C:/libraries/PCL 1.9.1/lib/pcl_common_release.lib
looking for PCL_KDTREE
Found PCL_KDTREE: C:/libraries/PCL 1.9.1/lib/pcl_kdtree_release.lib looking for PCL_OCTREE
Found PCL_OCTREE: C:/libraries/PCL 1.9.1/lib/pcl_octree_release.lib
looking for PCL_SEARCH
Found PCL_SEARCH: C:/libraries/PCL 1.9.1/lib/pcl_search_release.lib
looking for PCL_SAMPLE_CONSENSUS
Found PCL_SAMPLE_CONSENSUS: C:/libraries/PCL 1.9.1/lib/pcl_sample_consensus_release.lib
looking for PCL_FILTERS
Found PCL_FILTERS: C:/libraries/PCL 1.9.1/lib/pcl_filters_release.lib
looking for PCL_2D
Found PCL_2D: C:/libraries/PCL 1.9.1/include/pcl-1.9
looking for PCL_GEOMETRY
Found PCL_GEOMETRY: C:/libraries/PCL 1.9.1/include/pcl-1.9
looking for PCL_IO
Found PCL_IO: C:/libraries/PCL 1.9.1/lib/pcl_io_release.lib
looking for PCL_FEATURES
Found PCL_FEATURES: C:/libraries/PCL 1.9.1/lib/pcl_features_release.lib looking for PCL_ML
Found PCL_ML: C:/libraries/PCL 1.9.1/lib/pcl_ml_release.lib
looking for PCL_SEGMENTATION
Found PCL_SEGMENTATION: C:/libraries/PCL 1.9.1/lib/pcl_segmentation_release.lib
looking for PCL_VISUALIZATION
Found PCL_VISUALIZATION: C:/libraries/PCL 1.9.1/lib/pcl_visualization_release.lib
looking for PCL_SURFACE
Found PCL_SURFACE: C:/libraries/PCL 1.9.1/lib/pcl_surface_release.lib
looking for PCL_REGISTRATION
Found PCL_REGISTRATION: C:/libraries/PCL 1.9.1/lib/pcl_registration_release.lib
looking for PCL_KEYPOINTS
Found PCL_KEYPOINTS: C:/libraries/PCL 1.9.1/lib/pcl_keypoints_release.lib
looking for PCL_TRACKING
Found PCL_TRACKING: C:/libraries/PCL 1.9.1/lib/pcl_tracking_release.lib
looking for PCL_RECOGNITION
Found PCL_RECOGNITION: C:/libraries/PCL 1.9.1/lib/pcl_recognition_release.lib
looking for PCL_STEREO
Found PCL_STEREO: C:/libraries/PCL 1.9.1/lib/pcl_stereo_release.lib
looking for PCL_OUTOFCORE
Found PCL_OUTOFCORE: C:/libraries/PCL 1.9.1/lib/pcl_outofcore_release.lib
looking for PCL_PEOPLE
Found PCL_PEOPLE: C:/libraries/PCL 1.9.1/lib/pcl_people_release.lib
Found PCL: pcl_common;pcl_kdtree;pcl_octree;pcl_search;pcl_sample_consensus;pcl_filters;pcl_io;pcl_features;pcl_ml;pcl_segmentation;pcl_visualization;pcl_surface;pcl_registration;pcl_keypoints;pcl_tracking;pcl_recognition;pcl_stereo;pcl_outofcore;pcl_people;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_system-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_system-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_filesystem-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_filesystem-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_thread-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_thread-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_date_time-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_date_time-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_iostreams-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_iostreams-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_serialization-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_serialization-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_chrono-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_chrono-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_atomic-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_atomic-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_regex-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_regex-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic_d.lib;C:/libraries/OpenNI2/Lib/OpenNI2.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s-gd.lib;vtksys;vtkCommonCore;vtkCommonMath;vtkCommonMisc;vtkCommonSystem;vtkCommonTransforms;vtkCommonDataModel;vtkCommonColor;vtkCommonExecutionModel;vtkCommonComputationalGeometry;vtkFiltersCore;vtkFiltersGeneral;vtkImagingCore;vtkImagingFourier;vtkalglib;vtkFiltersStatistics;vtkFiltersExtraction;vtkInfovisCore;vtkFiltersGeometry;vtkFiltersSources;vtkRenderingCore;vtkzlib;vtkfreetype;vtkRenderingFreeType;vtkRenderingContext2D;vtkChartsCore;vtkDICOMParser;vtklz4;vtkIOCore;vtkIOLegacy;vtkexpat;vtkIOXMLParser;vtkDomainsChemistry;vtkIOXML;vtkParallelCore;vtkFiltersAMR;vtkFiltersFlowPaths;vtkFiltersGeneric;vtkImagingSources;vtkFiltersHybrid;vtkFiltersHyperTree;vtkImagingGeneral;vtkFiltersImaging;vtkFiltersModeling;vtkFiltersParallel;vtkFiltersParallelImaging;vtkFiltersPoints;vtkFiltersProgrammable;vtkFiltersSMP;vtkFiltersSelection;vtkFiltersTexture;vtkFiltersTopology;verdict;vtkFiltersVerdict;vtkmetaio;vtkjpeg;vtkpng;vtktiff;vtkIOImage;vtkImagingHybrid;vtkInfovisLayout;vtkInteractionStyle;vtkImagingColor;vtkRenderingAnnotation;vtkRenderingVolume;vtkInteractionWidgets;vtkViewsCore;vtkproj4;vtkGeovisCore;vtkhdf5_hl;vtkhdf5;vtkIOAMR;vtkIOEnSight;vtkNetCDF;vtkexoIIc;vtkIOExodus;vtkRenderingOpenGL;vtkRenderingContextOpenGL;vtkgl2ps;vtkRenderingGL2PS;vtklibharu;vtkIOExport;vtkRenderingLabel;vtkIOExportOpenGL;vtkIOGeometry;vtkIOImport;vtklibxml2;vtkIOInfovis;vtkIOLSDyna;vtkIOMINC;vtkoggtheora;vtkIOMovie;vtknetcdfcpp;vtkIONetCDF;vtkIOPLY;vtkjsoncpp;vtkIOParallel;vtkIOParallelXML;vtksqlite;vtkIOSQL;vtkIOTecplotTable;vtkIOVideo;vtkImagingMath;vtkImagingMorphological;vtkImagingStatistics;vtkImagingStencil;vtkInteractionImage;vtkRenderingImage;vtkRenderingLIC;vtkRenderingLOD;vtkRenderingVolumeOpenGL;vtkViewsContext2D;vtkViewsInfovis (Required is at least version "1.2")
Configuring done
Generating done
After build, when I click open project and run it, I get this error.
Any solution for it?
The CMP0074 warning is not really a problem you as a user need to worry about. It's a warning for the developer of the CMakeLists.txt that a behavior in CMake has changed.
https://cmake.org/cmake/help/latest/policy/CMP0074.html
In CMake 3.12 and above the find_package() command now
searches prefixes specified by the _ROOT CMake variable
and the ROOT environment variable. Package roots are
maintained as a stack so nested calls to all find* commands inside
find modules also search the roots as prefixes. This policy provides
compatibility with projects that have not been updated to avoid using
_ROOT variables for other purposes.
The OLD behavior for this policy is to ignore _ROOT
variables. The NEW behavior for this policy is to use
_ROOT variables.
Basically the warning is that the developers of the CMakeLists.txt have not set the policy to enable the new behavior or to keep the old behavior however the PCL_ROOT was defined. CMake will not automatically use it because the new behavior is not enabled.
The ALL_BUILD error message is because the ALL_BUILD target / project is not an executable target. It's purpose is to force building of all projects in the solution. To fix that part you need to right click on an executable project / target in the Solution Explorer and click "Set this project as the startup project"

Unexpected behavior by VS 2017 when compiling a CMake project that works on Linux

I have a CMake project that works fine on Linux with g++.
On Windows (10, Creators Update) CMake runs fine and generates relevant files.
So I opened TestProject.sln solution file and for a test run, I ran 'Local Windows Debugger' and got this error.
Error LNK1104 cannot open file 'jsoncpp.lib'
This is how I've setup this project.
.
|-root
| |- src
| |- lib
| |- bin
| |- app
| |- include
| |- extras
| |- jsoncpp
|-build
I'm not really sure what could be wrong here.
I have jsoncpp added as a submodule.
I did
git submodule update --init --recursive
and there is a jsoncpp.lib file in
root\lib\Debug
This is my CMakeLists.txt
cmake_minimum_required (VERSION 3.13)
project (TestProject)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/root/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/root/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/root/bin)
set(SOURCE_DIR ${PROJECT_SOURCE_DIR}/root/src)
set(INCLUDE_DIR ${PROJECT_SOURCE_DIR}/root/include)
set(EXTRAS_DIR ${PROJECT_SOURCE_DIR}/root/extras)
set(PROJECT_MAIN_DIR ${PROJECT_SOURCE_DIR}/root/app)
set(SOURCES
${INCLUDE_DIR}/Combinations.hpp
${INCLUDE_DIR}/Lib.hpp
${SOURCE_DIR}/Lib.cpp
)
add_executable(TestProject ${PROJECT_MAIN_DIR}/Main.cpp ${SOURCES})
add_subdirectory(${EXTRAS_DIR}/jsoncpp jsoncpp)
target_link_libraries(TestProject jsoncpp)
set_target_properties(TestProject PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_STANDARD 17
CXX_EXTENSIONS OFF
)
This is CMake's output
Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
The C compiler identification is MSVC 19.16.27026.1
The CXX compiler identification is MSVC 19.16.27026.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
JsonCpp Version: 1.8.4
Looking for C++ include clocale
Looking for C++ include clocale - found
Looking for localeconv
Looking for localeconv - found
Looking for C++ include sys/types.h
Looking for C++ include sys/types.h - found
Looking for C++ include stdint.h
Looking for C++ include stdint.h - found
Looking for C++ include stddef.h
Looking for C++ include stddef.h - found
Check size of lconv
Check size of lconv - done
Performing Test HAVE_DECIMAL_POINT
Performing Test HAVE_DECIMAL_POINT - Success
Found PythonInterp: C:/Users/USERNAME/emacs-26.1-x86_64/bin/python2.exe (found suitable version "2.7.14", minimum required is "2.6")
Configuring done
Generating done
I'm not very familiar with Visual Studio but looking at the error, it says 'cannot open' and not 'couldn't find' so my first thought was maybe it's a permission issue.
So I booted up VS with Admin Privileges but the error continued.
I thought maybe there's some compiler issue so I used nmake.exe as a compiler (after generating nmake makefiles) but no luck there either.
I'm not sure if it's a linker issue since CMake was able to find and link jsoncpp library so I doubt CMake made a mistake building the Makefile.
I'm not sure how I should go about debugging the issue.

Building cpp-netlib with CMake

I've downloaded the cpp-netlib source, extracted it to a folder and for some reason I'm completely lost. I read the documentation carefully, it states I have to download CMake as well, which I did. Then I set the source directory and build directories, and upon clicking the "Generate" button I got this output:
The CXX compiler identification is MSVC 19.0.23506.0
Check for working C compiler using: Visual Studio 14 2015
Check for working C compiler using: Visual Studio 14 2015 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 14 2015
Check for working CXX compiler using: Visual Studio 14 2015 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/FindBoost.cmake:1657 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
CMakeLists.txt:49 (find_package)
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
CMake Error at CMakeLists.txt:131 (export):
export given target "cppnetlib-client-connections" which is not built by
this project.
Configuring incomplete, errors occurred!
See also "C:/Users/Nick/Documents/cpp-netlib/cpp-netlib-build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Nick/Documents/cpp-netlib/cpp-netlib-build/CMakeFiles/CMakeError.log"
It couldn't find the Boost libraries, and that's where I'm stuck. I installed boost, but I have no idea where to set "BOOST_ROOT". I did some research on that, tried to use the command line with the -DBOOST_ROOT option like so:
c:\Program Files>cmake -DBOOST_ROOT=/boost/boost_1_55_0
But it gives me the following error:
CMake Error: The source directory "C:/Program Files" does not appear to contain
CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
I'm really unsure as to what to do now and I feel this isn't the end of my problems... Is there anything obvious I'm missing?
You need to either run cmake from the source tree (which would contain CMakeLists.txt), or, more typically, run it from a build folder and tell it where the source tree is.
A common case would be creating a build folder next to the source tree and running cmake ../sourcedir.
You seem to have initially been using a gui; surely that provides a means to set the BOOST_ROOT variable?
Alternatively, if you just put boost in the VC++ include/lib paths (either in the vc dirs, or by setting %INCLUDE%/%LIB%), you probably would not need BOOST_ROOT. Same for OpenSSL.