NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: reading config files from C




On 30/01/2020 5:19 am, George Georgalis wrote:
Hi, I would like to introduce configuration files to a software
project I am supporting with build infrastructure. The C programs
depend on quite a few libraries from different sources. As a result of
development evolution, we have hardcoded paths in the source which
would be better served as parameters read from configuration files, so
the location of dependencies can be adjusted without modifying the
code. We need this functionality for runtime as well as compile time.

(Disclaimer, I use cmake, so ignorance is bliss with make/gmake)

Can you not just change all the hardcoded paths to defines and then pass those defines to the programs via make?

I would do that with cmake, depending on environment.

Am I over-simplifying the issue?

Cheers

Mark.




Home | Main Index | Thread Index | Old Index