--- a/Testing/CMakeLists.txt
+++ b/Testing/CMakeLists.txt
@@ -3,5 +3,5 @@
 PROJECT(TESTING)
 
 SUBDIRS(niftilib)
-SUBDIRS(nifti_regress_test)
+#SUBDIRS(nifti_regress_test)
 
--- a/nifticdf/CMakeLists.txt
+++ b/nifticdf/CMakeLists.txt
@@ -6,8 +6,11 @@
 
 SET(NIFTI_CDFLIB_NAME ${PACKAGE_PREFIX}nifticdf)
 
-ADD_LIBRARY(${NIFTI_CDFLIB_NAME} ${NIFTICDFLIB_SRC} )
+# Debian: enable 'unused' function as the AFNI package needs them
+ADD_DEFINITIONS( -D__COMPILE_UNUSED_FUNCTIONS__ )
 
+ADD_LIBRARY(${NIFTI_CDFLIB_NAME} ${NIFTICDFLIB_SRC} )
+TARGET_LINK_LIBRARIES(${NIFTI_CDFLIB_NAME} m )
 IF (BUILD_SHARED_LIBS)
   SET_TARGET_PROPERTIES(${NIFTI_CDFLIB_NAME} PROPERTIES ${NIFTI_LIBRARY_PROPERTIES})
 ENDIF (BUILD_SHARED_LIBS)
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -7,7 +7,7 @@
 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 ${PACKAGE_PREFIX}nifticdf)
+TARGET_LINK_LIBRARIES( nifti_stats ${PACKAGE_PREFIX}nifticdf)
 TARGET_LINK_LIBRARIES( nifti_tool  ${PACKAGE_PREFIX}niftiio)
 TARGET_LINK_LIBRARIES( nifti1_test ${PACKAGE_PREFIX}niftiio)
 
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,13 @@
 #File Generated by Hans J. Johnson
 #Please contact hans-johnson@uiowa.edu for making enhancments/corrections
 PROJECT(NIFTI)
+
+# address warnings by cmake 2.6
+cmake_minimum_required(VERSION 2.4)
+if(COMMAND cmake_policy)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND cmake_policy)
+
 # Configure Dart testing support.
 INCLUDE(${CMAKE_ROOT}/Modules/Dart.cmake)
 
