Michael Fischer wrote:
> Hello Dick,
>
> now I understand a little how to use CMake, I could define tht
> path with -D. Now I use a build.sh script which look like:
>
> =======================================================================
> #!/bin/sh
>
> cmake -DLIBFTDI_LIBRARIES=/opt/local/libftdi-0.15/lib -DLIBFTDI_INCLUDE_DIR=
> /opt/local/libftdi-0.15/include \
> -DLIBUSB_LIBRARIES=/opt/local/libusb-0.1.12/lib -DLIBUSB_INCLUDE_DIR=/opt/lo
> cal/libusb-0.1.12/include \
> -DBUILD_FT2232_LIBFTDI=1 ../src
> =======================================================================
>
> Here I set all the path which are needed, I think.
>
> And the answer is:
>
> =======================================================================
> -- Found LIBUSB: /opt/local/libusb-0.1.12/lib
> -- Found LIBFTDI: /opt/local/libftdi-0.15/lib
> -- Check if the system is big endian
> -- Searching 16 bit integer
> -- Looking for stddef.h
> -- Looking for stddef.h - found
> -- Check size of unsigned short
> -- Check size of unsigned short - done
> -- Using unsigned short
> -- Check if the system is big endian - little endian
> Current revision is 1454
> -- Configuring done
> WARNING: Target "openocd" requests linking to directory
> "/opt/local/libftdi-0.15/lib".  Targets may link only to libraries.  CMake
> is dropping the item.
> WARNING: Target "openocd" requests linking to directory
> "/opt/local/libusb-0.1.12/lib".  Targets may link only to libraries.  CMake
> is dropping the item.
> -- Generating done
> -- Build files have been written to:
> /Users/mfischer/Projekte/development/OpenOCD/trunk/release
> =======================================================================
>
> If I try to start make, the output look like:
>
> =======================================================================
> [ 14%] Building C object helper/CMakeFiles/helper.dir/time_support.c.o
> [ 15%] Building C object helper/CMakeFiles/helper.dir/options.c.o
> [ 16%] Building C object helper/CMakeFiles/helper.dir/jim.c.o
> [ 17%] Building C object helper/CMakeFiles/helper.dir/jim-eventloop.c.o
> Linking C static library libhelper.a
> [ 17%] Built target helper
> Scanning dependencies of target jtag
> [ 18%] Building C object jtag/CMakeFiles/jtag.dir/jtag.c.o
> [ 20%] Building C object jtag/CMakeFiles/jtag.dir/ft2232.c.o
> /Users/mfischer/Projekte/development/OpenOCD/trunk/src/jtag/ft2232.c:58:18:
> error: ftdi.h: No such file or directory
> /Users/mfischer/Projekte/development/OpenOCD/trunk/src/jtag/ft2232.c: In
> function ‘ft2232_init_libftdi’:
> /Users/mfischer/Projekte/development/OpenOCD/trunk/src/jtag/ft2232.c:1702:
> error: invalid use of undefined type ‘struct ftdi_context’
> /Users/mfischer/Projekte/development/OpenOCD/trunk/src/jtag/ft2232.c:1705:
> error: invalid use of undefined type ‘struct ftdi_context’
> /Users/mfischer/Projekte/development/OpenOCD/trunk/src/jtag/ft2232.c:1710:
> error: ‘INTERFACE_A’ undeclared (first use in this function)
> /Users/mfischer/Projekte/development/OpenOCD/trunk/src/jtag/ft2232.c:1710:
> error: (Each undeclared identifier is reported only once
> /Users/mfischer/Projekte/development/OpenOCD/trunk/src/jtag/ft2232.c:1710:
> error: for each function it appears in.)
> /Users/mfischer/Projekte/development/OpenOCD/trunk/src/jtag/ft2232.c:1712:
> error: invalid use of undefined type ‘struct ftdi_context’
> /Users/mfischer/Projekte/development/OpenOCD/trunk/src/jtag/ft2232.c: In
> function ‘ft2232_purge_libftdi’:
> /Users/mfischer/Projekte/development/OpenOCD/trunk/src/jtag/ft2232.c:1748:
> error: invalid use of undefined type ‘struct ftdi_context’
> make[2]: *** [jtag/CMakeFiles/jtag.dir/ft2232.c.o] Error 1
> make[1]: *** [jtag/CMakeFiles/jtag.dir/all] Error 2
> make: *** [all] Error 2
> =======================================================================
>
> Do you have any hints for me?
>
> Best regards,
>
> Michael
>   


Michael,

Do these changes work for you?


if(NEED_USB)
find_package(LibUSB)
set(CONDITIONAL_LIBS ${CONDITIONAL_LIBS} ${LIBUSB_LIBRARIES})
include_directories( ${LIBUSB_INCLUDE_DIR} )
endif(NEED_USB)


if(BUILD_FT2232_FTD2XX)
#message("BUILD_FT2232_LIBFTDI=\"${BUILD_FT2232_LIBFTDI}\"")
if(BUILD_FT2232_LIBFTDI)
message( FATAL_ERROR "BUILD_FT2232_FTD2XX and BUILD_FT2232_LIBFTDI are 
mutually exclusive, please enable only one")
endif(BUILD_FT2232_LIBFTDI)
find_package(LibFTD2XX)
set(CONDITIONAL_LIBS ${LIBFTD2XX_LIBRARIES} ${CONDITIONAL_LIBS})
include_directories( ${LIBFTD2XX_INCLUDE_DIR} )
endif(BUILD_FT2232_FTD2XX)


if(BUILD_FT2232_LIBFTDI)
if(BUILD_FT2232_FTD2XX)
message( FATAL_ERROR "BUILD_FT2232_FTD2XX and BUILD_FT2232_LIBFTDI are 
mutually exclusive, please enable only one")
endif(BUILD_FT2232_FTD2XX)
find_package(LibFTDI)
set(CONDITIONAL_LIBS ${LIBFTDI_LIBRARIES} ${CONDITIONAL_LIBS})
include_directories( ${LIBFTDI_INCLUDE_DIR} )
endif(BUILD_FT2232_LIBFTDI)



Notice the 3 include_directories() statements, which are new.

Please provide some feedback on this.


Dick





>
>
>
>
>   

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to