Unable to Build CTK & SITK

I am building a fresh release build of slicer 4.7 (commit 42630e641fde4bb8f6e0903cf15ad3ac9cd00b78) using VS2013, Windows x64, QT 4.8.7, and get the following error. This error also seems to cause SITK to fail. I’ve tried a few different solutions but none seem to work - the problem seems to be with these 2 lines of code in FindPythonLibs.cmake. Everything else builds well. I would greatly appreciate some assistance.

Thanks.

CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/FindPythonLibs.cmake:171 (get_filename_component):
11>    get_filename_component unknown component
11>    C:/Fall2017/s4r/python-install/libs/python27.lib
11>  Call Stack (most recent call first):
11>    CMakeExternals/PythonQt.cmake:61 (find_package)
11>    CMake/ctkMacroCheckExternalProjectDependency.cmake:568 (include)
11>    CMake/ctkMacroCheckExternalProjectDependency.cmake:614 (ExternalProject_Include_Dependencies)
11>    CMake/ctkBlockCheckDependencies.cmake:127 (ExternalProject_Include_Dependencies)
11>    CMakeLists.txt:970 (include)
11>  
11>  
11>  CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/FindPythonLibs.cmake:172 (get_filename_component):
11>    get_filename_component called with incorrect number of arguments
11>  Call Stack (most recent call first):
11>    CMakeExternals/PythonQt.cmake:61 (find_package)
11>    CMake/ctkMacroCheckExternalProjectDependency.cmake:568 (include)
11>    CMake/ctkMacroCheckExternalProjectDependency.cmake:614 (ExternalProject_Include_Dependencies)
11>    CMake/ctkBlockCheckDependencies.cmake:127 (ExternalProject_Include_Dependencies)
11>    CMakeLists.txt:970 (include)

The lines of code referred to in FindPythonLibs.cmake

get_filename_component(_Python_PREFIX ${PYTHON_LIBRARY} PATH)
get_filename_component(_Python_PREFIX ${_Python_PREFIX} PATH)

Many of us rebuild Slicer successfully every day using VS2013, Windows x64, Qt-4.8.7. Please use latest master version (Slicer 4.9) and follow build instructions closely.

  1. Build in a shorter build path: Source directory: C:\S4. Build directory: C:\S4R (or C:\S4D).

  2. Build Qt using Jc’s one-liner (qt-easy-build)

This likely means ${PYTHON_LIBRARY} is not set, so there was probably another build error earlier.

But as Andras said, you are best off using the current tree.

I tried using the master version and following all the instructions (I have built slicer several times in the past) but I still get the same errors. I have begun implementing this unofficial solution outlined here:

https://cmake.org/pipermail/cmake/2017-January/064948.html

I believe the problem has to do with multiple Python Libraries, given that implementing this solution in several cmake files does seem to push the build further along (CTK now builds, but SITK does not, however I will implement this solution in some of the cmake files related to SITK that throw this same error). I was hoping this would provide insight to come up with a better fix.

Ah, ok, well a new enough CMake will have the official fix:

A newer cmake did help, and now everything except the Slicer project builds. The error I’m now getting is:

CMake Error at CMake/SlicerMacroBuildApplication.cmake:330 (message):
LAUNCHER_SPLASHSCREEN_FILE is mandatory
Call Stack (most recent call first):
Applications/SlicerApp/CMakeLists.txt:95 (slicerMacroBuildApplication)

Any advice?

If you are customizing the Slicer build then you will need to set that variable yourself…
Otherwise, it is defined in Applications/SlicerApp/CMakeLists.txt for standard builds.