Patch for building examples on MacOS X Lion
authorJared Boone <jared@sharebrained.com>
Sat, 12 May 2012 21:09:40 +0000 (14:09 -0700)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 22 May 2012 13:42:23 +0000 (15:42 +0200)
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

examples/CMakeLists.txt

index 29646f5..11e5aab 100644 (file)
@@ -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)