[Rtk-users] compilation issues in case of outside of ITK directory build

1 1 infrombox at yandex.ru
Thu Oct 25 10:21:03 EDT 2018


Hello guys.
I can't build RTK in Linux. I've done all default steps described in wiki, but on configure i've got: 
CMake Error at utilities/lp_solve/CMakeLists.txt:9 (include):
   include could not find load file:

     ITKModuleMacros


Hm.. it tries include module that exists in src ITK dir, not install...
I mean 
"ls /usr/local/lib/cmake/ITK-4.13 | grep ITKModuleMacros" prints nothing
"ls /home/user/src/ITK/CMake | grep ITKModuleMacros" prints ITKModuleMacros.cmake

OK, i have just tried to add CMAKE_MODULE_PATH=/home/user/src/ITK/CMake and got next error:

CMake Error at CMakeLists.txt:250 (message):
  Modules can only be built against an ITK build tree; they cannot be built
  against an ITK install tree.

Let's look at the code:

if(NOT ITK_SOURCE_DIR)
  if(NOT EXISTS ${ITK_CMAKE_DIR}/ITKModuleMacros.cmake)
    message(FATAL_ERROR "Modules can only be built against an ITK build tree; they cannot be built against an ITK install tree.")
  endif()
  list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
  include(ITKModuleExternal)
else()
  itk_module_impl()
endif()

Yea, ITK_SOURCE_DIR is not set in my case, but why there is must be ITKModuleMacros.cmake at my ITK_CMAKE_DIR dir that points to ITK installation dir ?

If i set ITK_CMAKE_DIR to /home/user/src/ITK/CMake where ITKModuleMacros is, it resets back to ITK installation directory at 
# --------------------------------------------------------
# Find ITK (required)
if(NOT ITK_SOURCE_DIR)
  find_package(ITK 4.12.0 REQUIRED)
endif()


So, the only way i see is to build inside ITK, but i am not familiar with this. Could anyone help me how to build RTK inside ITK.


More information about the Rtk-users mailing list