Reputation: 25154
I got a Project, compiled under gcc and now i've created with cmake my vs2010 Solution. So far so good. I saw that in every Project in my Solution Explorer a "CmakeLists.txt" was existing, at first glance i thought, that it is rubbish and came with cmake when building solution files, but then i've recognized, that this was part of the build step in the project.
This is completely new for me, and i couldn't find any information about "custom build tool" related to cmake. So my questions are:
1) Instead of creating Property Pages now i should write things into that cmakelists.txt files, but what are the equivalents to "Add Addtiional Inlcude Files" or "Add Additional Lib Files"
1a) Or should i just go with property pages and somhow convert them to cmakelists.txt files, or isn't that possible?
2) Is this the way to to have "loosely coupled" projects?
3) Can you propose me a link where custom build tools are mentioned in relation with CmakeLists.txt. I thought that CmakeLists.txt was only part of creating project files but not part of the build. (Most of the Cases)
thank you for your time!
Upvotes: 0
Views: 1195
Reputation: 5390
CMake creates project files but the project files control the build. CMake is based around the unix model so there aren't direct equivalents to the include additional headers option. Instead you need to use include_directory on the directory containing the header. For additional libaries you need add_library with the imported option to create a target. Then you use link_target_libraries to link the library.
Upvotes: 2