fix(build): Correct var retention bug in cmake

The PACK_EXTERNAL flag was not being removed from the
cache after configuring the Makefile. This was causing
the pack external flag to remain set for all subsequent
executions of cmake even if the flag was not given (and
the default of 0 expected).

Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Change-Id: I308e5bf64248d9107760ce0669be282437e5d06b
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff39103..c9ca0ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -193,8 +193,6 @@
 	set( need_ext 0 )
 endif()
 
-unset( SKIP_EXTERNALS  CACHE )	# prevent these from being applied next build unless specifically set on comd line
-unset( PACK_EXTERNALS  CACHE )
 
 
 # this gets us round a chicken/egg problem. include files don't exist until make is run
@@ -297,7 +295,7 @@
 # (sure would be nice if FILEs allowed for globbing; sadlyy it does not.)
 #
 if( PACK_EXTERNALS )
-	message( "including nano and nng libraries in the deb" )
+	message( "+++ including nano and nng libraries in the deb" )
 	install( FILES
 		${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnanomsg${nano_so_suffix}
 		${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libnanomsg${nano_so_suffix_m}
@@ -310,6 +308,9 @@
 	)
 endif()
 
+unset( SKIP_EXTERNALS  CACHE )	# prevent these from being applied next build unless specifically set on comd line
+unset( PACK_EXTERNALS  CACHE )
+
 IF( EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake" )
 	include( InstallRequiredSystemLibraries )