Skip to content

Commit

Permalink
rf: update method of version handling (freesurfer#758)
Browse files Browse the repository at this point in the history
* rf: update method of version handling

* added doc
  • Loading branch information
ahoopes authored Feb 17, 2020
1 parent 0b2eecb commit 0e08481
Show file tree
Hide file tree
Showing 384 changed files with 711 additions and 1,851 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ ld_map.txt
# generated help files
*.help.xml.h
.idea/**/*.xml
# generated cxx files

# generated source files
utils/version_info.h
qdec/QdecLibInit.cxx
qdec/vtkKWQdecAppTcl.cxx
qdec/vtkKWQdecViewTcl.cxx
Expand Down
2 changes: 1 addition & 1 deletion AntsDenoiseImageFs/AntsDenoiseImageFs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "AntsDenoiseImageFs.help.xml.h"


int main(int argc, char const *argv[])
int main(int argc, char **argv)
{
// parse args
ArgumentParser parser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "AntsN4BiasFieldCorrectionFs.help.xml.h"


int main(int argc, char const *argv[])
int main(int argc, char **argv)
{
// parse args
ArgumentParser parser;
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
endif()
endif()

# create build stamp during install
# version stamp
set(FS_VERSION "$ENV{USER}-local" CACHE STRING "Distribution version")

# build stamp
string(TIMESTAMP TODAY "%Y%m%d")
set(BUILD_STAMP "freesurfer-local-build-dev-${TODAY}" CACHE STRING "Distribution build stamp")
set(BUILD_STAMP "freesurfer-local-build-${TODAY}" CACHE STRING "Distribution build stamp")
install(CODE "file(WRITE ${CMAKE_INSTALL_PREFIX}/build-stamp.txt ${BUILD_STAMP}\\n)")

# set the default build type to 'Release' for optimization purposes
Expand Down Expand Up @@ -287,6 +290,7 @@ add_subdirectory(distribution)
# the top-level include dir contain the most commonly included freesurfer header files
set(FS_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/include
${CMAKE_SOURCE_DIR}/packages/minc
${CMAKE_SOURCE_DIR}/packages/netcdf
${CMAKE_SOURCE_DIR}/packages/nifti
Expand Down
6 changes: 1 addition & 5 deletions attic/check_siemens_dir/check_siemens_dir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ int main(int argc, char *argv[]) {
DIR *dp;
int nargs;

/* rkt: check for and handle version tag */
nargs = handle_version_option
(argc, argv,
"$Id: check_siemens_dir.c,v 1.10 2011/03/02 00:04:01 nicks Exp $",
"$Name: $");
nargs = handleVersionOption(argc, argv, "check_siemens_dir");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/dmri_tensoreig/dmri_tensoreig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ int main(int argc, char *argv[]) {
char outfile[1024];
const double minexp = exp(-10^35);

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, vcid, "$Name$");
nargs = handleVersionOption(argc, argv, "dmri_tensoreig");
if (nargs && argc - nargs == 1) exit (0);
argc -= nargs;
cmdline = argv2cmdline(argc,argv);
Expand Down
3 changes: 1 addition & 2 deletions attic/histo_fix_topology/histo_fix_topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ main(int argc, char *argv[]) {
MRI_SEGMENT *ms ;
MRI_SEGMENT_VOXEL *msv ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: histo_fix_topology.c,v 1.3 2011/03/02 00:04:09 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "histo_fix_topology");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/histo_segment/histo_segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ main(int argc, char *argv[]) {
double thresh, min_neuron_area ;


/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: histo_segment.c,v 1.2 2011/03/02 00:04:09 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "histo_segment");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/label_area/label_area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ main(int argc, char *argv[]) {
MRI_SURFACE *mris ;
float area ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: label_area.c,v 1.9 2012/04/25 13:37:44 fischl Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "label_area");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/label_border/label_border.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ main(int argc, char *argv[]) {
MRI_SURFACE *mris ;
LABEL *area ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: label_border.c,v 1.2 2011/03/02 00:04:11 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "label_border");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {

Progname = argv[0];

nargs = handle_version_option (argc, argv, "$Id: mri_apply_inu_correction.c,v 1.3 2011/03/02 00:04:13 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_apply_inu_correction");
argc -= nargs ;

ac = argc ;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_aseg_edit_reclassify/mri_aseg_edit_reclassify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ main(int argc, char *argv[]) {
VOXEL_LIST *vl_border ;
float *svm_inputs = NULL, svm_out ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_aseg_edit_reclassify.c,v 1.5 2011/03/02 00:04:13 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_aseg_edit_reclassify");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_aseg_edit_train/mri_aseg_edit_train.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ main(int argc, char *argv[]) {
}
#endif

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_aseg_edit_train.c,v 1.3 2011/03/02 00:04:13 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_aseg_edit_train");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
6 changes: 1 addition & 5 deletions attic/mri_auto_fill/mri_auto_fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ main(int argc, char *argv[])
GCAM *gcam;
int msec ;

/* rkt: check for and handle version tag */
nargs = handle_version_option
(argc, argv,
"$Id: mri_auto_fill.c,v 1.14 2011/03/02 00:04:13 nicks Exp $",
"$Name: $");
nargs = handleVersionOption(argc, argv, "mri_auto_fill");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_bc_sc_bias_correct/mri_bc_sc_bias_correct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ main(int argc, char *argv[]) {
HISTOGRAM *histo ;
MRI_SEGMENTATION *mriseg ;

/* rkt: check for and handle version tag */
Progname = argv[0] ;
nargs = handle_version_option (argc, argv, "$Id: mri_bc_sc_bias_correct.c,v 1.5 2011/03/02 00:04:13 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_bc_sc_bias_correct");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_build_priors/mri_build_priors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ main(int argc, char *argv[]) {
int fno, nfiles ;
MRI *mri_src, *mri_target, *mri_wm, *mri_priors = NULL ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_build_priors.c,v 1.8 2011/03/02 00:04:13 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_build_priors");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_classify/mri_classify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ main(int argc, char *argv[]) {
char *training_file_name, *output_file_name ;
int nargs, error, i ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_classify.c,v 1.2 2012/05/23 19:24:37 fischl Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_classify");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ main(int argc, char *argv[]) {
MRI *mri_aseg ;
float xa, ya, za ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_compute_structure_transforms.c,v 1.3 2011/03/02 00:04:14 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_compute_structure_transforms");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_convert_mdh/mri_convert_mdh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,7 @@ int main(int argc, char **argv) {
//DumpMDH_VB13(argv[1]);
return(0);

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_convert_mdh.c,v 1.27 2011/03/02 00:04:14 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_convert_mdh");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
2 changes: 1 addition & 1 deletion attic/mri_divide_segmentation/mri_divide_segmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ main(int argc, char *argv[]) {
MATRIX *m_obs, *m_obs_T, *m_cov, *m_eig ;

setRandomSeed(-1L) ;
nargs = handle_version_option (argc, argv, "$Id: mri_divide_segmentation.c,v 1.3 2014/05/28 20:27:57 fischl Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_divide_segmentation");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_elastic_energy/mri_elastic_energy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ main(int argc, char *argv[]) {
GCA_MORPH *gcam ;
MRI *mri_lame ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_elastic_energy.c,v 1.2 2011/10/16 17:00:35 fischl Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_elastic_energy");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ main(int argc, char *argv[]) {
int msec, minutes, seconds, nvolumes ;
Timer start ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_estimate_tissue_parms.c,v 1.10 2015/03/12 20:24:06 zkaufman Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_estimate_tissue_parms");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_extract_conditions/mri_extract_conditions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ main(int argc, char *argv[]) {
MRI *mri_in, *mri_out ;
FILE *fp ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_extract_conditions.c,v 1.5 2011/03/02 00:04:15 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_extract_conditions");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
2 changes: 1 addition & 1 deletion attic/mri_fcili/mri_fcili.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) {
int c,f, nrois, roi1, roi2, nframes;
double v,ss, v1,v2,den,num, LL, LR, RL, RR;

nargs = handle_version_option (argc, argv, vcid, "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_fcili");
if (nargs && argc - nargs == 1) exit (0);
argc -= nargs;
cmdline = argv2cmdline(argc,argv);
Expand Down
6 changes: 1 addition & 5 deletions attic/mri_gcab_train/mri_gcab_train.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ main(int argc, char *argv[]) {
parms.use_gradient = 0 ;
spacing = 8 ;

/* rkt: check for and handle version tag */
nargs = handle_version_option
(argc, argv,
"$Id: mri_gcab_train.c,v 1.4 2011/03/16 20:23:33 fischl Exp $",
"$Name: $");
nargs = handleVersionOption(argc, argv, "mri_gcab_train");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_gdfglm/mri_gdfglm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ int main(int argc, char **argv) {
char OutGDFile[2000];
int nargs;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_gdfglm.c,v 1.9 2011/05/05 15:28:03 greve Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_gdfglm");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
6 changes: 1 addition & 5 deletions attic/mri_histo_normalize/mri_histo_normalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ main(int argc, char *argv[]) {
HISTOGRAM *histos[MAX_SUBJECTS], *htemplate ;
double rms, rms_avg ;

/* rkt: check for and handle version tag */
nargs = handle_version_option
(argc, argv,
"$Id: mri_histo_normalize.c,v 1.3 2011/03/02 00:04:19 nicks Exp $",
"$Name: $");
nargs = handleVersionOption(argc, argv, "mri_histo_normalize");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
2 changes: 1 addition & 1 deletion attic/mri_ibmc/mri_ibmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ int main(int argc, char *argv[])
ibmc = (IBMC *) calloc(sizeof(IBMC),1);
ibmc->DoSmooth = 0;

nargs = handle_version_option (argc, argv, vcid, "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_ibmc");
if (nargs && argc - nargs == 1) exit (0);
argc -= nargs;
cmdline = argv2cmdline(argc,argv);
Expand Down
4 changes: 3 additions & 1 deletion attic/mri_interpolate/mri_interpolate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ main(int argc, char *argv[]) {
char *in_fname, *out_fname, **av ;
MRI *mri_in, *mri_ctrl, *mri_out;
int ac, nargs=0, x, y, z ;
char cmdline[CMD_LINE_LEN] ;
double val;

make_cmd_version_string
(argc, argv,
"$Id: mri_interpolate.c,v 1.5 2011/10/06 01:18:12 fischl Exp $",
"$Name: $",cmdline);
make_cmd_version_string
std::string cmdline = getAllInfo(argc, argv, "mri_interpolate");

setRandomSeed(-1L) ;
Progname = argv[0] ;

Expand Down
3 changes: 1 addition & 2 deletions attic/mri_label_accuracy/mri_label_accuracy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ main(int argc, char *argv[]) {
double accuracy ;
MRI_REGION box ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_label_accuracy.c,v 1.2 2011/03/02 00:04:22 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_label_accuracy");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_make_bem_surfaces/mri_make_bem_surfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ main(int argc,char *argv[])
/* struct stat buf; */
int nargs;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_make_bem_surfaces.c,v 1.13 2011/03/29 16:37:02 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_make_bem_surfaces");
if (nargs && argc - nargs == 1)
{
exit (0);
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_make_density_map/mri_make_density_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ main(int argc, char *argv[]) {
GCA_MORPH *gcam ;


/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_make_density_map.c,v 1.8 2011/03/02 00:04:22 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_make_density_map");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_make_register/mri_make_register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ int main(int argc, char *argv[]) {
int i;
int nargs;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_make_register.c,v 1.9 2011/03/02 00:04:22 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_make_register");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_make_template/mri_make_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ main(int argc, char *argv[]) {
/* LTA *lta;*/
MRI *mri_tmp=0 ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_make_template.c,v 1.26 2011/03/02 00:04:22 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_make_template");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_map_atrophy/mri_map_atrophy.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ main(int argc, char *argv[]) {
MRI *mri_time1, *mri_time2, *mri_tmp, *mri_atrophy ;
TRANSFORM *transform1, *transform2 ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_map_atrophy.c,v 1.4 2011/03/02 00:04:22 nicks Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_map_atrophy");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
3 changes: 1 addition & 2 deletions attic/mri_mosaic/mri_mosaic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ main(int argc, char *argv[]) {
Timer start ;
MRI *mri[MAX_INPUT_IMAGES], *mri_mosaic ;

/* rkt: check for and handle version tag */
nargs = handle_version_option (argc, argv, "$Id: mri_mosaic.c,v 1.1 2015/09/25 16:05:20 fischl Exp $", "$Name: $");
nargs = handleVersionOption(argc, argv, "mri_mosaic");
if (nargs && argc - nargs == 1)
exit (0);
argc -= nargs;
Expand Down
Loading

0 comments on commit 0e08481

Please sign in to comment.