File: FindKDL.cmake

package info (click to toggle)
freecad 1.0.0%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 463,492 kB
  • sloc: cpp: 930,635; python: 586,652; xml: 103,037; ansic: 9,568; fortran: 3,878; lex: 699; sh: 645; javascript: 311; yacc: 271; makefile: 120
file content (58 lines) | stat: -rw-r--r-- 2,474 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Locate KDL install directory

# This module defines
# KDL_INSTALL where to find include, lib, bin, etc.
# KDL_FOUND, is set to true

#INCLUDE (${PROJECT_SOURCE_DIR}/config/FindPkgConfig.cmake)

IF ( CMAKE_PKGCONFIG_EXECUTABLE )

    MESSAGE( STATUS "Detecting KDL" )
    
    SET(ENV{PKG_CONFIG_PATH} "${KDL_INSTALL}/lib/pkgconfig/")
    MESSAGE( "Looking for KDL in: ${KDL_INSTALL}")
    PKGCONFIG( "orocos-kdl >= 0.99" KDL_FOUND KDL_INCLUDE_DIRS KDL_DEFINES KDL_LINK_DIRS KDL_LIBS )

    IF( KDL_FOUND )
        MESSAGE("   Includes in: ${KDL_INCLUDE_DIRS}")
        MESSAGE("   Libraries in: ${KDL_LINK_DIRS}")
        MESSAGE("   Libraries: ${KDL_LIBS}")
        MESSAGE("   Defines: ${KDL_DEFINES}")

	INCLUDE_DIRECTORIES( ${KDL_INCLUDE_DIRS} )
	LINK_DIRECTORIES( ${KDL_LINK_DIRS})
	#OROCOS_PKGCONFIG_INCPATH("${KDLTK_INCLUDE_DIRS}")
	#OROCOS_PKGCONFIG_LIBS("${KDL_LIBS}")
	#OROCOS_PKGCONFIG_LIBPATH("${KDL_LINK_DIRS}")

	SET(ENV{PKG_CONFIG_PATH} "${KDL_INSTALL}/lib/pkgconfig/:${OROCOS_INSTALL}/lib/pkgconfig")
	MESSAGE( "Looking for KDL Toolkit in: ${PKG_CONFIG_PATH}")
	PKGCONFIG( "orocos-kdltk-${OROCOS_TARGET} >= 0.99" KDLTK_FOUND KDLTK_INCLUDE_DIRS KDLTK_DEFINES KDLTK_LINK_DIRS KDLTK_LIBS )
	IF(KDLTK_FOUND)
	  INCLUDE_DIRECTORIES( ${KDLTK_INCLUDE_DIRS} )
	  LINK_DIRECTORIES( ${KDLTK_LINK_DIRS})
	  OROCOS_PKGCONFIG_INCPATH("${KDLTK_INCLUDE_DIRS}")
	  OROCOS_PKGCONFIG_LIBPATH("${KDLTK_LINK_DIRS}")
	  OROCOS_PKGCONFIG_LIBS("${KDLTK_LIBS}")
	  IF(CORBA_ENABLED)
	    SET(ENV{PKG_CONFIG_PATH} "${KDL_INSTALL}/lib/pkgconfig/:${OROCOS_INSTALL}/lib/pkgconfig")
	    MESSAGE("Looking for KDL Toolkit CORBA extension in ${PKG_CONFIG_PATH}")
	    PKGCONFIG( "orocos-kdltk-corba-${OROCOS_TARGET} >= 0.99" KDLTKCORBA_FOUND KDLTKCORBA_INCLUDE_DIRS KDLTKCORBA_DEFINES KDLTKCORBA_LINK_DIRS KDLTKCORBA_LIBS )
	    IF(KDLTKCORBA_FOUND)
	      INCLUDE_DIRECTORIES( ${KDLTKCORBA_INCLUDE_DIRS} )
	      LINK_DIRECTORIES( ${KDLTKCORBA_LINK_DIRS})
	      OROCOS_PKGCONFIG_INCPATH("${KDLTKCORBA_INCLUDE_DIRS}")
	      OROCOS_PKGCONFIG_LIBPATH("${KDLTKCORBA_LINK_DIRS}")
	      OROCOS_PKGCONFIG_LIBS("${KDLTKCORBA_LIBS}")
	    ENDIF ( KDLTKCORBA_FOUND )
	  ENDIF(CORBA_ENABLED)
	ENDIF ( KDLTK_FOUND )
      ENDIF ( KDL_FOUND )

ELSE  ( CMAKE_PKGCONFIG_EXECUTABLE )

    # Can't find pkg-config -- have to search manually
    MESSAGE( FATAL_ERROR "Can't find KDL without pkgconfig !")

ENDIF ( CMAKE_PKGCONFIG_EXECUTABLE )