Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added clauses to find dependencies under MSVC. I will be making a zip…
… file with file with all deps for streamlining the dev environment setup process git-svn-id: http://svn.osgeo.org/qgis/trunk@7236 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
timlinux
committed
Oct 1, 2007
1 parent
c5b914a
commit b720ac5
Showing
8 changed files
with
180 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,54 +1,58 @@ | |||
# use bison for .yy files | # use bison for .yy files | ||
|
|
||
# search for bison | # search for bison | ||
MACRO(FIND_BISON) | MACRO(FIND_BISON) | ||
IF(NOT BISON_EXECUTABLE) | IF(NOT BISON_EXECUTABLE) | ||
FIND_PROGRAM(BISON_EXECUTABLE bison) | IF (MSVC) | ||
IF (NOT BISON_EXECUTABLE) | FIND_PROGRAM(BISON_EXECUTABLE "c:/dev/cpp/bison/bin/bison.exe") | ||
|
ELSE (MSVC) | ||
MESSAGE(FATAL_ERROR "Bison not found - aborting") | FIND_PROGRAM(BISON_EXECUTABLE bison) | ||
|
ENDIF (MSVC) | ||
ELSE (NOT BISON_EXECUTABLE) | IF (NOT BISON_EXECUTABLE) | ||
|
|
||
EXEC_PROGRAM(${BISON_EXECUTABLE} ARGS --version OUTPUT_VARIABLE BISON_VERSION_STR) | MESSAGE(FATAL_ERROR "Bison not found - aborting") | ||
# get first line in case it's multiline |
|
||
STRING(REGEX REPLACE "([^\n]+).*" "\\1" FIRST_LINE "${BISON_VERSION_STR}") | ELSE (NOT BISON_EXECUTABLE) | ||
# get version information |
|
||
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\1" BISON_VERSION_MAJOR "${FIRST_LINE}") | EXEC_PROGRAM(${BISON_EXECUTABLE} ARGS --version OUTPUT_VARIABLE BISON_VERSION_STR) | ||
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\2" BISON_VERSION_MINOR "${FIRST_LINE}") | # get first line in case it's multiline | ||
IF (BISON_VERSION_MAJOR LESS 2) | STRING(REGEX REPLACE "([^\n]+).*" "\\1" FIRST_LINE "${BISON_VERSION_STR}") | ||
MESSAGE (FATAL_ERROR "Bison version is too old (${BISON_VERSION_MAJOR}.${BISON_VERSION_MINOR}). Use 2.0 or higher.") | # get version information | ||
ENDIF (BISON_VERSION_MAJOR LESS 2) | STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\1" BISON_VERSION_MAJOR "${FIRST_LINE}") | ||
|
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\2" BISON_VERSION_MINOR "${FIRST_LINE}") | ||
ENDIF (NOT BISON_EXECUTABLE) | IF (BISON_VERSION_MAJOR LESS 2) | ||
ENDIF(NOT BISON_EXECUTABLE) | MESSAGE (FATAL_ERROR "Bison version is too old (${BISON_VERSION_MAJOR}.${BISON_VERSION_MINOR}). Use 2.0 or higher.") | ||
|
ENDIF (BISON_VERSION_MAJOR LESS 2) | ||
ENDMACRO(FIND_BISON) |
|
||
|
ENDIF (NOT BISON_EXECUTABLE) | ||
MACRO(ADD_BISON_FILES _sources ) | ENDIF(NOT BISON_EXECUTABLE) | ||
FIND_BISON() |
|
||
|
ENDMACRO(FIND_BISON) | ||
FOREACH (_current_FILE ${ARGN}) |
|
||
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE) | MACRO(ADD_BISON_FILES _sources ) | ||
GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE) | FIND_BISON() | ||
|
|
||
SET(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp) | FOREACH (_current_FILE ${ARGN}) | ||
|
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE) | ||
|
GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE) | ||
# bison options: |
|
||
# -t add debugging facilities | SET(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp) | ||
# -d produce additional header file (used in parser.l) |
|
||
# -v produce additional *.output file with parser states |
|
||
|
# bison options: | ||
ADD_CUSTOM_COMMAND( | # -t add debugging facilities | ||
OUTPUT ${_out} | # -d produce additional header file (used in parser.l) | ||
COMMAND ${BISON_EXECUTABLE} | # -v produce additional *.output file with parser states | ||
ARGS |
|
||
-o${_out} -d -v -t | ADD_CUSTOM_COMMAND( | ||
${_in} | OUTPUT ${_out} | ||
DEPENDS ${_in} | COMMAND ${BISON_EXECUTABLE} | ||
) | ARGS | ||
|
-o${_out} -d -v -t | ||
SET(${_sources} ${${_sources}} ${_out} ) | ${_in} | ||
ENDFOREACH (_current_FILE) | DEPENDS ${_in} | ||
ENDMACRO(ADD_BISON_FILES) | ) | ||
|
|||
SET(${_sources} ${${_sources}} ${_out} ) | |||
ENDFOREACH (_current_FILE) | |||
ENDMACRO(ADD_BISON_FILES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,36 +1,40 @@ | |||
# flex a .ll file | # flex a .ll file | ||
|
|
||
# search flex | # search flex | ||
MACRO(FIND_FLEX) | MACRO(FIND_FLEX) | ||
IF(NOT FLEX_EXECUTABLE) | IF(NOT FLEX_EXECUTABLE) | ||
FIND_PROGRAM(FLEX_EXECUTABLE flex) | IF (MSVC) | ||
IF (NOT FLEX_EXECUTABLE) | FIND_PROGRAM(FLEX_EXECUTABLE "C:/dev/cpp/flex/bin/flex.exe") | ||
MESSAGE(FATAL_ERROR "flex not found - aborting") | ELSE(MSVC) | ||
ENDIF (NOT FLEX_EXECUTABLE) | FIND_PROGRAM(FLEX_EXECUTABLE flex) | ||
ENDIF(NOT FLEX_EXECUTABLE) | ENDIF (MSVC) | ||
ENDMACRO(FIND_FLEX) | IF (NOT FLEX_EXECUTABLE) | ||
|
MESSAGE(FATAL_ERROR "flex not found - aborting") | ||
MACRO(ADD_FLEX_FILES _sources ) | ENDIF (NOT FLEX_EXECUTABLE) | ||
FIND_FLEX() | ENDIF(NOT FLEX_EXECUTABLE) | ||
|
ENDMACRO(FIND_FLEX) | ||
FOREACH (_current_FILE ${ARGN}) |
|
||
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE) | MACRO(ADD_FLEX_FILES _sources ) | ||
GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE) | FIND_FLEX() | ||
|
|
||
SET(_out ${CMAKE_CURRENT_BINARY_DIR}/flex_${_basename}.cpp) | FOREACH (_current_FILE ${ARGN}) | ||
|
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE) | ||
|
GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE) | ||
|
|||
SET(_out ${CMAKE_CURRENT_BINARY_DIR}/flex_${_basename}.cpp) | |||
|
|||
|
|||
# -d option for flex means that it will produce output to stderr while analyzing | # -d option for flex means that it will produce output to stderr while analyzing | ||
|
|
||
ADD_CUSTOM_COMMAND( | ADD_CUSTOM_COMMAND( | ||
OUTPUT ${_out} | OUTPUT ${_out} | ||
COMMAND ${FLEX_EXECUTABLE} | COMMAND ${FLEX_EXECUTABLE} | ||
ARGS | ARGS | ||
-o${_out} -d | -o${_out} -d | ||
${_in} | ${_in} | ||
DEPENDS ${_in} | DEPENDS ${_in} | ||
) | ) | ||
|
|
||
SET(${_sources} ${${_sources}} ${_out} ) | SET(${_sources} ${${_sources}} ${_out} ) | ||
ENDFOREACH (_current_FILE) | ENDFOREACH (_current_FILE) | ||
ENDMACRO(ADD_FLEX_FILES) | ENDMACRO(ADD_FLEX_FILES) |