[openrtm-commit:02566] r207 - trunk/ImageProcessing/opencv/components/CameraViewer/src
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 4月 11日 (火) 11:58:35 JST
Author: miyamoto
Date: 2017-04-11 11:58:34 +0900 (Tue, 11 Apr 2017)
New Revision: 207
Modified:
trunk/ImageProcessing/opencv/components/CameraViewer/src/CMakeLists.txt
trunk/ImageProcessing/opencv/components/CameraViewer/src/CameraViewer.cpp
Log:
[compat,bugfix,->RELEASE_1_2_0] bug fix. refs #4017
Modified: trunk/ImageProcessing/opencv/components/CameraViewer/src/CMakeLists.txt
===================================================================
--- trunk/ImageProcessing/opencv/components/CameraViewer/src/CMakeLists.txt 2017-03-27 10:10:50 UTC (rev 206)
+++ trunk/ImageProcessing/opencv/components/CameraViewer/src/CMakeLists.txt 2017-04-11 02:58:34 UTC (rev 207)
@@ -1,8 +1,20 @@
set(comp_srcs CameraViewer.cpp )
set(standalone_srcs CameraViewerComp.cpp)
-find_package(OpenCV REQUIRED)
-
+find_package(OpenCV REQUIRED)
+
+
+
+if(UNIX)
+ find_package(PkgConfig)
+ if(PKG_CONFIG_FOUND)
+ PKG_CHECK_MODULES(GTK gtk+-2.0)
+ if(${GTK_VERSION} VERSION_EQUAL 2.24.30)
+ add_definitions(-DSTARTWINDOWTHREAD_DISABLE)
+ endif(${GTK_VERSION} VERSION_EQUAL 2.24.30)
+ endif(PKG_CONFIG_FOUND)
+endif(UNIX)
+
if (DEFINED OPENRTM_INCLUDE_DIRS)
string(REGEX REPLACE "-I" ";"
OPENRTM_INCLUDE_DIRS "${OPENRTM_INCLUDE_DIRS}")
@@ -43,11 +55,11 @@
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
set_source_files_properties(${ALL_IDL_SRCS} PROPERTIES GENERATED 1)
add_dependencies(${PROJECT_NAME} ALL_IDL_TGT)
-target_link_libraries(${PROJECT_NAME} ${OPENRTM_LIBRARIES} ${OpenCV_LIBS})
+target_link_libraries(${PROJECT_NAME} ${OPENRTM_LIBRARIES} ${OpenCV_LIBS})
add_executable(${PROJECT_NAME}Comp ${standalone_srcs}
${comp_srcs} ${comp_headers} ${ALL_IDL_SRCS})
-target_link_libraries(${PROJECT_NAME}Comp ${OPENRTM_LIBRARIES} ${OpenCV_LIBS})
+target_link_libraries(${PROJECT_NAME}Comp ${OPENRTM_LIBRARIES} ${OpenCV_LIBS})
#install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}Comp
# EXPORT ${PROJECT_NAME}
@@ -63,28 +75,28 @@
LIBRARY DESTINATION ${INSTALL_PREFIX} COMPONENT component
ARCHIVE DESTINATION ${INSTALL_PREFIX} COMPONENT component)
-
-if (SolutionDir)
- if (MSVC)
- add_custom_command(
- TARGET ${PROJECT_NAME}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E
- copy ${PROJECT_BINARY_DIR}/src/Release/${PROJECT_NAME}.dll ${SolutionDir}/bin
- )
- add_custom_command(
- TARGET ${PROJECT_NAME}Comp
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E
- copy ${PROJECT_BINARY_DIR}/src/Release/${PROJECT_NAME}Comp.exe ${SolutionDir}/bin
- )
-
- else (MSVC)
- add_custom_command(
- TARGET ${PROJECT_NAME}Comp
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E
- copy ${PROJECT_BINARY_DIR}/src/${PROJECT_NAME}Comp ${SolutionDir}/bin
- )
- endif (MSVC)
-endif (SolutionDir)
+
+if (SolutionDir)
+ if (MSVC)
+ add_custom_command(
+ TARGET ${PROJECT_NAME}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E
+ copy ${PROJECT_BINARY_DIR}/src/Release/${PROJECT_NAME}.dll ${SolutionDir}/bin
+ )
+ add_custom_command(
+ TARGET ${PROJECT_NAME}Comp
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E
+ copy ${PROJECT_BINARY_DIR}/src/Release/${PROJECT_NAME}Comp.exe ${SolutionDir}/bin
+ )
+
+ else (MSVC)
+ add_custom_command(
+ TARGET ${PROJECT_NAME}Comp
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E
+ copy ${PROJECT_BINARY_DIR}/src/${PROJECT_NAME}Comp ${SolutionDir}/bin
+ )
+ endif (MSVC)
+endif (SolutionDir)
Modified: trunk/ImageProcessing/opencv/components/CameraViewer/src/CameraViewer.cpp
===================================================================
--- trunk/ImageProcessing/opencv/components/CameraViewer/src/CameraViewer.cpp 2017-03-27 10:10:50 UTC (rev 206)
+++ trunk/ImageProcessing/opencv/components/CameraViewer/src/CameraViewer.cpp 2017-04-11 02:58:34 UTC (rev 207)
@@ -127,7 +127,10 @@
/* 画像表示用ウィンドウの作成 */
cv::namedWindow("CaptureImage", CV_WINDOW_AUTOSIZE);
cv::setMouseCallback("CaptureImage", onMouse, (void*)this);
-
+
+#ifndef STARTWINDOWTHREAD_DISABLE
+ cv::startWindowThread();
+#endif
return RTC::RTC_OK;
}
@@ -179,9 +182,7 @@
/* 画像表示 */
-#if (!defined WIN32) || (!defined WIN64)
- cv::startWindowThread();
-#endif
+
cv::imshow("CaptureImage", m_orig_img);
if (count > 100)
openrtm-commit メーリングリストの案内