-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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/qgis@7236 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
timlinux
committed
Oct 1, 2007
1 parent
e94e9f6
commit 9ce8543
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,58 @@ | ||
# use bison for .yy files | ||
|
||
# search for bison | ||
MACRO(FIND_BISON) | ||
IF(NOT BISON_EXECUTABLE) | ||
FIND_PROGRAM(BISON_EXECUTABLE bison) | ||
IF (NOT BISON_EXECUTABLE) | ||
|
||
MESSAGE(FATAL_ERROR "Bison not found - aborting") | ||
|
||
ELSE (NOT BISON_EXECUTABLE) | ||
|
||
EXEC_PROGRAM(${BISON_EXECUTABLE} ARGS --version OUTPUT_VARIABLE BISON_VERSION_STR) | ||
# get first line in case it's multiline | ||
STRING(REGEX REPLACE "([^\n]+).*" "\\1" FIRST_LINE "${BISON_VERSION_STR}") | ||
# get version information | ||
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}") | ||
IF (BISON_VERSION_MAJOR LESS 2) | ||
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) | ||
|
||
ENDIF (NOT BISON_EXECUTABLE) | ||
ENDIF(NOT BISON_EXECUTABLE) | ||
|
||
ENDMACRO(FIND_BISON) | ||
|
||
MACRO(ADD_BISON_FILES _sources ) | ||
FIND_BISON() | ||
|
||
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}/${_basename}.cpp) | ||
|
||
|
||
# bison options: | ||
# -t add debugging facilities | ||
# -d produce additional header file (used in parser.l) | ||
# -v produce additional *.output file with parser states | ||
|
||
ADD_CUSTOM_COMMAND( | ||
OUTPUT ${_out} | ||
COMMAND ${BISON_EXECUTABLE} | ||
ARGS | ||
-o${_out} -d -v -t | ||
${_in} | ||
DEPENDS ${_in} | ||
) | ||
|
||
SET(${_sources} ${${_sources}} ${_out} ) | ||
ENDFOREACH (_current_FILE) | ||
ENDMACRO(ADD_BISON_FILES) | ||
# use bison for .yy files | ||
|
||
# search for bison | ||
MACRO(FIND_BISON) | ||
IF(NOT BISON_EXECUTABLE) | ||
IF (MSVC) | ||
FIND_PROGRAM(BISON_EXECUTABLE "c:/dev/cpp/bison/bin/bison.exe") | ||
ELSE (MSVC) | ||
FIND_PROGRAM(BISON_EXECUTABLE bison) | ||
ENDIF (MSVC) | ||
IF (NOT BISON_EXECUTABLE) | ||
|
||
MESSAGE(FATAL_ERROR "Bison not found - aborting") | ||
|
||
ELSE (NOT BISON_EXECUTABLE) | ||
|
||
EXEC_PROGRAM(${BISON_EXECUTABLE} ARGS --version OUTPUT_VARIABLE BISON_VERSION_STR) | ||
# get first line in case it's multiline | ||
STRING(REGEX REPLACE "([^\n]+).*" "\\1" FIRST_LINE "${BISON_VERSION_STR}") | ||
# get version information | ||
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}") | ||
IF (BISON_VERSION_MAJOR LESS 2) | ||
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) | ||
|
||
ENDIF (NOT BISON_EXECUTABLE) | ||
ENDIF(NOT BISON_EXECUTABLE) | ||
|
||
ENDMACRO(FIND_BISON) | ||
|
||
MACRO(ADD_BISON_FILES _sources ) | ||
FIND_BISON() | ||
|
||
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}/${_basename}.cpp) | ||
|
||
|
||
# bison options: | ||
# -t add debugging facilities | ||
# -d produce additional header file (used in parser.l) | ||
# -v produce additional *.output file with parser states | ||
|
||
ADD_CUSTOM_COMMAND( | ||
OUTPUT ${_out} | ||
COMMAND ${BISON_EXECUTABLE} | ||
ARGS | ||
-o${_out} -d -v -t | ||
${_in} | ||
DEPENDS ${_in} | ||
) | ||
|
||
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
# flex a .ll file | ||
|
||
# search flex | ||
MACRO(FIND_FLEX) | ||
IF(NOT FLEX_EXECUTABLE) | ||
FIND_PROGRAM(FLEX_EXECUTABLE flex) | ||
IF (NOT FLEX_EXECUTABLE) | ||
MESSAGE(FATAL_ERROR "flex not found - aborting") | ||
ENDIF (NOT FLEX_EXECUTABLE) | ||
ENDIF(NOT FLEX_EXECUTABLE) | ||
ENDMACRO(FIND_FLEX) | ||
|
||
MACRO(ADD_FLEX_FILES _sources ) | ||
FIND_FLEX() | ||
|
||
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) | ||
|
||
|
||
# flex a .ll file | ||
|
||
# search flex | ||
MACRO(FIND_FLEX) | ||
IF(NOT FLEX_EXECUTABLE) | ||
IF (MSVC) | ||
FIND_PROGRAM(FLEX_EXECUTABLE "C:/dev/cpp/flex/bin/flex.exe") | ||
ELSE(MSVC) | ||
FIND_PROGRAM(FLEX_EXECUTABLE flex) | ||
ENDIF (MSVC) | ||
IF (NOT FLEX_EXECUTABLE) | ||
MESSAGE(FATAL_ERROR "flex not found - aborting") | ||
ENDIF (NOT FLEX_EXECUTABLE) | ||
ENDIF(NOT FLEX_EXECUTABLE) | ||
ENDMACRO(FIND_FLEX) | ||
|
||
MACRO(ADD_FLEX_FILES _sources ) | ||
FIND_FLEX() | ||
|
||
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 | ||
|
||
ADD_CUSTOM_COMMAND( | ||
OUTPUT ${_out} | ||
COMMAND ${FLEX_EXECUTABLE} | ||
ARGS | ||
-o${_out} -d | ||
${_in} | ||
DEPENDS ${_in} | ||
) | ||
|
||
SET(${_sources} ${${_sources}} ${_out} ) | ||
ENDFOREACH (_current_FILE) | ||
ENDMACRO(ADD_FLEX_FILES) | ||
|
||
ADD_CUSTOM_COMMAND( | ||
OUTPUT ${_out} | ||
COMMAND ${FLEX_EXECUTABLE} | ||
ARGS | ||
-o${_out} -d | ||
${_in} | ||
DEPENDS ${_in} | ||
) | ||
|
||
SET(${_sources} ${${_sources}} ${_out} ) | ||
ENDFOREACH (_current_FILE) | ||
ENDMACRO(ADD_FLEX_FILES) |