[Jderobot-admin] jderobot-r1124 - in trunk: Deps/openni2 src/stable/components/openniServer src/stable/components/openniServer/build-independent

frivas en jderobot.org frivas en jderobot.org
Lun Dic 2 19:41:06 CET 2013


Author: frivas
Date: 2013-12-02 19:41:05 +0100 (Mon, 02 Dec 2013)
New Revision: 1124

Modified:
   trunk/Deps/openni2/CMakeLists.txt
   trunk/src/stable/components/openniServer/CMakeLists.txt
   trunk/src/stable/components/openniServer/build-independent/CMakeLists.txt
Log:
#81 modified the openniServer cmakes in order to work with debian packages


Modified: trunk/Deps/openni2/CMakeLists.txt
===================================================================
--- trunk/Deps/openni2/CMakeLists.txt	2013-12-01 19:53:53 UTC (rev 1123)
+++ trunk/Deps/openni2/CMakeLists.txt	2013-12-02 18:41:05 UTC (rev 1124)
@@ -1,17 +1,15 @@
 #manual openni libraries
-SET ( OPENNI2_INC $ENV{OPENNI2_INCLUDE})
-SET ( OPENNI2_LIB $ENV{OPENNI2_REDIST})
-
-if (OPENNI2_INC AND OPENNI2_LIB)
-	message(STATUS "OpenNI found at ${OPENNI2_LIB}")
-	include_directories(${OPENNI2_INC})
-	link_directories(${OPENNI2_LIB}/libOpenNI2.so)
+FIND_PATH( OPENNI2_INC NAMES OpenNI.h  PATHS ENV C++LIB ENV PATH PATH_SUFFIXES openni2)
+IF( OPENNI2_INC )
+	message(STATUS "OpenNI2 found at ${OPENNI2_LIB}")
+	FIND_LIBRARY( OPENNI2_LIB NAMES OpenNI2 PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib/openni2 lib64/openni2)
+	FIND_PATH( OPENNI2_LIB_PATH NAMES libOpenNI2.so PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib/openni2 lib64/openni2)
 	if (NOT IS_DIRECTORY ./OpenNI2)
-		message ("--CMake will install local OpenNI2 lib and Driver")
-		file (COPY ${OPENNI2_LIB}/libOpenNI2.so DESTINATION .)
-		file (COPY ${OPENNI2_LIB}/OpenNI2 DESTINATION .)
+		file (COPY ${OPENNI2_LIB} DESTINATION .)
+		file (COPY ${OPENNI2_LIB_PATH}/OpenNI2 DESTINATION .)
+		message("-------------CMake will install local OpenNI2 lib and Driver")
 	endif()
-else()
+	include_directories(${OPENNI2_INC})
+ELSE()
 	message("OpenNI2 library not found")
-endif()
-
+ENDIF()

Modified: trunk/src/stable/components/openniServer/CMakeLists.txt
===================================================================
--- trunk/src/stable/components/openniServer/CMakeLists.txt	2013-12-01 19:53:53 UTC (rev 1123)
+++ trunk/src/stable/components/openniServer/CMakeLists.txt	2013-12-02 18:41:05 UTC (rev 1124)
@@ -24,10 +24,9 @@
     add_executable (openniServer ${SOURCE_FILES})
 	#copy openni libs to local path
 	if (NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OpenNI2)
-		message ("--CMake will install local OpenNI2 lib and Driver")
-		file (COPY ${OPENNI2_LIB}/libOpenNI2.so DESTINATION .)
-		set (concat "/")
-		file (COPY ${OPENNI2_LIB}/OpenNI2 DESTINATION ${CMAKE_CURRENT_SOURCE_DIR})
+		file (COPY ${OPENNI2_LIB} DESTINATION .)
+		file (COPY ${OPENNI2_LIB_PATH}/OpenNI2 DESTINATION .)
+		
 	endif()
 
 
@@ -52,7 +51,7 @@
         geometry
         colorspacesmm
         JderobotInterfaces
-	${OPENNI2_LIB}/libOpenNI2.so
+	${OPENNI2_LIB}
 	${NITE2_LIB}/libNiTE2.so
 	${Boost_LIBRARIES}
         ${LIBXML2_LIBRARIES}
@@ -68,7 +67,7 @@
         geometry
         colorspacesmm
         JderobotInterfaces
-	${OPENNI2_LIB}/libOpenNI2.so
+	${OPENNI2_LIB}
         ${Boost_LIBRARIES}
         ${LIBXML2_LIBRARIES}
 	)

Modified: trunk/src/stable/components/openniServer/build-independent/CMakeLists.txt
===================================================================
--- trunk/src/stable/components/openniServer/build-independent/CMakeLists.txt	2013-12-01 19:53:53 UTC (rev 1123)
+++ trunk/src/stable/components/openniServer/build-independent/CMakeLists.txt	2013-12-02 18:41:05 UTC (rev 1124)
@@ -53,19 +53,22 @@
 find_package(Threads)
 
 
-#manual openni libraries
-SET ( OPENNI2_INC $ENV{OPENNI2_INCLUDE})
-SET ( OPENNI2_LIB $ENV{OPENNI2_REDIST})
+FIND_PATH( OPENNI2_INC NAMES OpenNI.h  PATHS ENV C++LIB ENV PATH PATH_SUFFIXES openni2)
+IF( OPENNI2_INC )
+	message(STATUS "OpenNI2 found at ${OPENNI2_LIB}")
+	FIND_LIBRARY( OPENNI2_LIB NAMES OpenNI2 PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib/openni2 lib64/openni2)
+	FIND_PATH( OPENNI2_LIB_PATH NAMES libOpenNI2.so PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib/openni2 lib64/openni2)
+	if (NOT IS_DIRECTORY ./OpenNI2)
+		file (COPY ${OPENNI2_LIB} DESTINATION .)
+		file (COPY ${OPENNI2_LIB_PATH}/OpenNI2 DESTINATION .)
+		message("-------------CMake will install local OpenNI2 lib and Driver")
+	endif()
+	include_directories(${OPENNI2_INC})
+ELSE()
+	message("OpenNI2 library not found")
+ENDIF()
 
-if (OPENNI2_INC AND OPENNI2_LIB)
-	message(STATUS "OpenNI found at ${OPENNI2_LIB}")
-else()
-	message(FATAL_ERROR "OpenNI2 library not found")
-endif()
-include_directories(${OPENNI2_INC})
-link_directories(${OPENNI2_LIB}/libOpenNI2.so)
 
-
 #manual nite libraries
 SET ( NITE2_INC $ENV{NITE2_INCLUDE})
 SET ( NITE2_LIB $ENV{NITE2_REDIST})
@@ -101,8 +104,31 @@
 		MESSAGE ("*** Ice not found")
 ENDIF()
 
+FIND_PATH( LIBXML2_INCLUDE_DIR NAMES libxml/parser.h PATHS ENV C++LIB ENV PATH PATH_SUFFIXES include/libxml2/)
+IF( LIBXML2_INCLUDE_DIR )
 
+    MESSAGE("*** LIBXML2 ok: ${LIBXML2_INCLUDE_DIR}")
+    FIND_LIBRARY( LIBXML2_LIBRARY1 NAMES xml2 PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+   
+    SET (LIBXML2_LIBRARIES ${LIBXML2_LIBRARY1} )
+    IF( LIBXML2_LIBRARIES )
+		#MESSAGE("LIBXML2 LIBRARY FOUND IN ${LIBXML2_LIBRARIES}")
+    ENDIF(LIBXML2_LIBRARIES )
 
+ENDIF(LIBXML2_INCLUDE_DIR)
+
+IF (NOT  LIBXML2_INCLUDE_DIR)
+	MESSAGE("*** LIBXML2 not found")
+ENDIF()
+
+
+
+link_directories(${LIBXML2_LIBRARIES})
+include_directories(${LIBXML2_INCLUDE_DIR})
+
+
+
+
 set( CMAKE_CXX_FLAGS "-Wno-deprecated -Wl,-rpath ./" ) # Opciones para el compilador
 
 if (NOT IS_DIRECTORY ./OpenNI2)
@@ -132,8 +158,10 @@
 	  ${LIBS_DIR}/libcolorspacesmm.so
 	  ${LIBS_DIR}/libJderobotInterfaces.so
 	  ${LIBS_DIR}/libprogeo.so
-	  ${OPENNI2_LIB}/libOpenNI2.so
+	${LIBS_DIR}/libgeometry.so	
+	  ${OPENNI2_LIB}
 	  ${NITE2_LIB}/libNiTE2.so
+	${LIBXML2_LIBRARIES}
 	)
 else()
 	TARGET_LINK_LIBRARIES(openniServer
@@ -145,6 +173,8 @@
 	  ${LIBS_DIR}/libcolorspacesmm.so
 	  ${LIBS_DIR}/libJderobotInterfaces.so
 	  ${LIBS_DIR}/libprogeo.so
-	  ${OPENNI2_LIB}/libOpenNI2.so
+${LIBS_DIR}/libgeometry.so
+	  ${OPENNI2_LIB}
+${LIBXML2_LIBRARIES}
 	)
 endif()



More information about the Jderobot-admin mailing list