Chris Hillery has proposed merging 
lp:~zorba-coders/zorba/bug-1034582-macports-flex into lp:zorba.

Requested reviews:
  Chris Hillery (ceejatec)
Related bugs:
  Bug #1034582 in Zorba: "flex header incompatibility"
  https://bugs.launchpad.net/zorba/+bug/1034582

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1034582-macports-flex/+merge/119458
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1034582-macports-flex/+merge/119458
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'cmake_modules/CMakeUseFlex.cmake'
--- cmake_modules/CMakeUseFlex.cmake	2012-08-10 02:16:18 +0000
+++ cmake_modules/CMakeUseFlex.cmake	2012-08-14 01:34:19 +0000
@@ -29,7 +29,6 @@
 
 IF(NOT FLEX_EXECUTABLE)
   MESSAGE(STATUS "Looking for flex")
-  FIND_PATH(FLEX_INCLUDE_DIR FlexLexer.h)
   FIND_PROGRAM(FLEX_EXECUTABLE flex)
   IF(FLEX_EXECUTABLE)
     EXEC_PROGRAM(
@@ -40,15 +39,22 @@
     # Extract major and minor versions
     STRING (REGEX REPLACE "[^0-9]*([0-9]+)..*" "\\1" FLEX_MAJOR_VERSION_TMP ${FLEX_VERSION})
     STRING (REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+).*" "\\1" FLEX_MINOR_VERSION_TMP ${FLEX_VERSION})
-	STRING (REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+[a-z]*).*" "\\1" FLEX_REVISION_VERSION_TMP ${FLEX_VERSION})	
+    STRING (REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+[a-z]*).*" "\\1" FLEX_REVISION_VERSION_TMP ${FLEX_VERSION})
     MESSAGE(STATUS "Found flex -- ${FLEX_EXECUTABLE}, version: " ${FLEX_MAJOR_VERSION_TMP} "." ${FLEX_MINOR_VERSION_TMP} "." ${FLEX_REVISION_VERSION_TMP})
     SET (FLEX_MAJOR_VERSION ${FLEX_MAJOR_VERSION_TMP} CACHE STRING "The flex major version" FORCE)
     SET (FLEX_MINOR_VERSION ${FLEX_MINOR_VERSION_TMP} CACHE STRING "The flex minor version" FORCE)
-	SET (FLEX_REVISION_VERSION ${FLEX_REVISION_VERSION_TMP} CACHE STRING "The flex revision version" FORCE)
+    SET (FLEX_REVISION_VERSION ${FLEX_REVISION_VERSION_TMP} CACHE STRING "The flex revision version" FORCE)
+
+    # Find the FlexLexer.h header. Try our best to find the one associated
+    # with the flex binary we're actually using.
+    GET_FILENAME_COMPONENT(_flex_path "${FLEX_EXECUTABLE}" PATH)
+    GET_FILENAME_COMPONENT(_flex_hint "${_flex_path}/../include" ABSOLUTE)
+    FIND_PATH(FLEX_INCLUDE_DIR FlexLexer.h HINTS "${_flex_hint}")
+
   ELSE (FLEX_EXECUTABLE)
     SET (FLEX_MAJOR_VERSION "0")
     SET (FLEX_MINOR_VERSION "0")
-	  SET (FLEX_REVISION_VERSION "0")
+    SET (FLEX_REVISION_VERSION "0")
   ENDIF(FLEX_EXECUTABLE)
   SET (FLEX_VERSION_FULL ${FLEX_MAJOR_VERSION}.${FLEX_MINOR_VERSION}.${FLEX_REVISION_VERSION} CACHE STRING "The Flex version" FORCE)
 ENDIF(NOT FLEX_EXECUTABLE)
@@ -74,7 +80,7 @@
       COMMAND "${CMAKE_COMMAND}"
       ARGS -E copy_if_different
          "${FLEX_INCLUDE_DIR}/FlexLexer.h"
-	 "${FLEXLEXERH}")
+         "${FLEXLEXERH}")
     SET(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}/${PATH}/${PREFIX}.cpp")
     ADD_CUSTOM_COMMAND(
       OUTPUT "${OUTFILE}"

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to