[openrtm-commit:02485] r194 - in trunk/ImageProcessing/opencv: . components/TkCalibGUI
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 2月 27日 (月) 19:19:00 JST
Author: kawauchi
Date: 2017-02-27 19:19:00 +0900 (Mon, 27 Feb 2017)
New Revision: 194
Added:
trunk/ImageProcessing/opencv/components/TkCalibGUI/postinst.in
trunk/ImageProcessing/opencv/components/TkCalibGUI/prerm.in
trunk/ImageProcessing/opencv/ip_cpack_options.cmake
trunk/ImageProcessing/opencv/postinst.in
trunk/ImageProcessing/opencv/prerm.in
Modified:
trunk/ImageProcessing/opencv/CMakeLists.txt
trunk/ImageProcessing/opencv/build_linux_package.sh.in
trunk/ImageProcessing/opencv/components/TkCalibGUI/CMakeLists.txt
Log:
[compat,->RELEASE_1_2_0] Python RTC has been modified to perform IDL compilation during installation. refs #3970
Modified: trunk/ImageProcessing/opencv/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/CMakeLists.txt 2017-02-22 01:10:17 UTC (rev 193)
+++ trunk/ImageProcessing/opencv/CMakeLists.txt 2017-02-27 10:19:00 UTC (rev 194)
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
-project(ImageProcessing_opencv)
+project(ImageProcessing)
+set(TOP_PROJECT_NAME ${PROJECT_NAME})
+string(TOLOWER ${TOP_PROJECT_NAME} TOP_PROJECT_NAME_LOWER)
SUBDIRS(components)
set(SolutionDir ${PROJECT_SOURCE_DIR})
@@ -56,7 +58,30 @@
endif()
endif()
-configure_file(${SolutionDir}/build_linux_package.sh.in
- ${PROJECT_BINARY_DIR}/build_linux_package.sh
- @ONLY
-)
+if(UNIX)
+ # build linux package script
+ configure_file(${SolutionDir}/build_linux_package.sh.in
+ ${PROJECT_BINARY_DIR}/build_linux_package.sh
+ @ONLY
+ )
+
+ # postinst, prerm settings
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/postinst.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/postinst @ONLY
+ )
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/prerm.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/prerm @ONLY
+ )
+endif()
+
+if(NOT WIN32)
+ if(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+ set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/components/TkCalibGUI/postinst;${PROJECT_SOURCE_DIR}/components/TkCalibGUI/prerm")
+ endif(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+ if(CPACK_RPM_PACKAGE_ARCHITECTURE)
+ set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/components/TkCalibGUI/postinst")
+ set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/components/TkCalibGUI/prerm")
+ endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
+endif()
+
+
Modified: trunk/ImageProcessing/opencv/build_linux_package.sh.in
===================================================================
--- trunk/ImageProcessing/opencv/build_linux_package.sh.in 2017-02-22 01:10:17 UTC (rev 193)
+++ trunk/ImageProcessing/opencv/build_linux_package.sh.in 2017-02-27 10:19:00 UTC (rev 194)
@@ -3,16 +3,11 @@
GENERATOR=@LINUX_PACKAGE_GENERATOR@
echo "Linux package generator:" ${GENERATOR}
-cpack -C CPackConfig.cmake
+grep -l 'translate' CPackConfig.cmake | xargs sed -i.bak -e 's/"translate/"imageprocessing/g'
+grep -l 'Translate' CPackConfig.cmake | xargs sed -i.bak -e 's/"Translate/"Imageprocessing/g'
-if test "x${GENERATOR}" = "xDEB" ;then
- rename s/translate/imageprocessing/g *.deb
- newname=`ls *.deb`
-fi
-if test "x${GENERATOR}" = "xRPM" ;then
- rename Translate ImageProcessing *.rpm
- newname=`ls *.rpm`
-fi
+cp -f ../ip_cpack_options.cmake components/Translate/cpack_options.cmake
-echo "Rename package : " ${newname}
+cpack -C CPackConfig.cmake
+
Modified: trunk/ImageProcessing/opencv/components/TkCalibGUI/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/TkCalibGUI/CMakeLists.txt 2017-02-22 01:10:17 UTC (rev 193)
+++ trunk/ImageProcessing/opencv/components/TkCalibGUI/CMakeLists.txt 2017-02-27 10:19:00 UTC (rev 194)
@@ -6,7 +6,6 @@
project(TkCalibGUI NONE)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
function(get_dist ARG0)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -79,16 +78,12 @@
)
set(EXEC_FILES ""
- TkCalibGUIComp.py tkcalibgui.py rtutil.py setup.py
+ TkCalibGUIComp.py tkcalibgui.py rtutil.py setup.py idlcompile.sh
)
set(OTHER_SRCS CMakeLists.txt
RTC.xml TkCalibGUI.conf rtc.conf)
-
-# check OpenRTM installed
-find_package(OpenRTMPython REQUIRED)
-
# check doxygen installed
find_package(Doxygen)
if(DOXYGEN_FOUND STREQUAL "NO")
@@ -97,24 +92,24 @@
# check python installed
find_package(PythonInterp)
-find_package(PythonLibs)
if(WIN32)
- # add command path
-# set($ENV{PATH} $ENV{PATH} "${OPENRTM_DIR}/bin")
- # set install path prefix
-# set(CMAKE_INSTALL_PREFIX "${OPENRTM_DIR}")
set(INSTALL_PREFIX "components/${RTC_LANG}/${PACKAGE_NAME}${PACKAGE_VERSION}")
else()
- # add command path
-# set($ENV{PATH} $ENV{PATH} "${OPENRTM_DIR}/bin")
- # set install path prefix
-# set(CMAKE_INSTALL_PREFIX "${OPENRTM_DIR}")
set(OPENRTM_SHARE_PREFIX "share/openrtm-${RTC_VERSION_MAJOR}.${RTC_VERSION_MINOR}")
set(INSTALL_PREFIX "${OPENRTM_SHARE_PREFIX}/components/${RTC_LANG}/${RTC_NAME}")
endif()
+# postinst, prerm settings
+if(UNIX)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/postinst.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/postinst @ONLY
+ )
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/prerm.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/prerm @ONLY
+ )
+endif()
# add uninstall target
configure_file(
@@ -141,7 +136,6 @@
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/idl
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/idl ${PROJECT_BINARY_DIR}/idl
- COMMAND /bin/sh ${PROJECT_SOURCE_DIR}/idlcompile.sh
)
endif()
@@ -155,14 +149,20 @@
install(PROGRAMS ${EXEC_FILES} DESTINATION "${INSTALL_PREFIX}"
COMPONENT "applications")
-install(FILES ${PROJECT_BINARY_DIR}/CalibrationService_idl.py DESTINATION "${INSTALL_PREFIX}"
- COMPONENT "applications")
+if(WIN32)
+ install(FILES ${PROJECT_BINARY_DIR}/CalibrationService_idl.py DESTINATION "${INSTALL_PREFIX}"
+ COMPONENT "applications")
-install(DIRECTORY idl
+ install(DIRECTORY idl
${PROJECT_BINARY_DIR}/ImageCalibService
${PROJECT_BINARY_DIR}/ImageCalibService__POA
- DESTINATION "${INSTALL_PREFIX}"
- COMPONENT "applications")
+ DESTINATION "${INSTALL_PREFIX}"
+ COMPONENT "applications")
+else()
+ install(DIRECTORY idl
+ DESTINATION "${INSTALL_PREFIX}"
+ COMPONENT "applications")
+endif()
# install source files
#install(FILES ${IDL_FILES} ${EXEC_FILES} ${OTHER_SRCS}
@@ -223,23 +223,36 @@
set(CPACK_GENERATOR "${LINUX_PACKAGE_GENERATOR}")
if(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWER}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
+ set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/postinst;${CMAKE_SOURCE_DIR}/prerm")
endif(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
if(CPACK_RPM_PACKAGE_ARCHITECTURE)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_ARCHITECTURE}")
+ set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/postinst")
+ set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/prerm")
endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
endif()
include(CPack)
+
+
if (SolutionDir)
- SET (calib_python_file
+ if(WIN32)
+ SET (calib_python_file
${PROJECT_SOURCE_DIR}/TkCalibGUIComp.py
${PROJECT_SOURCE_DIR}/tkcalibgui.py
${PROJECT_SOURCE_DIR}/rtutil.py
${PROJECT_BINARY_DIR}/CalibrationService_idl.py
${PROJECT_BINARY_DIR}/setup.py)
-
+ else()
+ SET (calib_python_file
+ ${PROJECT_SOURCE_DIR}/TkCalibGUIComp.py
+ ${PROJECT_SOURCE_DIR}/tkcalibgui.py
+ ${PROJECT_SOURCE_DIR}/rtutil.py
+ ${PROJECT_BINARY_DIR}/setup.py)
+ endif()
+
foreach(target ${calib_python_file})
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
@@ -248,22 +261,24 @@
)
endforeach()
- SET (calib_python_dir
+ if(WIN32)
+ SET (calib_python_dir
ImageCalibService
ImageCalibService__POA)
- foreach(target ${calib_python_dir})
- add_custom_command(
- TARGET ${PROJECT_NAME} POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E make_directory ${SolutionDir}/bin/${target}
- )
- endforeach()
+ foreach(target ${calib_python_dir})
+ add_custom_command(
+ TARGET ${PROJECT_NAME} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${SolutionDir}/bin/${target}
+ )
+ endforeach()
- foreach(target ${calib_python_dir})
- add_custom_command(
- TARGET ${PROJECT_NAME} POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- ${target} ${SolutionDir}/bin/${target}
- )
- endforeach()
+ foreach(target ${calib_python_dir})
+ add_custom_command(
+ TARGET ${PROJECT_NAME} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_directory
+ ${target} ${SolutionDir}/bin/${target}
+ )
+ endforeach()
+ endif()
endif (SolutionDir)
Added: trunk/ImageProcessing/opencv/components/TkCalibGUI/postinst.in
===================================================================
--- trunk/ImageProcessing/opencv/components/TkCalibGUI/postinst.in (rev 0)
+++ trunk/ImageProcessing/opencv/components/TkCalibGUI/postinst.in 2017-02-27 10:19:00 UTC (rev 194)
@@ -0,0 +1,5 @@
+#!/bin/sh
+# postinst script
+set -e
+cd /usr/@INSTALL_PREFIX@
+sh idlcompile.sh
Added: trunk/ImageProcessing/opencv/components/TkCalibGUI/prerm.in
===================================================================
--- trunk/ImageProcessing/opencv/components/TkCalibGUI/prerm.in (rev 0)
+++ trunk/ImageProcessing/opencv/components/TkCalibGUI/prerm.in 2017-02-27 10:19:00 UTC (rev 194)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# prerm script
+sudo rm -rf /usr/@INSTALL_PREFIX@
+
Added: trunk/ImageProcessing/opencv/ip_cpack_options.cmake
===================================================================
--- trunk/ImageProcessing/opencv/ip_cpack_options.cmake (rev 0)
+++ trunk/ImageProcessing/opencv/ip_cpack_options.cmake 2017-02-27 10:19:00 UTC (rev 194)
@@ -0,0 +1,103 @@
+set(CPACK_PACKAGE_NAME "ImageProcessing")
+set(CPACK_PACKAGE_VERSION_MAJOR "1")
+set(CPACK_PACKAGE_VERSION_MINOR "2")
+set(CPACK_PACKAGE_VERSION_PATCH "0")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ModuleDescription")
+set(CPACK_PACKAGE_VENDOR "VenderName")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "ImageProcessing100")
+if(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+ set(CPACK_PACKAGE_FILE_NAME "imageprocessing_1.2.0_amd64")
+endif(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+if(CPACK_RPM_PACKAGE_ARCHITECTURE)
+ set(CPACK_PACKAGE_FILE_NAME "ImageProcessing-1.2.0-")
+endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
+set(CPACK_RESOURCE_FILE_LICENSE "/home/openrtm/workspace/ImageProcessing/COPYING.LESSER")
+
+set(CPACK_COMPONENTS_ALL component)
+set(CPACK_COMPONENT_COMPONENT_DISPLAY_NAME "Applications")
+set(CPACK_COMPONENT_COMPONENT_DESCRIPTION
+ "Component library and stand-alone executable")
+if(INSTALL_HEADERS)
+ set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} headers)
+ set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Header files")
+ set(CPACK_COMPONENT_HEADERS_DESCRIPTION
+ "Header files from the component.")
+ set(CPACK_COMPONENT_HEADERS_DEPENDS component)
+endif(INSTALL_HEADERS)
+if(INSTALL_IDL)
+ set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} idl)
+ set(CPACK_COMPONENT_IDL_DISPLAY_NAME "IDL files")
+ set(CPACK_COMPONENT_IDL_DESCRIPTION
+ "IDL files for the component's services.")
+ set(CPACK_COMPONENT_IDL_DEPENDS component)
+endif(INSTALL_IDL)
+set(INSTALL_EXAMPLES )
+if(INSTALL_EXAMPLES)
+ set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} examples)
+ set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
+ set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION
+ "Sample configuration files and other component resources.")
+ set(CPACK_COMPONENT_EXAMPLES_DEPENDS component)
+endif(INSTALL_EXAMPLES)
+set(INSTALL_DOCUMENTATION OFF)
+if(INSTALL_DOCUMENTATION)
+ set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} documentation)
+ set(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation")
+ set(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION
+ "Component documentation")
+ set(CPACK_COMPONENT_DOCUMENTATION_DEPENDS component)
+endif(INSTALL_DOCUMENTATION)
+if(INSTALL_SOURCES)
+ set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} sources)
+ set(CPACK_COMPONENT_SOURCES_DISPLAY_NAME "Source files")
+ set(CPACK_COMPONENT_SOURCES_DESCRIPTION
+ "Source files from the component.")
+endif(INSTALL_SOURCES)
+
+IF (WIN32)
+
+ # Windows WiX package settings
+
+ set(CPACK_WIX_XSL "/home/openrtm/workspace/ImageProcessing/build/wix.xsl")
+ set(CPACK_WIX_LANG "ja-jp")
+ set(CPACK_RESOURCE_FILE_LICENSE
+ "/home/openrtm/workspace/ImageProcessing/cmake/License.rtf")
+ configure_file(
+ "/home/openrtm/workspace/ImageProcessing/cmake/wix.xsl.in"
+ "/home/openrtm/workspace/ImageProcessing/build/wix.xsl" @ONLY)
+
+ set(CPACK_PACKAGE_FILE_NAME
+ "ImageProcessing100")
+
+
+ #
+ #
+ #
+# set(CPACK_NSIS_MUI_ICON "/home/openrtm/workspace/ImageProcessing/cmake\\rt_middleware_logo.ico")
+# set(CPACK_NSIS_MUI_UNIICON "/home/openrtm/workspace/ImageProcessing/cmake\\rt_middleware_logo.ico")
+# set(CPACK_PACKAGE_ICON "/home/openrtm/workspace/ImageProcessing/cmake\\rt_middleware_logo.bmp")
+ set(CPACK_NSIS_HELP_LINK "http://www.openrtm.org")
+ set(CPACK_NSIS_URL_INFO_ABOUT "http://www.openrtm.org")
+ set(CPACK_NSIS_MODIFY_PATH ON)
+ set(CPACK_PACKAGE_EXECUTABLES imageprocessingComp;imageprocessingComp)
+ if(INSTALL_DOCUMENTATION)
+ set(CPACK_NSIS_MENU_LINKS
+ "/usr/local/share/doc/imageprocessing-1/html/index.html"
+ "Component documentation")
+ endif(INSTALL_DOCUMENTATION)
+ string(REPLACE "/ImageProcessing" "" install_prefix_root
+ "/usr/local")
+ file(TO_NATIVE_PATH "${install_prefix_root}" install_prefix_root)
+ set(CPACK_NSIS_INSTALL_ROOT "${install_prefix_root}")
+ set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
+ " Rename \"$INSTDIR\\share\\imageprocessing-1\\imageprocessing-config.cmake\" \"$INSTDIR\\imageprocessing-config.cmake\"
+ Rename \"$INSTDIR\\share\\imageprocessing-1\\imageprocessing-config-version.cmake\" \"$INSTDIR\\imageprocessing-config-version.cmake\"")
+ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
+ " Delete \"$INSTDIR\\imageprocessing-config.cmake\"
+ Delete \"$INSTDIR\\imageprocessing-config-version.cmake\"")
+
+ELSE(WIN32)
+ set(CPACK_GENERATOR DEB)
+ set(CPACK_PACKAGE_CONTACT unknown)
+ENDIF (WIN32)
+
Added: trunk/ImageProcessing/opencv/postinst.in
===================================================================
--- trunk/ImageProcessing/opencv/postinst.in (rev 0)
+++ trunk/ImageProcessing/opencv/postinst.in 2017-02-27 10:19:00 UTC (rev 194)
@@ -0,0 +1,5 @@
+#!/bin/sh
+# postinst script
+set -e
+cd /usr/@INSTALL_PREFIX@
+sh idlcompile.sh
Added: trunk/ImageProcessing/opencv/prerm.in
===================================================================
--- trunk/ImageProcessing/opencv/prerm.in (rev 0)
+++ trunk/ImageProcessing/opencv/prerm.in 2017-02-27 10:19:00 UTC (rev 194)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# prerm script
+sudo rm -rf /usr/@INSTALL_PREFIX@
+
openrtm-commit メーリングリストの案内