I am working on a project and I need one CmakeList.txt file, Config file, spec file. I searched a lot. tutorials are telling how to make these files and all. Please tell me from scratch what they are and what is the use of these files? Please provide links also where I can learn about these files. Any help would be appreciated. Thanks in advance.

Good question nitin1. I use cmake for appropriately constructed projects, but have never built a project for it. I will have to do some research and get back to you. In the meantime, perhaps another user here can provide some clarity on the subject.

The CMakeLists.txt file is where you create the build script for your project. Unless you are doing something fancy, this file should be the only thing you need for setting up a build with CMake. You can look for cmake tutorials for information on how to write that.

The "Config" files is too vague to really know what it means. A configuration file is a very general term. You need to figure out what that file is for. Just ask whoever told you to create a Config file to tell you what that file is for. One possibility is that it refers to a configure script for the "autoconf" build tool (in my opinion, just use CMake and forget about autoconf, it's an antiquated system that is very limited and very annoying to use).

For the "spec" file, I'm not exactly sure what that is. I have seen files with the .spec extension before in projects, and the contents of it seem to be related to RPM packaging (it contains package name / author / etc., description, build command and install command). You can see these instructions. I don't really have too much experience in packaging, so I can't really help you.

GCC is a driver program and performs its job by invoking a sequence of other programs for compiling, assembling and linking. GCC interprets its command-line parameters to deduce which programs it should invoke, and which command-line options it ought to place on their command lines. This behavior is controlled by spec strings. In most cases there is one spec string for each program that GCC can invoke, but a few programs have multiple spec strings to control their behavior. The spec strings built into GCC can be overridden by using the -specs= command-line switch to specify a spec file.

Spec files are plaintext files that are used to construct spec strings. They consist of a sequence of directives separated by blank lines. The type of directive is determined by the first non-whitespace character on the line.

For further information :
https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.