Hi every one,
I wana building an extension(MABMIS) for slicer by CMake but I get this Error:
CMake Error at CMakeLists.txt:12 (find_package):
By not providing "FindSlicer.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Slicer", but
CMake did not find one.
Could not find a package configuration file provided by "Slicer" with any
of the following names:
SlicerConfig.cmake
slicer-config.cmake
Add the installation prefix of "Slicer" to CMAKE_PREFIX_PATH or set
"Slicer_DIR" to a directory containing one of the above files. If "Slicer"
provides a separate development package or SDK, be sure it has been
installed.
So I build the slicer from sources but these files did not created, Where does they build usually?
I am using cmake GUI, so I just specify source and build folders. (so I do not use any command). I specify slicer build location but it said to me it can not find:
No I found that it did not completed successfully, I have this error in slicer configuration step:
CMake Error at CMake/SlicerBlockFindQtAndCheckVersion.cmake:45 (message):
error: Qt 4.7.4 was not found on your system.You probably need to set the
QT_QMAKE_EXECUTABLE variable.
Call Stack (most recent call first):
CMake/SlicerBlockFindQtAndCheckVersion.cmake:110 (__SlicerBlockFindQtAndCheckVersion_find_qt)
CMakeLists.txt:602 (include)
I am building slicer with its proposed steps. It proposed Qt version 5.1.0, which I downloaded and install successfully. I changed QT_QMAKE_EXECUTABLE to
Did you remove build directory before running cmake? Clean up build directory (delete it and create new empty) and then set Qt5_DIR according to this Build Error PythonQt Visual Studio 2015 Qt 5.9.2.
It seems that you have partially configured your the CMake project before provided Qt5 directory. You need to start again from scratch and follow configuration instructions very accurately, especially the bold part: do not click configure before specifying Qt5_DIR.
It is difficult to pay attention to all details each time you rebuild Slicer, therefore I always build Slicer using a batch file. In the .bat file you can specify CMake options using command-line options. I’ve added a few examples to Windows configuration instructions.
After I configured it successfully by CMake, I generated slicer.sln and then built it using vs2015 x64. But it configured with 50 succeeded and 2 failed which I do not understand them. I see in error list just this description:
This indicates that some of the targets were failed to build, but does not tell what was the problem. You should find the actual error message in the full build log (c:\D\S4D\Testing\Temporary\LastBuild_YYYMMDD-HHMM.log).
@lassoan, The folder you mentioned is empty. I built it again and now I can see the slicer.exe and SlicerConfig.cmake in slicer-build folder (but it has 2 failed again).
Thank you so much
Build logs should be in similarly named files. You can also just scroll up to see which project failed and open .sln file of that project and build it. Make sure to choose correct project configuration (Debug/Release) before start building.