Add ability to have external orocos-kdl library instead of the suplied

in FreeCAD, used in Robot and Path workbenches

cmake switch: FREECAD_USE_EXTERNAL_KDL

Makes Robot workbench and Path compilable on OS X 10.9
This commit is contained in:
Fredrik Johansson 2015-06-22 00:33:53 +02:00 committed by wmayer
parent bc920f9a24
commit 16c740a6f9
2 changed files with 36 additions and 11 deletions

View File

@ -119,6 +119,7 @@ OPTION(FREECAD_MAINTAINERS_BUILD "Build FreeCAD for Maintainers, with Docu and 3
OPTION(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF) OPTION(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF)
OPTION(FREECAD_USE_EXTERNAL_PIVY "Use system installed python-pivy instead of the bundled." OFF) OPTION(FREECAD_USE_EXTERNAL_PIVY "Use system installed python-pivy instead of the bundled." OFF)
OPTION(FREECAD_USE_EXTERNAL_SMESH "Use system installed smesh instead of the bundled." OFF) OPTION(FREECAD_USE_EXTERNAL_SMESH "Use system installed smesh instead of the bundled." OFF)
OPTION(FREECAD_USE_EXTERNAL_KDL "Use system installed orocos-kdl instead of the bundled." OFF)
OPTION(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF) OPTION(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)
if(APPLE) if(APPLE)

View File

@ -26,12 +26,6 @@ set(Robot_LIBS
FreeCADApp FreeCADApp
) )
FILE( GLOB KDL_SRCS kdl_cp/[^.]*.cpp )
FILE( GLOB KDL_HPPS kdl_cp/[^.]*.hpp kdl_cp/[^.]*.inl)
FILE( GLOB UTIL_SRCS kdl_cp/utilities/[^.]*.cpp kdl_cp/utilities/[^.]*.cxx)
FILE( GLOB UTIL_HPPS kdl_cp/utilities/[^.]*.h kdl_cp/utilities/[^.]*.hpp)
generate_from_xml(Robot6AxisPy) generate_from_xml(Robot6AxisPy)
generate_from_xml(TrajectoryPy) generate_from_xml(TrajectoryPy)
generate_from_xml(WaypointPy) generate_from_xml(WaypointPy)
@ -79,17 +73,47 @@ SET(Robot_SRCS
Simulation.h Simulation.h
Waypoint.cpp Waypoint.cpp
Waypoint.h Waypoint.h
${KDL_SRCS}
${KDL_HPPS}
${UTIL_SRCS}
${UTIL_HPPS}
${Mod_SRCS} ${Mod_SRCS}
${Python_SRCS} ${Python_SRCS}
) )
# use external kdl
if (FREECAD_USE_EXTERNAL_KDL)
find_library(KDL_LIBRARY orocos-kdl)
find_path(KDL_INCLUDES kdl/kdl.hpp)
if(KDL_LIBRARY)
message(STATUS "Found orocos-kdl: ${KDL_LIBRARY}")
endif()
if(KDL_INCLUDES)
message(STATUS "Found orocus_kdl headers: ${KDL_INCLUDES}")
endif()
if(KDL_LIBRARY AND KDL_INCLUDES)
list(APPEND Robot_LIBS ${KDL_LIBRARY})
include_directories(${KDL_INCLUDES})
else()
message(FATAL_ERROR "Using external orocos-kdl was specified but was not found.")
endif()
else(FREECAD_USE_EXTERNAL_KDL)
# here we use the internal supplied kdl
FILE( GLOB KDL_SRCS kdl_cp/[^.]*.cpp )
FILE( GLOB KDL_HPPS kdl_cp/[^.]*.hpp kdl_cp/[^.]*.inl)
FILE( GLOB UTIL_SRCS kdl_cp/utilities/[^.]*.cpp kdl_cp/utilities/[^.]*.cxx)
FILE( GLOB UTIL_HPPS kdl_cp/utilities/[^.]*.h kdl_cp/utilities/[^.]*.hpp)
SET(Robot_SRCS
${Robot_SRCS}
${KDL_SRCS}
${KDL_HPPS}
${UTIL_SRCS}
${UTIL_HPPS}
)
SOURCE_GROUP("KDL" FILES ${KDL_SRCS} ${KDL_HPPS} ${UTIL_SRCS} ${UTIL_HPPS} ) SOURCE_GROUP("KDL" FILES ${KDL_SRCS} ${KDL_HPPS} ${UTIL_SRCS} ${UTIL_HPPS} )
endif(FREECAD_USE_EXTERNAL_KDL)
SOURCE_GROUP("Python" FILES ${Python_SRCS}) SOURCE_GROUP("Python" FILES ${Python_SRCS})
SOURCE_GROUP("Module" FILES ${Mod_SRCS}) SOURCE_GROUP("Module" FILES ${Mod_SRCS})