[IGSTK-Developers] Continuing the discussion on main library-sandbox cross building

Andinet Enquobahrie andinet.enqu at kitware.com
Tue Jan 17 13:24:58 EST 2006


As suggested by Stephen and David and as I agreed to later on,  we can 
do the following for a main library-sandbox cross building.

1) Make a skeleton copy of the whole main igstk library directory 
structure to the Sandbox
2) As needed, copy main igstk library file to the Sandbox and modify it 
( either for a bug fix or feature add-on)
3) Modify the cmake file in the sandbox, so that a source and header 
file list is created from modified main library files in the sandbox, 
non-modified main library files in the main repository and new files in 
the sandbox.

In implementing this cross-build system in my local machine. I run into 
a problem of setting the include directory path.  It would be easier to 
explain the problem with an example.

We have a new annotation class in the sandbox. To use this annotation 
class,  new methods are needed in the "igstkView" class. Therefore, I 
copied "igstkView" header and source files to the Sandbox and made 
changes.  Therefore, cmake will pick the versions of the "igstkView.h" 
and "igstkView.cxx" in the sandbox when generating the file list for 
building the Sandbox.  We have "igstkView2D" class which is derived from 
the "igstkView" class in the main repository. Therefore, we should be 
able to invoke methods to handle annotations which are defined in the 
base class ("igstkView") in "igstkView2D" class.. However, this fails 
for the following reason. In building, the "igstkView2D" object file, 
the compiler includes the "igstkView" class in the main library not in 
the Sandbox.  This is due to the fact the igstk header files are all 
included using double quotes  (""). When a header file is included in 
double quotes, the compiler first searches for this header file in the 
current directory before the -I include directory  path.  And we don't 
want this. We want the compiler to search first for header files in the 
Sandbox.

We (Luis and I)  thought of three solutions to work around this issue.

1) Change #includes "*" to #includes <*> in all the files and add 
sandbox before the main library to the Include directory list  (-I)
3) Copy all  files which have associations with the modified file to the 
Sandbox. For example,  all derived classes if the base class is changed.
3) Copy all main library files  (both modified and non-modified ) to the 
Sandbox and generate source and header file lists for building from  
files in the Sandbox only.

The first option "seems" to work. Although, other unforeseen issues 
might crop up when it is implemented. The second option seems to be 
laborious and error prone. The third option will definitely work. It is 
similar to how we are building the main library. The only issue is we 
will be generating duplicate copies of files (both modified and 
non-modified).

Contemplating on the third option, it made us think why we have separate 
repositories for development and stable versions in igstk  And, in 
devising ways of cross building between development and stable version, 
we are manually mimicking cvs capabilities. Standard technique of  
keeping the development version on the cvs trunk and stable versions of 
the library on the branches might be a better option. It is something to 
think about....

-Andinet









More information about the IGSTK-Developers mailing list