CMake Error while building VTK 'INSTALL' project - c++

I generated VTK 8.1.1 VS2015 solution by CMake, and when I build 'ALL_BUILD' project, it works well.
but when I try building 'INSTALL' project, the error followed occurs:
-- Installing: C:/Program Files/VTK/share/doc/vtk-8.1/doxygen/doc_index.stop
2> -- Installing: C:/Program Files/VTK/share/doc/vtk-8.1/doxygen/doc_readme.txt
2> CMake Error at Utilities/Doxygen/cmake_install.cmake:60 (file):
2> file INSTALL cannot find
2> "C:/workspace/VTK_build/Utilities/Doxygen/doc/html".
2> Call Stack (most recent call first):
2> cmake_install.cmake:226 (include)
2>
I do run vs2015 as administrator.
and I have checked that there doesn't have a folder called doc under 'Doxygen' indeed.
please tell me why does this error happen? did I config something wrong?
and what should I do now?
update 1 :
I delete the sentence in file 'cmake_install.cmake' that uses /Doxygen/doc/html.
It is compiled successfully, but I don't know if there would have some thing wrong in the future.
update 2 :
The problem is solved. It just need to build DoxygenDoc separately and /Doxygen/doc/ and some other files will be generated. For more details please see comments below.

The problem is that the documentation has not been build as its target DoxygenDoc is not part off the ALL_BUILD target (which makes sense as you don't want always rebuild the documentation during the development).
Building the documentation creates the required directories and makes it possible to install the documentation.
Note also that the BUILD_DOCUMENTATION in CMake has to be set to be able to build the documentation.

Related

How to get Xlnt running on VS Code? Using msys2, mingw, ninja, cmake, vcpkg

I just need a way to read in an excel file into a C++ program created thru VSCode.
This was the path I took: VSCode, msys2, mingw, mingw-ninja, mingw-cmake, vcpkg.
I have zero experience with any of the above tools.
I have some experience with libraries in Visual Studio... As in I can figure it out, but there are a lot of gaps in my understand of what happens under the hood when I hit the build button.
I used vcpkg to install xlnt and build it with mingw.
Then tried to configure VSCode with the cmake extensions tools.
I got as far as this in VSCode.
[cmake] CMake Error at C:/src/vcpkg/scripts/buildsystems/vcpkg.cmake:834 (_find_package):
[cmake] Could not find a package configuration file provided by "Xlnt" with any of
[cmake] the following names:
[cmake]
[cmake] XlntConfig.cmake
[cmake] xlnt-config.cmake
[cmake]
[cmake] Add the installation prefix of "Xlnt" to CMAKE_PREFIX_PATH or set
[cmake] "Xlnt_DIR" to a directory containing one of the above files. If "Xlnt"
[cmake] provides a separate development package or SDK, be sure it has been
[cmake] installed.
I am obviously missing some files...
I did find a XlntConfig.cmake.in file on the github repository, but I have no idea what this .in file is or what to do with it or where to put it if it is the right file.
Where do I go from here?
Or, Is there a better path thru all this with these tools or different one?

CMake is not creating a Makefile (Trying to Install GODDeSS-Package)

I am very new (my first time) to installing software through command lines and source files and C++. So the solution could be quite simple but I just simply don't understand it.
My objective here is to install the GODDeSS-Package following these instructions.
I am currently under the section "How to install the example simulation" and I am stuck on the final step (step 8). To my knowledge, I believe I have installed all the prerequisite software correctly listed from steps 1-3.
Following the procedures when I arrive at step 8, I execute the following command and receive this error:
$cmake C:/Users/Patrick/Desktop/Research/GODDeSS-Package/goddess-package/GODDeSS_4_3/source
...
Could NOT find Boost (missing: regex) (found version "1.59.0")
...
I used the ellipse to show there is text before and after that error message. However this is not the main problem. I was able to over come this with a add-on argument (which I don't really understand how it works) -DBoost_USE_STATIC_LIBS=ON
So after this modification, I get the following results:
$cmake C:/Users/Patrick/Desktop/Research/GODDeSS-Package/goddess-package/GODDeSS_4_3/source -DBoost_USE_STATIC_LIBS=ON
...
-- Generating done
-- Build files have been written to: C:/Users/Patrick/Desktop/Research/GODDeSS-Package/goddess-build
So I assume part 1 of step 8 done correctly? ...since it says "Generating done".
Now here is where I run into the problem. the next command is:
$make -j install
But I don't have a Makefile in the generated files!
Here is a picture of my build directory which I have generated the files into:
Build Directory Picture
I have done some reading and it seems like cmake is Building for Visual Studios 16 2019 so it creates the .sln files instead (theres alot of them! Almost one in every folder). I'm not entire sure how to deal with this situation. Instead I tried to force cmake to generate me a Makefile by using the add-on command -G "MinGW Makefiles" I picked MinGW randomly just because it was one of the few options that generated a Makefile.
So I created a fresh build directory and used the following command:
cmake -G "MinGW Makefiles" C:/Users/Patrick/Desktop/James_L_Pinfold_Research/GODDeSS-Package/goddess-package/GODDeSS_4_3/source -DBoost_USE_STATIC_LIBS=ON
But I get the following error:
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
So now I'm stuck... I see 2 paths I can go down. 1. Make use of the .sln files created by cmake to install the package... or 2. Somehow make cmake create a Makefile so I can use the make command. Neither of which how to do.
I'm having a hard time trying to find documentations of how to install this package but I have yet to succeed. What can I try next?
I am using Windows 10, Terminal: Git Bash, Visual Studios 2019, Boost_1_5_9, zlib1211, geant4_10_02_p03, and cmake-3.17.2

Compiling with CMake and ITK error

I'm trying to compile some code from here using CMake and ITK but I'm running into an error.
In CMake I select the source folder at /utilities/ITKImageSeriesToVolume and the build folder at /utilities/ITKImageSeriesToVolume/build. This however gives me an error:
CMake Error at CMakeLists.txt:42 (find_package):
By not providing "FindITK.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "ITK", but
CMake did not find one.
Could not find a package configuration file provided by "ITK" with any of
the following names:
ITKConfig.cmake
itk-config.cmake
Add the installation prefix of "ITK" to CMAKE_PREFIX_PATH or set "ITK_DIR"
to a directory containing one of the above files. If "ITK" provides a
separate development package or SDK, be sure it has been installed.
I have tried to set a CMAKE_PREFIX_PATH environment variable that points to the root folder of ITK containing ITKConfig.cmake but get the same error.
Hoping someone can help, thanks in advance.
EDIT: After setting ITK_DIR to the root ITK folder I get:
CMake Error at D:/Apps/InsightToolkit/ITK/ITKConfig.cmake:48 (include):
include could not find load file:
D:/Apps/InsightToolkit/Build/ITKTargets.cmake
Call Stack (most recent call first):
CMakeLists.txt:42 (find_package)
CMake Error at D:/Apps/InsightToolkit/Source/CMake/ITKModuleAPI.cmake:56 (message):
No such module: "ITKDoubleConversion"
Call Stack (most recent call first):
D:/Apps/InsightToolkit/Source/CMake/ITKModuleAPI.cmake:26 (itk_module_load)
D:/Apps/InsightToolkit/Source/CMake/ITKModuleAPI.cmake:84 (_itk_module_config_recurse)
D:/Apps/InsightToolkit/ITK/ITKConfig.cmake:68 (itk_module_config)
CMakeLists.txt:42 (find_package)
It has a simple fix as mentioned in the ERROR
"Add the installation prefix of "ITK" to CMAKE_PREFIX_PATH or set "ITK_DIR"
to a directory containing one of the above files. If "ITK" provides a
separate development package or SDK, be sure it has been installed."
Make sure your point the CMAKE_PREFIX_PATH and ITK to your ITK Build Directory. This is assuming you have already build ITK using Cmake atleast once.
Steps
1) Create ITK source folder.
2) Create ITK build folder.
3) Run CMake and select source and build folders.
4) Select respective compiler, and if there are any compiler issues refer this discussion.
5) Configure and generate cmake.
6) Open the build files in build folder with respective IDE (use .sln file if visual studio compilers are used).
7) Build all once on visual studio.
8) Now for your new project use same steps and point CMAKE_PREFIX_PATH and ITK to your ITK Build Directory.
And everything should work.
Good Luck!!!
Your ITK build seems to be partly broken. Can you try re-building it? If that does not help, see whether ITK_USE_SYSTEM_DOUBLECONVERSION is ON. That means not to build DoubleConversion library which comes with ITK but to use the one already present on the system. If it is not present, you have a problem.
Also, unless ITK_BUILD_DEFAULT_MODULES is ON, you have to specifically turn on each module or module group you want to be compiled. In that case, turn on ITKDoubleConversion, and any additional modules which that code requires.

