Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6899523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:25:56+00:00 2026-05-27T07:25:56+00:00

I have a subdirectory structure in my project with two cmake files. One of

  • 0

I have a subdirectory structure in my project with two cmake files. One of them should be a compiler, using flex and bison, but cmake gives me an error I don’t quite understand:

cmake_minimum_required(VERSION 2.8)

project(leaf)

add_subdirectory(leafc)

and in the directory leafc:

find_package(BISON)
find_package(FLEX)

BISON_TARGET(LeafParser ${CMAKE_CURRENT_SOURCE_DIR}/parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
FLEX_TARGET(LeafScanner ${CMAKE_CURRENT_SOURCE_DIR}/lexer.l  ${CMAKE_CURRENT_BIANRY_DIR}/lexer.cpp)
ADD_FLEX_BISON_DEPENDENCY(LeafParser LeafScanner)

include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(leafc main.cpp ${BISON_LeafParser_OUTPUTS} ${FLEX_LeafScanner_OUTPUTS})

But I get this error when trying to cmake .

CMake Error at /usr/share/cmake-2.8/Modules/FindFLEX.cmake:132 (MESSAGE):
  Flex target `LeafParser' does not exists.
Call Stack (most recent call first):
  leafc/CMakeLists.txt:6 (ADD_FLEX_BISON_DEPENDENCY)

CMake Error at /usr/share/cmake-2.8/Modules/FindFLEX.cmake:136 (MESSAGE):
  Bison target `LeafScanner' does not exists.
Call Stack (most recent call first):
  leafc/CMakeLists.txt:6 (ADD_FLEX_BISON_DEPENDENCY)

CMake Error at /usr/share/cmake-2.8/Modules/FindFLEX.cmake:139 (SET_SOURCE_FILES_PROPERTIES):
  set_source_files_properties called with incorrect number of arguments.
Call Stack (most recent call first):
  leafc/CMakeLists.txt:6 (ADD_FLEX_BISON_DEPENDENCY)

-- Configuring incomplete, errors occurred!

The files are there:

├── CMakeLists.txt
├── leafc
│   ├── CMakeLists.txt
│   ├── lexer.l
│   ├── main.cpp
│   └── parser.y
└── README

So what did I do wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:25:57+00:00Added an answer on May 27, 2026 at 7:25 am

    It seems you just got the arguments to ADD_FLEX_BISON_DEPENDENCY mixed up. Try:

    ADD_FLEX_BISON_DEPENDENCY(LeafScanner LeafParser)
    

    Furthermore there is a typo in your FLEX_TARGET call (CMAKE_CURRENT_BIANRY_DIR).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 6,000 untracked files in one subdirectory and I'm constructing .gitignore files to
I have a very simple directory structure: Project Project/src Project/build Source files are in
I have a structure similar to the following: /root/ /root/data/ /root/data/script.php /root/data/some.json /root/data/feature/one.json /root/data/feature/two.json
Question 1: How should I structure my project so the sound and images files
I have two copies of the same directory structure (basically, trunk and a feature
I have a URL that is like the following: http://www.example.com/client/project/subdirectory/value/ I would like like
In a recent embedded project, we have used the following svn structure: project branches
I have a directory structure like so: directory1 - directory2 - <other files I
In my project I have the following structure: src/ plugins/ \__ mpc |__ oper
Currently, I have the following structure for my project Foo : foo-parent +- pom.xml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.