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

  • SEARCH
  • Home
  • 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 7925565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:20:45+00:00 2026-06-03T18:20:45+00:00

I found a great answer on how to get find the executable files in

  • 0

I found a great answer on how to get find the executable files in Qt with CMake, cmake not finding Qt4

How do you use CMAKE_INCLUDE_PATH? I tried it out, but I got an error:

    cmake_minimum_required(VERSION 2.8)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../cmake_modules)

project(vrvu)

find_package(OpenGL REQUIRED)(CMAKE_INCLUDE_PATH <--- this is where I'm getting an error
 C:\QtSDK\Desktop\Qt\4.8.0\msvc2010\bin)find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL REQUIRED)
include(${QT_USE_FILE})
find_package(Coin3 REQUIRED)
find_package(Quarter REQUIRED)

add_subdirectory(bullet-2.77)
add_subdirectory(starlight)

file(GLOB SOURCES "*.cpp" "*.cxx" "*.h" "*.hpp")

include_directories(${OPENGL_INCLUDE_DIR} ${QT_INCLUDE_DIR} ${COIN_INCLUDE_DIR} ${QUARTER_INCLUDE_DIR} "./bullet-2.77/src" "./starlight")
link_directories(${QT_LIB_DIR} ${COIN_LINK_DIRECTORIES} ${QUARTER_LINK_DIRECTORIES})

add_definitions(${QT_DEFINITIONS} ${COIN_DEFINITIONS} ${QUARTER_DEFINITIONS})

add_executable(vrvu ${SOURCES})
target_link_libraries(vrvu ${OPENGL_LIBRARIES} ${QT_LIBRARIES} ${COIN_LIBRARIES} ${QUARTER_LIBRARIES} LinearMath BulletCollision starlight)

Sorry for the long code….thanks!

  • 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-06-03T18:20:48+00:00Added an answer on June 3, 2026 at 6:20 pm

    There are a couple of issues here.

    I’m not sure if it’s just a typo but you can’t just append the instruction to set CMAKE_INCLUDE_PATH to the end of the find_package command, you need a separate set command:

    find_package(OpenGL REQUIRED)
    set(CMAKE_INCLUDE_PATH "C:\\QtSDK\\Desktop\\Qt\\4.8.0\\msvc2010\\bin")
    find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL REQUIRED)
    

    Note that the path specified needs the separators to be escaped if you’re using backslashes. Alternatively, you can use a single forward slash in place of the double backslash, even on Windows. Putting the path in quotes has no effect in this case, but it’s a good habit to get into in case the path contains spaces.

    Setting CMAKE_INCLUDE_PATH extends the list of paths CMake tries when doing find_path and find_file calls only. This will be useful to the find_package call, but even more so in this case might be to set CMAKE_PREFIX_PATH which extends the seach paths for all find_XXX commands. It does mean you’d need to strip “\bin” from the path, since it’s appended to the CMAKE_PREFIX_PATH when searching for executables:

    set(CMAKE_PREFIX_PATH "C:\\QtSDK\\Desktop\\Qt\\4.8.0\\msvc2010")
    

    Next, file(GLOB SOURCES "*.cpp" "*.cxx" "*.h" "*.hpp"). While this isn’t actually an error, generally it’s frowned upon to use this technique to create a list of source files since if a file is added or deleted to the source tree, CMake will have no “knowledge” and won’t re-run. The recommended method is to add each source file by hand to the CMakeLists.txt, so that an addition or deletion will automatically cause CMake to re-run.

    Also, “SOURCES” is a poor choice of variable name since it also represents a property of CMake targets.

    Another frowned-upon practice is the use of link_directories. The documentation indicates why it’s not usually needed, which should be the case here.

    The add_definitions line too may be unnecessary. Qt does define definitions, but they have already been added when you did include(${QT_USE_FILE}) (see the documentation for FindQt4), so you’re adding them twice here. I’m not familiar with Coin3 or Quarter, but they may not actually generate any required preprocessor definitions. You could check their contents by adding:

    message("COIN_DEFINITIONS: ${COIN_DEFINITIONS}")
    message("QUARTER_DEFINITIONS: ${QUARTER_DEFINITIONS}")
    

    temporarily (after the corresponding find_package calls). If these are empty, you can delete the add_definitions call.

    Assuming the variables ${COIN_LIBRARIES} and ${QUARTER_LIBRARIES} specify the full paths to these libs, then I think you should be good to go.

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

Sidebar

Related Questions

I found a great answer on SO describing how to set up custom user
To this day, I have not found a great article about expressions - and
i am trying to get a situation where i can use i18n property files
I found the answer to this question in here . that solution works great
I found great examples of what Im looking for here : http://hugoduncan.org/post/2010/shell_scripting_in_clojure_with_pallet.xhtml But seems
I found great tool for Image slide show as in the link below http://thiagosf.net/projects/jquery/skitter/
I have problem with text drawing around Circle. I found great sample in C#
I found a great C++/ODBC example here ... The project I downloaded builds great
I found this great Tablesorter plugin for jQuery but I can't make it work
I found a great explanation about the new RTTI in Delphi ,but I don't

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.