hellhound_01 at January 15th, 2012 09:39 — #1
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
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.
cybernator at January 16th, 2012 11:39 — #2
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.
hellhound_01 at January 16th, 2012 15:50 — #3
You are right INCLUDE_DIRECTORIES and LINK_DIRECTORIES are the correct commands.
I've checked the wrong configuration tab of my project solution:
project properties--> Configurations --> VC++ Directories to check my includes
But it must be :
project properties --> Configurations --> C++ --> General ...