Commit 945c7b5d authored by Rashad Kanavath's avatar Rashad Kanavath

XDK: fix nasty cmake files portablity suff..ergh

parent 77fef0bd
......@@ -164,11 +164,3 @@ ExternalProject_Add(ITK
SUPERBUILD_PATCH_SOURCE(ITK)
set(DIR_LIST "${SB_INSTALL_PREFIX}/lib/cmake/ITK-4.10|${SB_INSTALL_PREFIX}/lib/cmake/ITK-4.10/Modules")
ExternalProject_Add_Step(ITK POST_INSTALL
COMMAND ${CMAKE_COMMAND}
-DP_DIRS=${DIR_LIST}
-DP_MATCH=${SB_INSTALL_PREFIX}
-DP_REPLACE=ITK_INSTALL_PREFIX
-P ${CMAKE_SOURCE_DIR}/CMake/post_install.cmake
DEPENDEES install)
#check variables are set
foreach(var P_DIRS P_MATCH P_REPLACE)
if(NOT ${var})
message(FATAL_ERROR "${var} not set")
endif()
endforeach()
string(REPLACE "|" ";" P_DIRS ${P_DIRS})
foreach( p_dir ${P_DIRS} )
set(file_list)
file( GLOB file_list "${p_dir}/*.cmake" )
......
......@@ -30,6 +30,7 @@ macro(macro_setup_cmake_project pkg)
include(CMakeDetermineSystem)
set(CMAKE_BUILD_TYPE Release)
set(PACKAGE_OTB_SRC_DIR \"${PACKAGE_OTB_SRC_DIR}\")
set(SUPERBUILD_BINARY_DIR \"${SUPERBUILD_BINARY_DIR}\")
set(OTB_BINARY_DIR \"${OTB_BINARY_DIR}\")
set(OTB_INSTALL_DIR \"${OTB_INSTALL_DIR}\")
set(QT_PLUGINS_DIR \"${QT_PLUGINS_DIR}\")
......
......@@ -47,10 +47,47 @@ function(func_install_xdk_files)
endif()
endforeach()
file(GLOB ITK_CMAKE_DIRS "${DEPENDENCIES_INSTALL_DIR}/lib/cmake/ITK*")
foreach(ITK_CMAKE_DIR ${ITK_CMAKE_DIRS})
func_install_without_message("${ITK_CMAKE_DIR}" "lib/cmake")
endforeach()
set(ITK_CMAKE_DIR "${DEPENDENCIES_INSTALL_DIR}/lib/cmake/ITK-${PKG_ITK_SB_VERSION}")
message("COPY ${DEPENDENCIES_INSTALL_DIR}/lib/cmake/ITK-${PKG_ITK_SB_VERSION} to ${CMAKE_CURRENT_BINARY_DIR}/_tmp/ to patch")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/_tmp/
COMMAND ${CMAKE_COMMAND}
-E copy_directory
${ITK_CMAKE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/_tmp/ITK-${PKG_ITK_SB_VERSION}
)
#reset ITK_CMAKE_DIR
set(ITK_CMAKE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_tmp/ITK-${PKG_ITK_SB_VERSION}")
set(DIR_LIST "${CMAKE_CURRENT_BINARY_DIR}/_tmp/ITK-${PKG_ITK_SB_VERSION}|${CMAKE_CURRENT_BINARY_DIR}/_tmp/ITK-${PKG_ITK_SB_VERSION}/Modules")
#SUPERBUILD_INSTALL_DIR
execute_process(
COMMAND ${CMAKE_COMMAND}
-DP_DIRS=${DIR_LIST}
-DP_MATCH=${CMAKE_INSTALL_PREFIX}
-DP_REPLACE=ITK_INSTALL_PREFIX
-P ${PACKAGE_OTB_SRC_DIR}/SuperBuild/CMake/post_install.cmake
RESULT_VARIABLE patch_itk_cmake_rv
)
file(STRINGS "${SUPERBUILD_BINARY_DIR}/ITK/build/CMakeCache.txt"
MATCH_FOUND REGEX "ITK_USE_SYSTEM_ZLIB:BOOL=ON")
if(MATCH_FOUND)
find_package(ZLIB QUIET)
get_filename_component(ZLIB_PREFIX ${ZLIB_LIBRARY} PATH)
execute_process(
COMMAND ${CMAKE_COMMAND}
-DP_DIRS=${DIR_LIST}
-DP_MATCH=${ZLIB_PREFIX}
-DP_REPLACE=ITK_INSTALL_PREFIX
-P ${PACKAGE_OTB_SRC_DIR}/SuperBuild/CMake/post_install.cmake
)
endif()
func_install_without_message("${ITK_CMAKE_DIR}" "lib/cmake")
set(QT_REQ_DIRS)
if(WIN32)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment