XERCES not found

All about Linux portage
pacoes3d
Posts: 7
Joined: Thu Feb 02, 2012 9:16 pm

XERCES not found

Post by pacoes3d »

Hello,

I've problems compiling with E57.

XERECES-C is installed on the system (OpenSuSE 12.2), but cmake cannot recognize it. I've not found the findxerces.cmake or similar file to search. Creating a findxercesc.cmake on Cloudcompare root directory doesn't solve.

¿Any idea?.

Thanks in advance.



Francisco.
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: XERCES not found

Post by daniel »

On Windows, the findxerces module is provided by libE57 (in \cmake\Modules). Do you have it on Linux?
Daniel, CloudCompare admin
pacoes3d
Posts: 7
Joined: Thu Feb 02, 2012 9:16 pm

Re: XERCES not found

Post by pacoes3d »

Hello, Daniel,

Thank you for que quick answer.

For any reason, findxerces is found at contrib/cmake/modules, but it only search for a windows installation, so I have to replace it with the libe57 tailored version (original doesn't find xercesc), but this carries another nuissance :

E57support.cmake has a problem in line 57:

target_link_libraries( ${ARGV0} debug ${Xerces_LIBRARY_DEBUG} optimized ${Xerces_LIBRARY_RELEASE} ${Boost_LIBRARIES} )

On standard xerces-c distributions (AFAIK), there is not a special debug library, so XERCES_LIBRARY_DEBUG points to Not found, and Cmake fails. Xerces_LIBRARY should be replaced with XERCESC_LIBRARY, I suppose.

Next problem arise with qCC. In directory qCC/CMakeFiles there is not CMakefiles.txt, but CMakeFiles/, so cmake fails. I'm tracing now.

Enclose my tailored version of findXERCESC.cmake.:

Code: Select all

# - Try to find Xerces-C
# Once done this will define
#
#  XERCESC_FOUND - system has Xerces-C
#  XERCESC_INCLUDE - the Xerces-C include directory
#  XERCESC_LIBRARY - Link these to use Xerces-C
#  XERCESC_VERSION - Xerces-C found version

IF (XERCESC_INCLUDE AND XERCESC_LIBRARY)
# in cache already
SET(XERCESC_FIND_QUIETLY FALSE)
ENDIF (XERCESC_INCLUDE AND XERCESC_LIBRARY)

OPTION(XERCESC_STATIC "Set to ON to link your project with static library (instead of DLL)." ON)

IF (NOT  ${XERCESC_WAS_STATIC} STREQUAL ${XERCESC_STATIC})
UNSET(XERCESC_LIBRARY CACHE)
UNSET(XERCESC_LIBRARY_DEBUG CACHE)
ENDIF (NOT  ${XERCESC_WAS_STATIC} STREQUAL ${XERCESC_STATIC})

SET(XERCESC_WAS_STATIC ${XERCESC_STATIC} CACHE INTERNAL "" )

FIND_PATH(XERCESC_INCLUDE NAMES xercesc/util/XercesVersion.hpp
PATHS 
$ENV{XERCESC_INCLUDE_DIR}
${XERCESC_INCLUDE_DIR}
 /usr/local/include
 /usr/include
)

IF (XERCESC_STATIC)
FIND_LIBRARY(XERCESC_LIBRARY NAMES xerces-c_static_3 xerces-c-3.1 xerces-c
 PATHS
 $ENV{XERCESC_LIBRARY_DIR}
 ${XERCESC_LIBRARY_DIR}
 /usr/lib64
 /usr/local/lib
)
FIND_LIBRARY(XERCESC_LIBRARY_DEBUG NAMES xerces-c_static_3D xerces-c-3.1D
 PATHS
 $ENV{XERCESC_LIBRARY_DIR}
 ${XERCESC_LIBRARY_DIR}
 /usr/lib64
 /usr/local/lib
)
ADD_DEFINITIONS( -DXERCES_STATIC_LIBRARY )
ELSE (XERCESC_STATIC)
FIND_LIBRARY(XERCESC_LIBRARY NAMES xerces-c_3
 PATHS
 $ENV{XERCESC_LIBRARY_DIR}
 ${XERCESC_LIBRARY_DIR}
)
FIND_LIBRARY(XERCESC_LIBRARY_DEBUG NAMES xerces-c_3D
 PATHS
 $ENV{XERCESC_LIBRARY_DIR}
 ${XERCESC_LIBRARY_DIR}
)
ENDIF (XERCESC_STATIC)

IF (XERCESC_INCLUDE AND XERCESC_LIBRARY)
SET(XERCESC_FOUND TRUE)
ELSE (XERCESC_INCLUDE AND XERCESC_LIBRARY)
SET(XERCESC_FOUND FALSE)
ENDIF (XERCESC_INCLUDE AND XERCESC_LIBRARY)

IF(XERCESC_FOUND)

FIND_PATH(XERCESC_XVERHPPPATH NAMES XercesVersion.hpp PATHS
 ${XERCESC_INCLUDE}
 PATH_SUFFIXES xercesc/util)

IF ( ${XERCESC_XVERHPPPATH} STREQUAL XERCESC_XVERHPPPATH-NOTFOUND )
 SET(XERCES_VERSION "0")
ELSE( ${XERCESC_XVERHPPPATH} STREQUAL XERCESC_XVERHPPPATH-NOTFOUND )
 FILE(READ ${XERCESC_XVERHPPPATH}/XercesVersion.hpp XVERHPP)

 STRING(REGEX MATCHALL "\n *#define XERCES_VERSION_MAJOR +[0-9]+" XVERMAJ
   ${XVERHPP})
 STRING(REGEX MATCH "\n *#define XERCES_VERSION_MINOR +[0-9]+" XVERMIN
   ${XVERHPP})
 STRING(REGEX MATCH "\n *#define XERCES_VERSION_REVISION +[0-9]+" XVERREV
   ${XVERHPP})

 STRING(REGEX REPLACE "\n *#define XERCES_VERSION_MAJOR +" ""
   XVERMAJ ${XVERMAJ})
 STRING(REGEX REPLACE "\n *#define XERCES_VERSION_MINOR +" ""
   XVERMIN ${XVERMIN})
 STRING(REGEX REPLACE "\n *#define XERCES_VERSION_REVISION +" ""
   XVERREV ${XVERREV})

 SET(XERCESC_VERSION ${XVERMAJ}.${XVERMIN}.${XVERREV})

ENDIF ( ${XERCESC_XVERHPPPATH} STREQUAL XERCESC_XVERHPPPATH-NOTFOUND )

IF(NOT XERCESC_FIND_QUIETLY)
 MESSAGE(STATUS "Found Xerces-C: ${XERCESC_LIBRARY}")
 MESSAGE(STATUS "              : ${XERCESC_INCLUDE}")
 MESSAGE(STATUS "       Version: ${XERCESC_VERSION}")
ENDIF(NOT XERCESC_FIND_QUIETLY)
ELSE(XERCESC_FOUND)
MESSAGE(FATAL_ERROR "Could not find Xerces-C !")
ENDIF(XERCESC_FOUND)

MARK_AS_ADVANCED(XERCESC_INCLUDE XERCESC_LIBRARY)
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: XERCES not found

Post by daniel »

Thanks for the feedback. And indeed, the support for E57 was only for Windows up to now.

Can you push your modifications on the github trunk?
Daniel, CloudCompare admin
pacoes3d
Posts: 7
Joined: Thu Feb 02, 2012 9:16 pm

Re: XERCES not found

Post by pacoes3d »

Hello, Daniel,

Thanks for the effort, Linux users will try to "rememer" you we exist :-D

I will try. I'm not an github regular user.

Best regards.
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: XERCES not found

Post by daniel »

XIOT (for X3D files support) requires Xerces as well.

However, Xiot is clearly not working very well. We are currently looking for a reliable (and GPL) way to load X3D files.
Daniel, CloudCompare admin
ralph058
Posts: 1
Joined: Mon Aug 18, 2014 4:04 pm

Re: XERCES not found

Post by ralph058 »

Hi Daniel
My goal was to find a means to compare a PCL point cloud (PCD) of a person with an X3D model of a person (H-Anim) and scale them to match. I had intended to use libx3d (LGPL) and generate a PCD from the model. Your library seemed to fill the bill for me without having to create things (too much) from scratch.

I haven't coded for many years and learn best from examples. There are too few examples in libx3d for me to be of use. So, I have to revert to documentation.

Your library seemed to fill the bill because it had the CloudCompare, PCD input and X3D input. With your forum, I had hoped for a resource when I had issues. I can't seem to get it to recognize my installation of Xerces. Although I could still write my own libx3d interface, if I need Xerces, I can't use the CC library.
Ralph
jgpallero
Posts: 44
Joined: Thu Dec 12, 2013 2:00 pm

Re: XERCES not found

Post by jgpallero »

daniel wrote:Thanks for the feedback. And indeed, the support for E57 was only for Windows up to now.

Can you push your modifications on the github trunk?
I know this answer is a bit old, but is still valid? I'm trying to compile CloudCOmpare 2.6.1 on Debian and I'm having problems finding xerces. I've compiled the E57 library and put the path on the LIBE57_INSTALL_DIR and there is no problem. But also I've compiled xerces-c-3.1.2 and put its path in XERCES_ROOT, but I obtain

Code: Select all

CMake Error at contrib/E57Support.cmake:36 (message):
  Unable to find Xerces library.  Please make XERCES_ROOT point to the root
  of Xerces directory.
Call Stack (most recent call first):
  contrib/AllSupport.cmake:8 (include)
  CMakeLists.txt:68 (include)
The xerces installation folder contains bin/, include/ and lib/ folders, and the Include/ one contains xercesc/dom/, xercesc/framework/, xercesc/internal/, xercesc/parsers/, xercesc/sax/, xercesc/sax2/, xercesc/util/, xercesc/validators/, and xercesc/xinclude/ subfolders
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: XERCES not found

Post by daniel »

In the CMake script/configuration of CloudCompare, you don't need to set the XERCES_ROOT variable but the ' Xerces_INCLUDE_DIR' and 'Xerces_LIBRARY_RELEASE' or 'Xerces_LIBRARY_DEBUG' instead (at least on Windows - and you may need to display the 'advanced' variables if you use CMake GUI).

I guess on Linux/gcc you can skip the debug library file.

Does it help?
Daniel, CloudCompare admin
jgpallero
Posts: 44
Joined: Thu Dec 12, 2013 2:00 pm

Re: XERCES not found

Post by jgpallero »

daniel wrote:In the CMake script/configuration of CloudCompare, you don't need to set the XERCES_ROOT variable but the ' Xerces_INCLUDE_DIR' and 'Xerces_LIBRARY_RELEASE' or 'Xerces_LIBRARY_DEBUG' instead (at least on Windows - and you may need to display the 'advanced' variables if you use CMake GUI).

I guess on Linux/gcc you can skip the debug library file.

Does it help?
Thank you for your answer. I'm using cmake-gui 3.2.2 in Debian Sid. When I try to configure CloudCompare I see only the XERCES_ROOT, but not Xerces_LIBRARY_RELEASE nor Xerces_LIBRARY_DEBUG

Thanks
Post Reply