问题描述
我正在尝试构建一个我克隆的git项目,该项目使用CMake进行编译,并且需要bison和flex。 我正在使用Windows 10和Clion IDE。
我已经从https://sourceforge.net/projects/winflexbison/下载Win flex-bison 但是我不明白如何指向CMake来查看我下载的win_flex_bison文件。
当前构建失败的行:
find_program(BISON_EXECUTABLE bison)
if(NOT EXISTS ${BISON_EXECUTABLE})
message("Could not find bison executable.")
endif(NOT EXISTS ${BISON_EXECUTABLE})
find_program(FLEX_EXECUTABLE flex)
if(NOT EXISTS ${FLEX_EXECUTABLE})
message("Could not find flex executable.")
endif(NOT EXISTS ${FLEX_EXECUTABLE})
IF (DEFINED FLEXLEXER_H_DIR)
include_directories(${FLEXLEXER_H_DIR})
message("Looking in ${CMAKE_required_INCLUDES} for FlexLexer.h")
ELSE()
CHECK_INCLUDE_FILE_CXX("FlexLexer.h" HAVE_FLEXLEXER_H)
IF(NOT HAVE_FLEXLEXER_H)
UNSET(HAVE_FLEXLER_H CACHE)
message( FATAL_ERROR "Cannot find FlexLexer.h. Set FLEXLEXER_H_DIR to point to where it is to be found.." )
ENDIF()
我得到的按摩是:
Could not find bison executable.
Could not find flex executable.
-- Looking for C++ include FlexLexer.h
-- Looking for C++ include FlexLexer.h - not found
CMake Error at VALfiles/parsing/CMakeLists.txt:28 (message):
Cannot find FlexLexer.h. Set FLEXLEXER_H_DIR to point to where it is to be
found..
-- Configuring incomplete,errors occurred!