llvm.org GIT mirror llvm / 1387d96
cmake/modules/FindBison.cmake: It must be unneeded any more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137715 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 8 years ago
1 changed file(s) with 0 addition(s) and 52 deletion(s). Raw diff Collapse all Expand all
+0
-52
cmake/modules/FindBison.cmake less more
None # - Try to find Bison
1 # Once done this will define
2 #
3 # BISON_FOUND - system has Bison
4 # BISON_EXECUTABLE - path of the bison executable
5 # BISON_VERSION - the version string, like "2.5.31"
6 #
7
8 MACRO(FIND_BISON)
9 FIND_PROGRAM(BISON_EXECUTABLE NAMES bison)
10
11 IF(BISON_EXECUTABLE)
12 SET(BISON_FOUND TRUE)
13
14 EXECUTE_PROCESS(COMMAND ${BISON_EXECUTABLE} --version
15 OUTPUT_VARIABLE _BISON_VERSION
16 )
17 string (REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" BISON_VERSION "${_bison_VERSION}")
18 ENDIF(BISON_EXECUTABLE)
19
20 IF(BISON_FOUND)
21 IF(NOT Bison_FIND_QUIETLY)
22 MESSAGE(STATUS "Found Bison: ${BISON_EXECUTABLE}")
23 ENDIF(NOT Bison_FIND_QUIETLY)
24 ELSE(BISON_FOUND)
25 IF(Bison_FIND_REQUIRED)
26 MESSAGE(FATAL_ERROR "Could not find Bison")
27 ENDIF(Bison_FIND_REQUIRED)
28 ENDIF(BISON_FOUND)
29 ENDMACRO(FIND_BISON)
30
31 MACRO(BISON_GENERATOR _PREFIX _Y_INPUT _H_OUTPUT _CPP_OUTPUT)
32 IF(BISON_EXECUTABLE)
33 GET_FILENAME_COMPONENT(_Y_DIR ${_Y_INPUT} PATH)
34 ADD_CUSTOM_COMMAND(
35 OUTPUT ${_CPP_OUTPUT}
36 OUTPUT ${_H_OUTPUT}
37 DEPENDS ${_Y_INPUT}
38 COMMAND ${BISON_EXECUTABLE}
39 ARGS
40 -p ${_PREFIX} -o"${_CPP_OUTPUT}"
41 --defines="${_H_OUTPUT}" ${_Y_INPUT}
42 WORKING_DIRECTORY ${_Y_DIR}
43 )
44 SET_SOURCE_FILES_PROPERTIES(
45 ${_CPP_OUTPUT} ${_H_OUTPUT}
46 GENERATED
47 )
48 ELSE(BISON_EXECUTABLE)
49 MESSAGE(SEND_ERROR "Can't find bison program, and it's required")
50 ENDIF(BISON_EXECUTABLE)
51 ENDMACRO(BISON_GENERATOR)