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 7064587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:51:09+00:00 2026-05-28T04:51:09+00:00

I use CMake to generate a Visual Studio 2010 project and solution file. Actually

  • 0

I use CMake to generate a Visual Studio 2010 project and solution file. Actually I could set different settings,
like warning level, incremental building flag ect. from CMake. But I can’t set additional includes and libraries,
listed in the VC++ Directory configuration tab. Actually I’ve to set up those directories manually. This is stupid
and boring…

I tried to set the following CMake variables: CMAKE_INCLUDE_PATH, INCLUDE_DIRECTORY
but nothing happend. If i open the project, the additional include directory of the solution is always empty (only standard MSVE settings are given).

I also tired to set this variables after executable creation, but this has also no effect.

This is what i do directly in the header of the cmake
file:

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(${MODULE_NAME})
IF (MSVC)
   # Activate C++ exception handling
   IF (NOT CMAKE_CXX_FLAGS MATCHES "/EHsc")
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") 
   ENDIF ()

   # Set Warning level always to 4
   IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
     string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
   ELSE ()
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
   ENDIF ()

   #read path of dependency modules  
   file(READ "msvc.deps" MSVC_PROPERTIES)
   STRING(REGEX REPLACE ";" "\\\\;" MSVC_PROPERTIES "${MSVC_PROPERTIES}")
   STRING(REGEX REPLACE "\n" ";" MSVC_PROPERTIES "${MSVC_PROPERTIES}")

   FOREACH(e ${MSVC_PROPERTIES})
     SET(INCLUDE ${INCLUDE} ${e})
     MESSAGE(STATUS "[INFO]: Value ${e}")
   ENDFOREACH(e)
   INCLUDE_DIRECTORIES(${INCLUDE})
ENDIF ()

In the .deps file I’ve added to path of my dependeny modules,
line separated:

c:\binrev\development\boost\1.47\includes
c:\binrev\repository\modules\brCore\trunk\includes

Both are read successfully but couldn’t be set as additional
include directory in my MSVC solution.

Best regards,
Hellhound

  • 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-28T04:51:10+00:00Added an answer on May 28, 2026 at 4:51 am

    CMake is pretty well documented, if I have understood your question then the commands I think you’re looking for are

    • include_directories(…),
    • link_directories(…) and
    • target_link_libraries(…).

    Although some configuration is done by setting variables, most of it is done using commands to add certain information to parts of the build and slightly less frequently by setting properties on targets.

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

Sidebar

Related Questions

I'm setting up my visual studio project to use CMake, but I got two
I'm trying to use CMake to build generate the make file for a project
I'm using CMake to generate a project file for Xcode 4.2 on OSX Lion,
I use a cmake generated makefile to compile a c++ file that depends on
Question: Can CMake generate build scripts that do not, in any way, use CMake?
I'm trying to use add_custom_command to generate a file during the build. The command
I use CMake with GNU Make and would like to see all commands exactly
I'm trying to use CMake to generate an Xcode configuration for the iPhone by
GCC 4.6.0 Linux cmake 2.8 I am using cmake to generate my make file.
I'm using cmake with C++ project. I want to use precompiled headers in GCC.

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.