libftdi Archives

Subject: Re: Patch for building examples on MacOS X Lion

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Jared Boone <jared@xxxxxxxxxxxxxxxx>
Date: Tue, 15 May 2012 12:08:54 +0200
Hi Jared,

On Saturday, 12. May 2012 23:09:40 Jared Boone wrote:
> I had trouble with CMake picking up my /opt/local/include directory
> before my libftdi/src directory. I was getting the MacPorts-installed
> libftdi-0.20 headers, not the headers from the build tree. This was only
> happening during building of examples/. This patch addressed my problem.
> 
>       - Jared
> 
> diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
> index
> 29646f527546efa4d7bd052386a6d204309e79ad..11e5aabf14856511e750936b07f858
> c9ac7b3386 100644 --- a/examples/CMakeLists.txt
> +++ b/examples/CMakeLists.txt
> @@ -8,9 +8,6 @@ if (EXAMPLES)
> 
>      message(STATUS "Building example programs.")
> 
> -    # Source includes
> -    include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src)
> -
>      # Targets
>      add_executable(simple simple.c)
>      add_executable(bitbang bitbang.c)
> @@ -49,6 +46,10 @@ if (EXAMPLES)
>              target_link_libraries(find_all_pp ftdipp)
>          endif(Boost_FOUND)
>      endif(FTDI_BUILD_CPP)
> +
> +    # Source includes
> +    include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src)
> +
>  else(EXAMPLES)
>      message(STATUS "Not building example programs.")
>  endif(EXAMPLES)

Thanks for the patch. It's a bit odd that the order of the
include_directories statement matters at all.

Which cmake version do you use?

Did you use libftdi 0.x-git or 1.x-git?

Best regards,
Thomas

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread