Hi,
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 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.
Knows anyone how I could perform those settings at the solution using CMake?
Thanks for any help.
Best regards,
Hellhound
How to add CMake includes and libraries to Visual Studio Solution ?
Started by hellhound_01, Jan 15 2012 02:39 PM
2 replies to this topic
#1
Posted 15 January 2012 - 02:39 PM
"There is only one god and his name is death. And there is only one thing we have to say to Death: Not today!" -- Syrio Forel (from Game of Thrones)
#2
Posted 16 January 2012 - 04:39 PM
You can add additional include directories using the include_directories command (as opposed to variable). As for library directories, I believe the right way to go is using find_library.The only trouble is that you may need to write additional search modules if the library you need to use is not supported. Another option is to add additional cached variables where you can set the paths to your libraries. Or, if you keep the libraries packaged with the source code, perhaps you could link the libraries using paths relative to CMAKE_SOURCE_DIR.
Hope this helps.
Hope this helps.
#3
Posted 16 January 2012 - 08:50 PM
You are right INCLUDE_DIRECTORIES and LINK_DIRECTORIES are the correct commands.
I've checked the wrong configuration tab of my project solution:
But it must be :
I've checked the wrong configuration tab of my project solution:
Quote
project properties--> Configurations --> VC++ Directories to check my includes
But it must be :
Quote
project properties --> Configurations --> C++ --> General ...
"There is only one god and his name is death. And there is only one thing we have to say to Death: Not today!" -- Syrio Forel (from Game of Thrones)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












