![cmake target cmake target](https://devblogs.microsoft.com/cppblog/wp-content/uploads/sites/9/2019/11/cmake_tools.png)
CMAKE TARGET INSTALL
And then I’m at a loss as to how install (TARGETS) can be used at all. But then it seems I have to give different names to the command (which takes the output file name) and to the target.
![cmake target cmake target](https://user-images.githubusercontent.com/937305/44767336-6d2f5f80-ab98-11e8-89dd-3979cbd9e626.png)
Only these variables should be used in subdirectories, and the model given in KERNEL should be followed. Moreover, the correct way to use addcustomtarget () seems to be together with addcustomcommand () if we want proper dependency handling. (Try to) comment them.Īll /CMakeLists.txt (see KERNEL_SRC/CMakeLists.txt) contains the definition of the variables which specify the location of installation directories. INSTALL should be called at the end of the CMakelists.txtĬreate MACRO in *.cmake to factorize some repetitive lines. INCLUDE() directives, if needed, must come early in the fileĪDD_SUBDIRECTORY() directives, if needed, must be done just after INCLUDE and FIND_PACKAGE, then the specific part of subdirectory can be done No use of GLOBS for sources (*.cxx), but GLOBS can be used for includes and *.i on installationįIND_PACKAGE() is called only in root /CMakeLists.txt So there is no need to deal with SO_VERSION in *.so libraries (*.so.1.2.3 …)
![cmake target cmake target](https://philippegroarke.com/img/2019/cmake.png)
CMake provide standard commands for this (INCLUDE_DIRECTORIES, TARGET_LINK_LIBRARIES) and produces much more portable build files! If a directory includes two or more targets that compulsory need different set of include dir, split into several subdirectories, and put the different targets in them (MEDFile has plenty of this).Īt present there is no management in SALOME of API versioning. Never, I said NEVER, specify includes or libraries by overriding COMPILE_FLAGS. The version of the module is specified in one place: the root CMakeLists.txt file via standard variables