I have built a project using cmake and some libraries.I want however to add some header and .cpp files in the project which I am going to code.What is the easiest way to do it?Can I just create a .cpp and header files and then build again project in Visual Studio? Or due to the fact that project was built using cmake I can't?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- How to show location of errors, references to memb
- Class layout in C++: Why are members sometimes ord
- Log4Net Multiple Projects
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
Although its a late Response and I just saw it. I am using CLion IDE from JetBrains, which adds these header and .cpp files automatically when you create them. Althogh it may not be your need, It may be a useful for other peoples who see it.
You can put all header/source files in the same folder and use something like
In this way, you can do either of the following two methods to add new added header/source into VS:
CMakeLists.txt
a little bit, e.g. simply add a space. And then build your solution in VS, it will automatically add new header/source files.you need to add every
.h
and.cpp
file to CMakeList.txt like this:then configure and build the solution again and reload it in VS.