jeudi 26 mars 2015

How do I pack a file together with the binary of a C++ application?

I have a C++ application that takes configuration options from an XML file, and uses an XSD file to validate the information provided.


At the moment, I define the location of the XSD file in the makefile like this:



DEFINES := XSD_FILE_LOCATION=\"$(HOST_DIR)/share/$(strip $(COMPONENT_DIR))/xml\"


So from the source code I use 'XSD_FILE_LOCATION' to find the path to the XSD file.


I would like to package the XSD file together with the application's binary, so that the binary can be passed around and it already contains the XSD information, rather than demanding building it on every PC it's going to be used.


EDIT: I am thinking about embedding the XSD file as a string in the source code, but the solution does not convince me, I like the idea of having it as a separate file.


Aucun commentaire:

Enregistrer un commentaire