How to use tclap in cmake project

I'm new to tclap and cmake

  • Why is tclap necessary to configure before installation? Am I though it just consisted of header files?

  • How to include tclap library in cmake project. Can't I just copy the header files to the lib directory or something (and, if necessary, change CMakeLists)?

I scratch my head in all of this. By the way, I found this library , which includes tclap, and it seems that the authors are using cmake. Can I just copy the corresponding cmake files and modify them a bit? Do I think that cmake initiates the tclaps configuration process in this case?

Help me please.

+4
source share
1 answer
  • It does not need to be configured. This is just a header, and therefore nothing needs to be tweaked or compiled. The configuration is actually just for creating some test programs that use tclap, which is not necessary for using tclap itself. In addition, there is no need to follow the setup in the cmake example that you found. It does not initiate the tclap configuration process, and it does too much.

  • Yes, the idea of ​​copying header files and including them is the easiest way. I suggest downloading and unpacking the latest tclap tarball (the latest version is tclap-1.2.1 at the time of this writing) in the root of your project. If you do, add the following to your root CMakeLists.txt before your build goals:

    include_directories( BEFORE tclap-1.2.1/include )
    ...
    #add_executable( program_using_tclap ... )
    

tclap cpp, cmake .

+1

All Articles