[Jderobot-admin] jderobot-r1071 - in trunk/src/stable/components: basic_component/build-independent openniServer/build-independent

frivas en jderobot.org frivas en jderobot.org
Mar Oct 22 19:13:59 CEST 2013


Author: frivas
Date: 2013-10-22 19:13:59 +0200 (Tue, 22 Oct 2013)
New Revision: 1071

Modified:
   trunk/src/stable/components/basic_component/build-independent/CMakeLists.txt
   trunk/src/stable/components/openniServer/build-independent/CMakeLists.txt
Log:
#25 refactored independents cmakes


Modified: trunk/src/stable/components/basic_component/build-independent/CMakeLists.txt
===================================================================
--- trunk/src/stable/components/basic_component/build-independent/CMakeLists.txt	2013-10-22 15:57:32 UTC (rev 1070)
+++ trunk/src/stable/components/basic_component/build-independent/CMakeLists.txt	2013-10-22 17:13:59 UTC (rev 1071)
@@ -4,7 +4,6 @@
 SET( SOURCE_FILES ../control.cpp ../basic_component.cpp ../API.cpp ../gui.cpp)
 
 SET(INTERFACES_CPP_DIR /usr/local/lib )
-SET( CMAKE_CXX_FLAGS "-lIce -lIceUtil" ) # Opciones para el compilador
 
 include_directories(
     ${INTERFACES_CPP_DIR}
@@ -24,16 +23,63 @@
 include_directories(${libglademm_INCLUDE_DIRS})
 link_directories(${libglademm_LIBRARY_DIRS})
 
-find_package(OpenCV REQUIRED)
 
+FIND_PATH( OpenCV_INCLUDE_DIR NAMES cv.h  PATHS ENV C++LIB ENV PATH PATH_SUFFIXES include/opencv/)
+IF( OpenCV_INCLUDE_DIR )
+	MESSAGE("OpenCV was found in: ${OpenCV_INCLUDE_DIR}")
+	
+    FIND_LIBRARY( OpenCV_LIBRARY1 NAMES opencv_core PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY2 NAMES opencv_highgui PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY3 NAMES opencv_contrib PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY4 NAMES opencv_calib3d PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY5 NAMES opencv_flann PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY6 NAMES opencv_gpu PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY7 NAMES opencv_imgproc PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY8 NAMES opencv_legacy PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY9 NAMES opencv_ml PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY11 NAMES opencv_objdetect PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY14 NAMES opencv_video PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    SET (OpenCV_LIBRARIES ${OpenCV_LIBRARY1} ${OpenCV_LIBRARY5}  ${OpenCV_LIBRARY7}  ${OpenCV_LIBRARY9}  ${OpenCV_LIBRARY14} )
+    SET (OpenCVGUI_LIBRARIES ${OpenCV_LIBRARY2} ${OpenCV_LIBRARY3} ${OpenCV_LIBRARY4} ${OpenCV_LIBRARY6} ${OpenCV_LIBRARY8} ${OpenCV_LIBRARY11})
+    IF( OpenCV_LIBRARIES )
+		#MESSAGE("OPENCV LIBRARY FOUND IN ${OpenCV_LIBRARIES}")
+    ENDIF( OpenCV_LIBRARIES )
+ENDIF(OpenCV_INCLUDE_DIR)
+
+IF (NOT  OpenCV_INCLUDE_DIR)
+	MESSAGE("*** OpenCV not found")
+ENDIF()
+
+find_package(Threads)
+
+
+#manual ICE
+FIND_PATH( Ice_INCLUDE_DIR NAMES Ice/Ice.h  PATHS ENV C++LIB ENV)
+ 
+IF( Ice_INCLUDE_DIR )
+    FIND_LIBRARY( Ice_LIBRARY1 NAMES Ice PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64 )
+    FIND_LIBRARY( Ice_LIBRARY2 NAMES IceUtil PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    SET (Ice_LIBRARIES ${Ice_LIBRARY1} ${Ice_LIBRARY2})
+    IF( Ice_LIBRARIES )
+		MESSAGE ("-- Ice found at ${Ice_LIBRARIES}")
+		include_directories(${Ice_INCLUDE_DIR})
+		link_directories(${Ice_LIBRARIES})
+    ENDIF( Ice_LIBRARIES )
+ENDIF(Ice_INCLUDE_DIR)
+
+IF(NOT Ice_LIBRARIES)
+		MESSAGE ("*** Ice not found")
+ENDIF()
+
+
 add_executable (basic_component  ${SOURCE_FILES})
 
 TARGET_LINK_LIBRARIES(basic_component 
+	  ${CMAKE_THREAD_LIBS_INIT}
     ${INTERFACES_CPP_DIR}/jderobot/libJderobotInterfaces.so
     ${INTERFACES_CPP_DIR}/jderobot/libjderobotutil.so
     ${INTERFACES_CPP_DIR}/jderobot/libcolorspacesmm.so
     ${libglademm_LIBRARIES}
-    ${OpenCV_LIBS}
-#	${gtkmm_LIBRARIES}  
-#	${gthread_LIBRARIES}
+    ${OpenCV_LIBRARIES}
+		${Ice_LIBRARIES}
 )

Modified: trunk/src/stable/components/openniServer/build-independent/CMakeLists.txt
===================================================================
--- trunk/src/stable/components/openniServer/build-independent/CMakeLists.txt	2013-10-22 15:57:32 UTC (rev 1070)
+++ trunk/src/stable/components/openniServer/build-independent/CMakeLists.txt	2013-10-22 17:13:59 UTC (rev 1071)
@@ -10,19 +10,49 @@
 
 add_executable (openniServer  ${SOURCE_FILES})
 
-#automated opencv
 include(FindPkgConfig)
-PKG_CHECK_MODULES(opencv REQUIRED opencv)
-include_directories(${opencv_INCLUDE_DIRS})
-link_directories(${opencv_LIBRARY_DIRS})
+#manual opencv
+FIND_PATH( OpenCV_INCLUDE_DIR NAMES cv.h  PATHS ENV C++LIB ENV PATH PATH_SUFFIXES include/opencv/)
+IF( OpenCV_INCLUDE_DIR )
+	MESSAGE("OpenCV was found in: ${OpenCV_INCLUDE_DIR}")
+	
+    FIND_LIBRARY( OpenCV_LIBRARY1 NAMES opencv_core PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY2 NAMES opencv_highgui PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY3 NAMES opencv_contrib PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY4 NAMES opencv_calib3d PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY5 NAMES opencv_flann PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY6 NAMES opencv_gpu PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY7 NAMES opencv_imgproc PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY8 NAMES opencv_legacy PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY9 NAMES opencv_ml PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY11 NAMES opencv_objdetect PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    FIND_LIBRARY( OpenCV_LIBRARY14 NAMES opencv_video PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    SET (OpenCV_LIBRARIES ${OpenCV_LIBRARY1} ${OpenCV_LIBRARY5}  ${OpenCV_LIBRARY7}  ${OpenCV_LIBRARY9}  ${OpenCV_LIBRARY14} )
+    SET (OpenCVGUI_LIBRARIES ${OpenCV_LIBRARY2} ${OpenCV_LIBRARY3} ${OpenCV_LIBRARY4} ${OpenCV_LIBRARY6} ${OpenCV_LIBRARY8} ${OpenCV_LIBRARY11})
+    IF( OpenCV_LIBRARIES )
+		#MESSAGE("OPENCV LIBRARY FOUND IN ${OpenCV_LIBRARIES}")
+    ENDIF( OpenCV_LIBRARIES )
+ENDIF(OpenCV_INCLUDE_DIR)
+
+IF (NOT  OpenCV_INCLUDE_DIR)
+	MESSAGE("*** OpenCV not found")
+ENDIF()
+
+link_directories(${OpenCV_LIBRARIES})
+include_directories(${OpenCV_INCLUDE_DIR})
+
+
+
+
+
 #automated gsl
 PKG_CHECK_MODULES(gsl REQUIRED gsl)
 include_directories(${gsl_INCLUDE_DIRS})
 link_directories(${gsl_LIBRARY_DIRS})
 
+find_package(Threads)
 
 
-
 #manual openni libraries
 SET ( OPENNI2_INC $ENV{OPENNI2_INCLUDE})
 SET ( OPENNI2_LIB $ENV{OPENNI2_REDIST})
@@ -94,24 +124,26 @@
 	endif()
 
 	TARGET_LINK_LIBRARIES(openniServer
-	  ${opencv_LIBRARIES}
+		${CMAKE_THREAD_LIBS_INIT}
+	  ${OpenCV_LIBRARIES}
+		${OpenCVGUI_LIBRARIES}
 	  ${gsl_LIBRARIES}
 	  ${Ice_LIBRARIES}
 	  ${LIBS_DIR}/libcolorspacesmm.so
 	  ${LIBS_DIR}/libJderobotInterfaces.so
-	  ${LIBS_DIR}/libjderobotutil.so
 	  ${LIBS_DIR}/libprogeo.so
 	  ${OPENNI2_LIB}/libOpenNI2.so
 	  ${NITE2_LIB}/libNiTE2.so
 	)
 else()
 	TARGET_LINK_LIBRARIES(openniServer
-	  ${opencv_LIBRARIES}
+		${CMAKE_THREAD_LIBS_INIT}
+	  ${OpenCV_LIBRARIES}
+		${OpenCVGUI_LIBRARIES}
 	  ${gsl_LIBRARIES}
 	  ${Ice_LIBRARIES}
 	  ${LIBS_DIR}/libcolorspacesmm.so
 	  ${LIBS_DIR}/libJderobotInterfaces.so
-	  ${LIBS_DIR}/libjderobotutil.so
 	  ${LIBS_DIR}/libprogeo.so
 	  ${OPENNI2_LIB}/libOpenNI2.so
 	)



More information about the Jderobot-admin mailing list