CMake error while building MultiTarget-tracker library

I'm trying to build Multitarget-tracker using CMake in windows. Initially I had this warning below:
You should manually point CMake variable OpenCV_DIR to your build of OpenCV library.
Call Stack (most recent call first):
CMakeLists.txt:57 (find_package)
I manually pointed out the directory of build version of OpenCV library and tried to build. I referred this link while building. I now get this warning:
CMake Warning at CMakeLists.txt:23 (FIND_PACKAGE):
Found package configuration file:
C:/OpenCV/opencv/build/x86/vc12/lib/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND.
I tried to check the OpenCV_FOUND variable, but after I press 'configure' again, it automatically unchecks.
You're not supposed to check OpenCV_FOUND manually: it's a variable set by OpenCVConfig.cmake to tell CMake if OpenCV was found or not.
The fact it was set to FALSE is the sign your installation of OpenCV is not valid according to the package. Installing OpenCV properly is the solution.

CMAKE libintl-8.dll is missing from your computer

I've been looking for solutions, and honestly I'm stuck.
I'm trying to install Box2D, as you can see by the file paths.
Anyway, this prompt appears several times before the following:
The CXX compiler identification is unknown
Check for working CXX compiler: C:/MinGW/bin/g++.exe
Check for working CXX compiler: C:/MinGW/bin/g++.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.6/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "C:/MinGW/bin/g++.exe" is not able to compile a simple
test program.
It fails with the following output:
Change Dir: C:/Users/alexm/Documents/Box2D/Build/CMakeFiles/CMakeTmp
Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_31089/fast"
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_31089.dir\build.make
CMakeFiles/cmTC_31089.dir/build
mingw32-make.exe[1]: Entering directory
'C:/Users/alexm/Documents/Box2D/Build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_31089.dir/testCXXCompiler.cxx.obj
C:\MinGW\bin\g++.exe -o CMakeFiles\cmTC_31089.dir\testCXXCompiler.cxx.obj
-c
C:\Users\alexm\Documents\Box2D\Build\CMakeFiles\CMakeTmp\testCXXCompiler.cxx
CMakeFiles\cmTC_31089.dir\build.make:64: recipe for target
'CMakeFiles/cmTC_31089.dir/testCXXCompiler.cxx.obj' failed
mingw32-make.exe[1]: ***
[CMakeFiles/cmTC_31089.dir/testCXXCompiler.cxx.obj] Error 1
mingw32-make.exe[1]: Leaving directory
'C:/Users/alexm/Documents/Box2D/Build/CMakeFiles/CMakeTmp'
Makefile:125: recipe for target 'cmTC_31089/fast' failed
mingw32-make.exe: *** [cmTC_31089/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/alexm/Documents/Box2D/Build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/alexm/Documents/Box2D/Build/CMakeFiles/CMakeError.log".
So, there's the error. I'm trying to install it on code::blocks with MinGW, I've currently got 2 copies of MinGW installed, one that's located in the code::blocks folder and the other is in my root drive, I installed MinGW seperately to fix this problem.
This is my first time using CMake, I'm trying to get it to work with my sfml project on code::blocks in C++.
Apologies if I missed anything, if you spot any information you'd need don't hesitate to comment!
Go to system variables and add
C:\Program Files (x86)\CodeBlocks\MinGW\bin
to your path
You download libintl-8.dll and copy to C:\MinGW\bin:
https://www.dll-files.com/libintl-8.dll.html
It worked for me.
You should run Cmake as admin. I had the same problem, worked for me
I had the same problem and I tried every solution proposed below and did not work for me then I realized that CMake uses C:\Program Files (x86)\CodeBlocks\MinGW\mingw32\bin instead of C:\Program Files (x86)\CodeBlocks\MinGW\bin so I copied the "dll" files to that folder. If that does not work for you try adding C:\Program Files (x86)\CodeBlocks\MinGW\mingw32\bin to your path.
I had the same problem.
I was runing cmake with compability to win 7,
when I untick it, it started work.