Software risk analysis usually requires a definitive list of the source files used to build a given project. Teams following a more formal methodology usually prefer to specify every source file to avoid accidentally including unwanted sources and to maintain accurate list modules dependencies. Teams following agile development models based on Evolutionary Prototyping where the source file structure can change regularly may prefer to use wildcard patterns to specify multiple source files to simplify project administration. cmake -build build -no-print-directory Source File Wildcards You can suppress this directory tracking using the –no-print-directory option on the build command line. When using subdirectories to organise source code the generated build commands print out each directory name as it is being processed. Target_include_directories(Application PRIVATE For example: target_include_directories(Application PRIVATEĭirectory locations are relative to the project root but we can use the CMAKE_SOURCE_DIR variable to reinforce this: add_executable(Application We don’t specify the header files as part of the source dependencies.Īlthough we never list the header files as part of the configuration (as discussed in previous blogs), we need to specify the directories to search for header files by adding entries to the target_include_directories() directive. Remember that CMake will scan the source files looking for dependencies to build a dependency tree for the source files and included header files. We just add these source files to the add_executable() definition: add_executable(Application
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |