[openrtm-commit:02445] r190 - in trunk/ImageProcessing/opencv: . components/Affine components/BackGroundSubtractionSimple components/Binarization components/CameraViewer components/Chromakey components/Dilationerosion components/DirectShowCam components/Edge components/Findcontour components/Flip components/Histogram components/Houghline components/ImageCalibration components/ImageSubstraction components/MFCamera components/ObjectTracking components/OpenCVCamera components/PGRCamera components/Perspective components/RockPaperScissors components/Rotate components/Scale components/Sepia components/SubStractCaptureImage components/Template components/TkCalibGUI components/Translate
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 2月 15日 (水) 15:16:19 JST
Author: kawauchi
Date: 2017-02-15 15:16:19 +0900 (Wed, 15 Feb 2017)
New Revision: 190
Modified:
trunk/ImageProcessing/opencv/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Affine/CMakeLists.txt
trunk/ImageProcessing/opencv/components/BackGroundSubtractionSimple/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Binarization/CMakeLists.txt
trunk/ImageProcessing/opencv/components/CameraViewer/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Chromakey/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Dilationerosion/CMakeLists.txt
trunk/ImageProcessing/opencv/components/DirectShowCam/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Edge/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Findcontour/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Flip/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Histogram/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Houghline/CMakeLists.txt
trunk/ImageProcessing/opencv/components/ImageCalibration/CMakeLists.txt
trunk/ImageProcessing/opencv/components/ImageSubstraction/CMakeLists.txt
trunk/ImageProcessing/opencv/components/MFCamera/CMakeLists.txt
trunk/ImageProcessing/opencv/components/ObjectTracking/CMakeLists.txt
trunk/ImageProcessing/opencv/components/OpenCVCamera/CMakeLists.txt
trunk/ImageProcessing/opencv/components/PGRCamera/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Perspective/CMakeLists.txt
trunk/ImageProcessing/opencv/components/RockPaperScissors/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Rotate/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Scale/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Sepia/CMakeLists.txt
trunk/ImageProcessing/opencv/components/SubStractCaptureImage/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Template/CMakeLists.txt
trunk/ImageProcessing/opencv/components/TkCalibGUI/CMakeLists.txt
trunk/ImageProcessing/opencv/components/Translate/CMakeLists.txt
Log:
LINUX_PACKAGE_GENERATOR judgment method of r186 has been changed. refs #3825
Modified: trunk/ImageProcessing/opencv/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -4,25 +4,57 @@
SUBDIRS(components)
set(SolutionDir ${PROJECT_SOURCE_DIR})
-if(NOT WIN32)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
configure_file(${SolutionDir}/build_linux_package.sh.in
${PROJECT_BINARY_DIR}/build_linux_package.sh
Modified: trunk/ImageProcessing/opencv/components/Affine/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Affine/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Affine/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/BackGroundSubtractionSimple/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/BackGroundSubtractionSimple/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/BackGroundSubtractionSimple/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Binarization/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Binarization/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Binarization/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/CameraViewer/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/CameraViewer/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/CameraViewer/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Chromakey/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Chromakey/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Chromakey/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Dilationerosion/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Dilationerosion/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Dilationerosion/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/DirectShowCam/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/DirectShowCam/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/DirectShowCam/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -13,25 +13,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Edge/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Edge/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Edge/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Findcontour/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Findcontour/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Findcontour/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Flip/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Flip/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Flip/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Histogram/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Histogram/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Histogram/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Houghline/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Houghline/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Houghline/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/ImageCalibration/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/ImageCalibration/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/ImageCalibration/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/ImageSubstraction/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/ImageSubstraction/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/ImageSubstraction/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/MFCamera/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/MFCamera/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/MFCamera/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/ObjectTracking/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/ObjectTracking/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/ObjectTracking/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/OpenCVCamera/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/OpenCVCamera/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/OpenCVCamera/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/PGRCamera/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/PGRCamera/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/PGRCamera/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Perspective/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Perspective/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Perspective/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/RockPaperScissors/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/RockPaperScissors/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/RockPaperScissors/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Rotate/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Rotate/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Rotate/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Scale/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Scale/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Scale/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Sepia/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Sepia/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Sepia/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/SubStractCaptureImage/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/SubStractCaptureImage/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/SubStractCaptureImage/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/Template/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Template/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Template/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
Modified: trunk/ImageProcessing/opencv/components/TkCalibGUI/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/TkCalibGUI/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/TkCalibGUI/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -5,25 +5,57 @@
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
# component settings
set(RTC_NAME "${PROJECT_NAME}")
Modified: trunk/ImageProcessing/opencv/components/Translate/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/Translate/CMakeLists.txt 2017-02-15 05:52:12 UTC (rev 189)
+++ trunk/ImageProcessing/opencv/components/Translate/CMakeLists.txt 2017-02-15 06:16:19 UTC (rev 190)
@@ -11,25 +11,57 @@
set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST")
-if(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
- find_program(DPKG_CMD dpkg)
- if(DPKG_CMD)
- set(LINUX_PACKAGE_GENERATOR "DEB")
- execute_process(COMMAND "${DPKG_CMD}" --print-architecture
+function(get_dist ARG0)
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${ARG0} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dist_name} MATCHES ${dist})
+ set(${ARG0} ${dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${DIST_NAME} MATCHES "Debian" OR
+ ${DIST_NAME} MATCHES "Ubuntu")
+ set(${ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${DIST_NAME} MATCHES "RedHat" OR
+ ${DIST_NAME} MATCHES "Fedora" OR
+ ${DIST_NAME} MATCHES "CentOS")
+ set(${ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${PKGMGR})
+ if(${PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "dpkg is found. arch = ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
- endif(DPKG_CMD)
-
- find_program(RPM_CMD rpmbuild)
- if(RPM_CMD)
- set(LINUX_PACKAGE_GENERATOR "RPM")
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${PKGMGR} MATCHES "RPM")
execute_process(COMMAND uname "-m"
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "rpmbuild is found. arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(RPM_CMD)
-endif(NOT WIN32 AND NOT LINUX_PACKAGE_GENERATOR)
+ message(STATUS "Package manager is ${PKGMGR}. Arch is ${CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
set(PROJECT_TYPE "c++/opencv-rtcs")
openrtm-commit メーリングリストの案内