#File Generated by Hans J. Johnson
#Please contact hans-johnson@uiowa.edu for making enhancments/corrections
PROJECT(NIFTIUTILS)

INCLUDE_DIRECTORIES(${NIFTILIB_SOURCE_DIR} ${ZNZLIB_SOURCE_DIR})

ADD_EXECUTABLE(${PACKAGE_PREFIX}nifti_stats nifti_stats.c)
ADD_EXECUTABLE(${PACKAGE_PREFIX}nifti_tool nifti_tool.c)
ADD_EXECUTABLE(${PACKAGE_PREFIX}nifti1_test nifti1_test.c)
TARGET_LINK_LIBRARIES( nifti_stats ${PACKAGE_PREFIX}niftiio)
TARGET_LINK_LIBRARIES( nifti_tool  ${PACKAGE_PREFIX}niftiio)
TARGET_LINK_LIBRARIES( nifti1_test ${PACKAGE_PREFIX}niftiio)

INSTALL_TARGETS(/bin ${PACKAGE_PREFIX}nifti_stats ${PACKAGE_PREFIX}nifti_tool ${PACKAGE_PREFIX}nifti1_test)
INSTALL_FILES(/include "(\\.h)$")


ADD_TEST(${PACKAGE_PREFIX}nifti1_test_help ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti1_test)
ADD_TEST(${PACKAGE_PREFIX}nifti1_test_n1 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti1_test  -n1  ${NIFTI_SOURCE_DIR}/Testing/Data/ATestReferenceImageForReadingAndWriting.nii.gz ${NIFTIUTILS_BINARY_DIR}/n1 )
ADD_TEST(${PACKAGE_PREFIX}nifti1_test_n2 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti1_test  -n2  ${NIFTI_SOURCE_DIR}/Testing/Data/ATestReferenceImageForReadingAndWriting.nii.gz ${NIFTIUTILS_BINARY_DIR}/n2 )
ADD_TEST(${PACKAGE_PREFIX}nifti1_test_a2 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti1_test  -a2  ${NIFTI_SOURCE_DIR}/Testing/Data/ATestReferenceImageForReadingAndWriting.nii.gz ${NIFTIUTILS_BINARY_DIR}/a2 )
ADD_TEST(${PACKAGE_PREFIX}nifti1_test_zn1 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti1_test -zn1 ${NIFTI_SOURCE_DIR}/Testing/Data/ATestReferenceImageForReadingAndWriting.nii.gz ${NIFTIUTILS_BINARY_DIR}/zn1 )
ADD_TEST(${PACKAGE_PREFIX}nifti1_test_zn2 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti1_test -zn2 ${NIFTI_SOURCE_DIR}/Testing/Data/ATestReferenceImageForReadingAndWriting.nii.gz ${NIFTIUTILS_BINARY_DIR}/zn2 )
ADD_TEST(${PACKAGE_PREFIX}nifti1_test_za2 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti1_test -za2 ${NIFTI_SOURCE_DIR}/Testing/Data/ATestReferenceImageForReadingAndWriting.nii.gz ${NIFTIUTILS_BINARY_DIR}/za2 )

#The help screens always return 1; ADD_TEST(${PACKAGE_PREFIX}nifti_tool_help ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti_tool)
ADD_TEST(${PACKAGE_PREFIX}nifti_tool_n1 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti_tool  -disp_hdr -infile ${NIFTIUTILS_BINARY_DIR}/n1 )
ADD_TEST(${PACKAGE_PREFIX}nifti_tool_n2 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti_tool  -disp_hdr -infile ${NIFTIUTILS_BINARY_DIR}/n2 )
ADD_TEST(${PACKAGE_PREFIX}nifti_tool_a2 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti_tool  -disp_hdr -infile ${NIFTIUTILS_BINARY_DIR}/a2 )
ADD_TEST(${PACKAGE_PREFIX}nifti_tool_zn1 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti_tool -disp_hdr -infile ${NIFTIUTILS_BINARY_DIR}/zn1 )
ADD_TEST(${PACKAGE_PREFIX}nifti_tool_zn2 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti_tool -disp_hdr -infile ${NIFTIUTILS_BINARY_DIR}/zn2 )
ADD_TEST(${PACKAGE_PREFIX}nifti_tool_za2 ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti_tool -disp_hdr -infile ${NIFTIUTILS_BINARY_DIR}/za2 )

ADD_TEST(${PACKAGE_PREFIX}nifti_tool_diff_hdr ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti_tool  -diff_hdr -infiles ${NIFTIUTILS_BINARY_DIR}/n1 ${NIFTIUTILS_BINARY_DIR}/n1 )

FOREACH(DISTRIBUTION CORREL TTEST FTEST ZSCORE CHISQ BETA BINOM GAMMA POISSON NORMAL FTEST_NONC CHISQ_NONC LOGISTIC LAPLACE UNIFORM TTEST_NONC WEIBULL CHI INVGAUSS EXTVAL PVAL LOGPVAL LOG10PVAL )
    ADD_TEST(${PACKAGE_PREFIX}nifti_stats_${DISTRIBUTION}_test ${NIFTIUTILS_BINARY_DIR}/${PACKAGE_PREFIX}nifti_stats 0:4:1 ${DISTRIBUTION})
ENDFOREACH(DISTRIBUTION)




