首页 > 其他分享 > CMake aux_source_directory包含目录下所有文件

CMake aux_source_directory包含目录下所有文件

时间:2023-05-11 13:22:04浏览次数:34  
标签:files CMake source file directory aux

 

 

aux_source_directory

Find all source files in a directory.

aux_source_directory(<dir> <variable>)

Collects the names of all the source files in the specified directory and stores the list in the <variable> provided. This command is intended to be used by projects that use explicit template instantiation. Template instantiation files can be stored in a Templates subdirectory and collected automatically using this command to avoid manually listing all instantiations.

It is tempting to use this command to avoid writing the list of source files for a library or executable target. While this seems to work, there is no way for CMake to generate a build system that knows when a new source file has been added. Normally the generated build system knows when it needs to rerun CMake because the CMakeLists.txt file is modified to add a new source. When the source is just added to the directory without modifying this file, one would have to manually rerun CMake to generate a build system incorporating the new file.

 

标签:files,CMake,source,file,directory,aux
From: https://www.cnblogs.com/sinferwu/p/17390761.html

相关文章

  • SpringBoot上传图片到resource下
    推荐博客:https://blog.csdn.net/weixin_52065369/article/details/120412307这样上传到resource下的图片需要重启编译后才能访问,需要配置以下才能访问的到,通常不采用这样的方式https://blog.csdn.net/qq_41604890/article/details/114553632上传图片到本机......
  • CMake报告:Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)错误
    原因是电脑缺少pkg-config库Linux可以直接apt-get即可:sudoapt-getinstallpkg-config下面详细说一下Windows如何手动安装:转到http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/下载文件pkg-config_0.26-1_win32.zip将文件bin/pkg-config.exe解压缩到your......
  • 解决Failed to configure a DataSource: ‘url‘ attribute is not specified and no
    <groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.13</version></dependency>开始没有制定版本报错换成了8.0版本,依旧报错 看了下配置文件没有问题查了下应该是版本冲突的问题<d......
  • CMake的生成器详解
    CMake会通过CMakelist.txt文件,生成适用于不同项目类型的makefile文件,然后makefile文件被不同的编译器使用进行编译,考虑到C/C++的开发环境之多,有非常多的种类的项目开发环境,但是CMake基本上都考虑到了,这里做一个小的汇总。CMake支持下列generator:VisualStudio6:生成VisualSt......
  • CMAKE-入门篇(一)
    路过的四海朋友大家好:言哥倾囊相授软件工程高频常用17条cmake金句如下:cmake_minimum_required(VERSION3.2)//cmake最低版本要求set(CMAKE_VERBOSE_MAKEFILEon)//启用Makefile构建过程中的详细输出。include(GNUInstallDirs) //使用GNUInstallDirs.cmake定义目标安......
  • CMake+Visual Studio构建Qt程序
    转载:https://www.codenong.com/cs106288798/转载:https://zhuanlan.zhihu.com/p/400804242一、编写代码文件main.cpp#include<QApplication>#include"Mainwindow.h"intmain(intargc,char*argv[]){QApplicationapp(argc,argv);MainWindowmain......
  • Install git from source code
    InstallGitfromSourceCodePrerequisiteCentOSyuminstallzlib-develyuminstallasciidocyuminstallxmltoDebianapt-getinstallzlib1g-devapt-getinstallasciidocapt-getinstallxmltoInstallYoucangetitviathekernel.orgsite,athttps://ww......
  • java.io.FileNotFoundException: class path resource [bean.xml] cannot be opened b
    出现这个报错Exceptioninthread"main"org.springframework.beans.factory.BeanDefinitionStoreException:IOExceptionparsingXMLdocumentfromclasspathresource[bean.xml];nestedexceptionisjava.io.FileNotFoundException:classpathresource[bean.......
  • 真的!@Autowired和@Resource注解使用的正确姿势,别再用错的了!
    介绍今天使用Idea写代码的时候,看到之前的项目中显示有warning的提示,去看了下,是如下代码?@AutowiredprivateJdbcTemplatejdbcTemplate;提示的警告信息FieldinjectionisnotrecommendedInspectioninfo:SpringTeamrecommends:"Alwaysuseconstructorbaseddependencyin......
  • cmake add to linker from CLI
    CMAKE_EXE_LINKER_FLAGSCMAKE_MODULE_LINKER_FLAGSCMAKE_SHARED_LINKER_FLAGSCMAKE_STATIC_LINKER_FLAGShttps://cmake.org/cmake/help/latest/command/target_link_options.htmlhttps://stackoverflow.com/questions/24532853/how-can-i-add-linker-flag-for-libraries......