Skip to content

Commit

Permalink
Add ability to have external orocos-kdl library instead of the suplied
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mumme74 authored and wwmayer committed Jun 24, 2015
1 parent bc920f9 commit 16c740a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -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_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_KDL "Use system installed orocos-kdl instead of the bundled." OFF)
OPTION(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)

if(APPLE)
Expand Down
48 changes: 36 additions & 12 deletions src/Mod/Robot/App/CMakeLists.txt
Expand Up @@ -26,12 +26,6 @@ set(Robot_LIBS
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(TrajectoryPy)
generate_from_xml(WaypointPy)
Expand Down Expand Up @@ -79,16 +73,46 @@ SET(Robot_SRCS
Simulation.h
Waypoint.cpp
Waypoint.h
${KDL_SRCS}
${KDL_HPPS}
${UTIL_SRCS}
${UTIL_HPPS}
${Mod_SRCS}
${Python_SRCS}
)


SOURCE_GROUP("KDL" FILES ${KDL_SRCS} ${KDL_HPPS} ${UTIL_SRCS} ${UTIL_HPPS} )
# 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} )

endif(FREECAD_USE_EXTERNAL_KDL)

SOURCE_GROUP("Python" FILES ${Python_SRCS})
SOURCE_GROUP("Module" FILES ${Mod_SRCS})
Expand Down

0 comments on commit 16c740a

Please sign in to comment.