Commit 56be8fd2 authored by Rashad Kanavath's avatar Rashad Kanavath

PKG: fix install rule to exlcude testdriver and its .manifest files

parent e02e87f0
......@@ -6,22 +6,21 @@ function(install_rule src_file)
get_filename_component(src_file_PATH ${src_file} PATH)
file(GLOB src_file_star "${src_file_PATH}/${src_file_NAME_WE}*")
foreach(sfile ${src_file_star})
#message( "sfile=${sfile}")
get_filename_component(sfile_NAME ${sfile} NAME)
string(TOLOWER "${sfile_NAME}" sfile_NAME_LOWER)
get_filename_component(sfile_ABS "${sfile}" ABSOLUTE) #file_full -> sfile_ABS
string(TOLOWER "${sfile_ABS}" sfile_ABS_LOWER) #file_full_lower -> sfile_ABS_LOWER
if ("${sfile_NAME_LOWER}" MATCHES "^(otb|mvd)([a-z]+)(headertest|testdriver)")
message( "SKIP INSTALL for ${sfile_NAME_LOWER}")
continue()
endif()
set(install_type)
set(install_dir)
if("${sfile_ABS_LOWER}" MATCHES "(\\.exe)$")
if ("${sfile_NAME_LOWER}" MATCHES
"^(otb|mvd)([a-z]+)(headertest|testdriver)"
)
message("SKIP INSTALL for ${sfile_NAME_LOWER}")
continue()
elseif("${sfile_ABS_LOWER}" MATCHES "(\\.exe)$")
set(install_type PROGRAMS)
set(install_dir bin)
elseif("${sfile_ABS_LOWER}" MATCHES "(\\.dll)$")
......@@ -53,19 +52,19 @@ function(install_rule src_file)
#the last else() loop where we run a 'file' command to find file type and directory
set(install_type)
set(install_dir)
#message("sfile_ABS=${sfile_ABS}")
#this is whole other story
detect_using_file_command(${sfile_ABS} install_type install_dir)
endif(UNIX)
endif()
if(install_type STREQUAL "symlink")
#we don't install symlink on windows. issue a warning
#we don't install symlink on windows. issue a warning and continue
message(WARNING "${sfile_ABS} is a symbolic link and this will be excluded from package")
return()
continue()
endif()
if(NOT install_type OR NOT install_type)
#throw fatal error and return
message(FATAL_ERROR "sfile_ABS=${sfile_ABS}.\ninstall_type=${install_dir}\ninstall_dir=${install_dir}")
return()
endif()
......@@ -74,8 +73,7 @@ function(install_rule src_file)
DESTINATION
"${PKG_STAGE_DIR}/${install_dir}"
)
endforeach()
endfunction()
......@@ -3,7 +3,7 @@ function(patch_cmake_files)
set(PATCH_DIR_NAME ${PATCH_NAME}-${PATCH_VERSION})
set(PATCH_DIR "${SUPERBUILD_INSTALL_DIR}/lib/cmake/${PATCH_DIR_NAME}")
set(PATCH_STAGE_DIR ${CMAKE_CURRENT_BINARY_DIR}/staging/${PATCH_DIR_NAME})
set(PATCH_STAGE_DIR ${CMAKE_CURRENT_BINARY_DIR}/patched/${PATCH_DIR_NAME})
##message("COPY ${PATCH_DIR} to ${PATCH_STAGE_DIR} for patching")
......
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