How to say to cmake where to find ICU binaries - c++

I'm trying to generate visual studio project for MeTA sources using cmake (tryied both shell and gui) tool. However at the current moment it's fails when trying to resolve ICU components, since building from sources not available on Windows, and it's not find binaries (even if they placed the same directory). CMake file for ICU is there
At the current moment it's fails with this error:
-- Searching for ICU 57.1
-- ICU not found; attempting to build it...
-- ICU building not supported on Windows.
CMake Error at deps/meta-cmake/FindOrBuildICU.cmake:49 (message):
-- Please download the latest ICU binaries from http://site.icu-project.org/download
Call Stack (most recent call first):
CMakeLists.txt:51 (FindOrBuildICU)
So my question is - how could I say for cmake where to get binaries and satisfy ICU requirements?

Related

Problem with installing Shark machine learning library

I am Installing Shark machine learning library in my Laptop which its config is :
CPU: CoreI7 10th generation
GPU: Radeon RX640
OS: Windows 10
IDE: Visual studio 2019
according to shark website help, Boost library must be installed before any action .
I got the Boost library boost_1_74_0-msvc-14.2-64 from its boost website. Running the exe makes a folder C:\local\boost_1_74_0
some helps from Youtube says it is enough to install boost and use the addresses belong to this folder and some other helps says you must build it , so I did two ways separately for two kind of installing.
After that , I got the shark library from its official website
or
http://image.diku.dk/shark/sphinx_pages/build/html/rest_sources/downloads/downloads.html
I started to extract it and put it in a source folder and then I made a build folder near it.
I run the CMAKE and put the source address in the source text box and build address in the build text box.
then I made to entries to CMAKE : BOOST_ROOT:C:\local\boost_1_74_0 and BOOST_LIBRARYDIR:C:\local\boost_1_74_0\lib64-msvc-14.2
the I configured it , some messages were in the output page in the CMAKE:
CMake Warning at C:/Program
Files/CMake/share/cmake-3.17/Modules/FindBoost.cmake:1179 (message):
New Boost version may have incorrect or missing dependencies and
imported targets Call Stack (most recent call first): C:/Program
Files/CMake/share/cmake-3.17/Modules/FindBoost.cmake:1303
(_Boost_COMPONENT_DEPENDENCIES) C:/Program
Files/CMake/share/cmake-3.17/Modules/FindBoost.cmake:1904
(_Boost_MISSING_DEPENDENCIES) Test/CMakeLists.txt:11 (find package)
I kept going it because it was just warning and I had put the BOOST address in the CMAKE config
so I generate it via CMAKE and the run the visual studio solution in ADMIN and build the shark.sln but the after a lot of compiling time , the result was : 198 projects FAILED
Visual studio makes these errors after building the shark project:
Error LNK1181 cannot open input file '..\lib\Release\shark.lib'
Error C2668 'shark::size': ambiguous call to overloaded function
Error C3861 'make_iterator_range': identifier not found
these errors are repeated for 230 times in shark project building process
these errors makes me confused and I don't know what to do because when shark.lib is created that building process gets completed and in the middle of building , compiler is looking for what?
another item is shark::size error is not clear for me because all the relations between library files and header files in this project is clear but compiler cannot relate them together and makes error
Boost is a collection of libraries. Some must be built, others are header-only (just #include). Visual Studio is common enough that Boost provides a link to pre-built libraries. You downloaded the correct MSVC 14.2 build for VS2019.
Since Boost is a collection of libraries, sometimes library A needs library B. CMake knows about the dependencies in most Boost versions, but not the newest. So when a project tells CMake it needs Boost library A, CMake will automatically include B as well. If this is the problem with Shark, you'll need to manually add the missing Boost dependencies to CMakeLists.txt.

How to fix the missing libraries error in CMake?

I'm setting up a new server, CMake 3.14.0-rc1 send me to a error message. i try some solutions post here but i dont find the correct one.
"CMake Error at C:/Program Files/CMake/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenSSL (missing: OPENSSL_LIBRARIES)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
src/cmake/macros/FindOpenSSL.cmake:184 (find_package_handle_standard_args)
CMakeLists.txt:92 (find_package)"
this is the message.
I add manually the missing entry but not work. (Windows 10 and OpenSSL version 1.1.1a not light installed.
thank you all can help me for a solution.
CMake automatically calls the function FindOpenSSL:
FindOpenSSL
Find the OpenSSL encryption library.
This module will set the following variables in your project:
OPENSSL_FOUND
System has the OpenSSL library.
OPENSSL_INCLUDE_DIR
The OpenSSL include directory.
OPENSSL_CRYPTO_LIBRARY
The OpenSSL crypto library.
OPENSSL_SSL_LIBRARY
The OpenSSL SSL library.
OPENSSL_LIBRARIES
All OpenSSL libraries.
OPENSSL_VERSION
This is set to $major.$minor.$revision$patch (e.g. 0.9.8s).
Yet OPENSSL_LIBRARIES is missing; it generally means openssl needs to be installed on your development environment. You'd generally need the devel package.
Click Advanced tab in Cmake and set Openssl_root_dir

Cmake finds hdf5 but tries to link against dll on windows

I use find_package(HDF5 COMPONENTS CXX REQUIRED) in my CMAKE script to load the include directories and libraries of HDF5. Cmake tells me
Found HDF5: C:/Program Files/HDF_Group/HDF5/1.10.0/bin/hdf5_cpp.dll (found version "1.10.0") found components: CXX
And generates my visual studio solution.
I also use the library stored in ${HDF5_LIBRARIES} ${HDF5_CXX_LIBRARIES} for my target, but when I try to build it, I get a Linker Error LNK1107 saying that for file hdf5_cpp.dll:
invalid or corrupt file: cannot read at 0x380
which I think is due to the fact that visual studio is trying to directly link against the dll file instead of against the lib file which is in another folder, namely in:
C:\Program Files\HDF_Group\HDF5\1.10.0\lib
Question: Is this a bug in FindHDF or did I configure something wrong?
I have not used hdf5 on windows for some time, but I do recall there being a bug that causes it to link against the dll instead of the lib.
you should manually set (either via the command line cmake -D method, or via the cmake gui)
HDF5_hdf5_LIBRARY=C:\Program Files\HDF_Group\HDF5\1.10.0\lib\libhdf5.lib
HDF5_hdf5_cpp_LIBRARY=C:\Program Files\HDF_Group\HDF5\1.10.0\lib\libhdf5_cpp.lib
etc. - or just
HDF5_LIBRARY=C:\Program Files\HDF_Group\HDF5\1.10.0\lib\libhdf5.lib
HDF5_cpp_LIBRARY=C:\Program Files\HDF_Group\HDF5\1.10.0\lib\libhdf5_cpp.lib
depending on whether you have an older or newer version of FindHDF5 (they change the library var names in newer versions - check the ones used to make sure you get them right - I'm doing this from memory so might have made a mistake)
EDIT:
If the option of manaully specifying the libs is a problem, then there is the option of using FindPackage(HDF5 NO_MODULE) if your hdf5 library was compiled using cmake generated makefilesetc.
When using NO_MODULE, the find package scripts will bypass the findhdf5.cmake script and look for the HDF5Config.cmake or hdf5-config.cmake file that is placed in the relevant subdir of the hdf5 build/install folfer.
This is cross platform friendly and is supported by all newer hdf5 versions - provided they were built using cmake and not ./configure ...

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.

Compile OpenSceneGraph with Cmake under Windows

I am trying to set up Openscenegraph 3.0.1 with Cmake. I read different blog posts but it doesn't work.
I set up the paths, click compile and selected VS11 (because I have VS 2012) and use native compiler.
Then I directly get this error:
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules CMakeCInformation.cmake:37 (get_filename_component):
get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
CMakeLists.txt:3 (PROJECT)
CMake Error: Internal CMake error, TryCompile configure of cmake failed
Looking for include file pthread.h - not found
Also, more errors with the same stack trace occur. Also also could paste them here if you wish.
Afterwards, CMake tells me "Error in configuration process, project files may be invalid"
your problem isn't in compiler version that you are using; in fact, i'm running OpenSceneGraph 3(and osgEarth) with no problems on VisualStudio 2012.
What it seems to be is a problem with Cmake/CMakeLists.txt itself. Try to build some other projects using cmake, to see whether they work, or try to use a version of CMake that is close to what OpenSceneGraph needs(look at CMAKE_MINIMUM_REQUIRED in main CMakeLists.txt file), although CMake language is meant to be compatible with earlier versions, i dont know if this is always the case.
pthread.h has nothing to do with your problem, DOESN'T EXIST in Windows(except if you are using MinGW to look for some more problems), and is not required by OSG - i think, you configured OpenThreads correctly to not use libs you don't have. Anyway, that's just part of the job CMake does on each build - looks for some random stuff, like whether it can find pthreads.h or not, that give CMake some idea about your environment and don't usually relate to the projects you build with cmake. So just ignore that line about pthread.h
Under normal circumstances, CMake shouldn't be looking for pthread for Windows. Following is the couple of lines in CMake's (2.8) FindThreads.cmake which is used for searching appropriate modules.
...
CHECK_INCLUDE_FILES("pthread.h" CMAKE_HAVE_PTHREAD_H)
if(CMAKE_HAVE_PTHREAD_H)
...
endif()
...
if(CMAKE_SYSTEM MATCHES "Windows")
set(CMAKE_USE_WIN32_THREADS_INIT 1)
set(Threads_FOUND TRUE)
endif()
As you can see, first check should fail and roll out till the second check. However, I believe that in your case, CMake somehow finds that pthread.h (maybe you have MinGW as well) This seems to be a simple conflict in your system. Check your system's PATH etc. and try to fix it.