Now when we create our solution (again assuming you're using Visual Studio), you'll have a build target called DOCUMENTATION that you can build to regenerate your project's documentation.
#Cmake target install
When CMake searches for a package, it will look in the current install prefix and several standard places. To do this you can do the following in your CMakeLists.txt (for the sake of simplicity we'll contiue our Qt5 project example): cmake_minimum_required(VERSION 3.0)įind_package(Qt5 COMPONENTS Core Gui Widgets)Īdd_executable(MyQtProj $ Thats it Now once you install a package, there will be files in lib/cmake/MyLib that CMake will search for (specifically, MyLibConfig.cmake and MyLibConfigVersion.cmake), and the targets file that config uses should be there as well. It supports directory hierarchies and applications that depend on. 3 CMake is not a build system itself it generates another systems build files. Therefore, when trying to have a separate CMakeLists.txt in each of my library's sub-directories, I just use the 'old' method of adding each source file's path (relative to the top-level CMakeLists.txt) to a variable (list) and then use. Something that may be of particular use is to run Doxygen to generate documentation for your project. In software development, CMake is cross-platform free and open-source software for build automation, testing, packaging and installation of software by using a compiler -independent method. My verdict after all of this is: targetsources () has absolutely no effect when using install (TARGETS). There are some cases where CMake may ask the linker to search for the.
![cmake target cmake target](https://docs.microsoft.com/en-us/visualstudio/releasenotes/media/cmake.png)
![cmake target cmake target](https://devblogs.microsoft.com/cppblog/wp-content/uploads/sites/9/2020/02/CMake-Lang-Services-Peek-Small.png)
![cmake target cmake target](https://developer.nvidia.com/blog/parallelforall/wp-content/uploads/2017/08/image2.png)
You can also create a custom target to run when you want to perform a particular task.