# -*- mode: cmake; conding: utf-8; cmake-tab-width: 4; indent-tabs-mode: nil; -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
#------------------------------------------------------------------------
#
# NOTES:
#   OSX: invoke with environment variable CMAKE_OSX_ARCHITECTURES set
#        to the single architecture desired
#        (ex: i386 XOR x86_64)
#   WIN32:
#        cmake should be invoked with
#           "-DWITH_GSSAPI=\Program Files\MIT\Kerberos"
#
# DEFINES:
#   CMAKE_INSTALL_PREFIX  - Installation prefix
#   MATLAB_NO_NODISPLAY   - Run the matlab tests w/o using the -nodisplay option
#   PROG_MATLAB           - Full path to MATLAB executable
#   REPLAY_BLOB_CACHE_DIR - Directory containing replay blobs for testing
#------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8.6)
project(nds2-client C CXX)

set( NDS_CONFIG_PATH "${PROJECT_SOURCE_DIR}/config/cmake")
if( ${CMAKE_VERSION} VERSION_LESS 3.0 )
    set( CMAKE_MODULE_PATH "${NDS_CONFIG_PATH}/ModulesPre3_0/;${CMAKE_MODULE_PATH}" )
endif( ${CMAKE_VERSION} VERSION_LESS 3.0 )

set( CMAKE_MODULE_PATH "${NDS_CONFIG_PATH}/Modules;${CMAKE_MODULE_PATH}" )
set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )

set( PROJECT_DEBIAN_RULES_INPUT_FILENAME
    "${NDS_CONFIG_PATH}/debian.rules.in" )

include(UseNDS)
include(CheckIncludeFileCXX)

cond_set_policy( CMP0003 NEW )
cond_set_policy( CMP0026 NEW )
cond_set_policy( CMP0040 NEW )
cond_set_policy( CMP0042 NEW )
cond_set_policy( CMP0053 NEW )
cond_set_policy( CMP0054 NEW )

include(CheckCXXCompilerFlag)
include(FindSharedPtr)
include(InstallRequiredSystemLibraries)
include(GNUInstallDirs)
include(GNUPkgInstallDirs)
include(Coverage)
include(ax_macros)

macro(is_enabled _VARNAME)
  # ---------------------------------------------------------------------
  #  
  # ---------------------------------------------------------------------
  if( ${_VARNAME} )
    set(IS_ENABLED_VALUE "ENABLED")
  else ()
    set(IS_ENABLED_VALUE "DISABLED")
  endif ()
endmacro(is_enabled)

macro(set_autotools_path _VARNAME _VALUE _PREFIX)
    if ( IS_ABSOLUTE ${_VALUE} )
        set( ${_VARNAME} "${_VALUE}")
    else ( IS_ABSOLUTE ${_VALUE} )
        set( ${_VARNAME} "${_PREFIX}/${_VALUE}")
    endif ( IS_ABSOLUTE ${_VALUE} )
endmacro(set_autotools_path)

function(set_nds_protocols variable TEST_NAME)
    string(REPLACE "_" ";" name_list ${TEST_NAME})
    list(SORT name_list)
    list(REMOVE_DUPLICATES name_list)
    list(REMOVE_ITEM name_list "")
    ## message(STATUS "DEBUG: set_nds_protocols: name_list: ${name_list}")

    list(FIND name_list nds1 _index)
    if (${_index} GREATER -1)
        set(protocol_list ${NDS_TESTING_PROTOCOLS_NDS1})
    endif (${_index} GREATER -1)

    list(FIND name_list nds2 _index)
    if (${_index} GREATER -1)
        set(protocol_list ${NDS_TESTING_PROTOCOLS_NDS2})
    endif (${_index} GREATER -1)
    list(LENGTH protocol_list len)
    if ( NOT DEFINED protocol_list )
        message(FATAL_ERROR "Unable to determine NDS protocol for test ${TEST_NAME}")
    endif ( NOT DEFINED protocol_list )
    ## message(STATUS "DEBUG: set_nds_protocols: protocol_list: ${protocol_list}")
    set(${variable} ${protocol_list} PARENT_SCOPE)
endfunction(set_nds_protocols)

#========================================================================
# Release version number
#========================================================================
set( ${PROJECT_NAME}_MAJOR_VERSION 0 )
set( ${PROJECT_NAME}_MINOR_VERSION 15 )
set( ${PROJECT_NAME}_PATCH_VERSION 2 )
set( ${PROJECT_NAME}_VERSION
     ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION})
set( PROJECT_VERSION ${${PROJECT_NAME}_VERSION} )


set( PACKAGE_NAME ${PROJECT_NAME} )
set( PACKAGE_VERSION ${${PROJECT_NAME}_VERSION} )

if( WIN32 )
    set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
    set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
endif( WIN32 )

if( ${CMAKE_VERSION} VERSION_LESS 3.2.0 )
    find_program(PROG_ENV env)
else( ${CMAKE_VERSION} VERSION_LESS 3.2.0 )
    set( PROG_ENV "${CMAKE_COMMAND}" "-E" "env" )
endif( ${CMAKE_VERSION} VERSION_LESS 3.2.0 )

if( NOT REPLAY_BLOB_CACHE_DIR )
    set( REPLAY_BLOB_CACHE_DIR FALSE CACHE PATH "Directory containing replay blobs for testing" )
endif( NOT REPLAY_BLOB_CACHE_DIR )

#------------------------------------------------------------------------
# Purely internal variables
#------------------------------------------------------------------------
set( NDS_CUSTOM_TESTS_IGNORE ""
    CACHE INTERNAL
    "List of tests to ignore during the Test stage" )
set( NDS_CUSTOM_MEMCHECK_IGNORE ""
    CACHE INTERNAL
    "List of tests to ignore during the MemCheck stage" )

#------------------------------------------------------------------------
# Figure out where to install libraries
#------------------------------------------------------------------------
if ( WIN32 )
  set( RUNTIME_DESTINATION ${CMAKE_INSTALL_BINDIR} )
  set( LIBRARY_DESTINATION ${CMAKE_INSTALL_BINDIR} )
else ( WIN32 )
  set( RUNTIME_DESTINATION ${CMAKE_INSTALL_LIBDIR} )
  set( LIBRARY_DESTINATION ${CMAKE_INSTALL_LIBDIR} )
endif( WIN32 )

set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/README")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/ChangeLog")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${PACKAGE_NAME}")

set(NDS_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
set(NDS_PKG_DATA_DIR)

if(WIN32 AND NOT UNIX)
  SET(CPACK_NSIS_MODIFY_PATH Installers)
  # ON for 32- vs. 64-bit CMake: 
  #  - Root install directory (displayed to end user at installer-run time) 
  #  - "NSIS package/display name" (text used in the installer GUI) 
  #  - Registry key used to store info about the installation 
  if(CMAKE_CL_64) 
    set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") 
    # SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)") 
    # SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)") 
  else() 
    set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") 
    # SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") 
    # SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") 
  endif() 
endif(WIN32 AND NOT UNIX)
if ( DEFINED ENABLE_64BIT AND ( "${ENABLE_64BIT}" MATCHES "no" ) )
  unset( ENABLE_64BIT CACHE)
endif ( DEFINED ENABLE_64BIT AND ( "${ENABLE_64BIT}" MATCHES "no" ) )

#if ( APPLE )
  #----------------------------------------------------------------------
  # Allows RPATH to work with macports
  #----------------------------------------------------------------------
  set( _rpath "${CMAKE_INSTALL_PREFIX}/${LIBRARY_DESTINATION}" )
  list( FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${_rpath}" isSystemDir )
  if ( "${isSystemDir}" STREQUAL "-1" )
    set( CMAKE_INSTALL_RPATH "${_rpath}" )
    set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )
  endif ( "${isSystemDir}" STREQUAL "-1" )
#endif ( APPLE )

#========================================================================
# Prepare for testing
#========================================================================

if ( NOT DEFINED NDS_TESTING_PROTOCOLS_NDS1 )
    set( NDS_TESTING_PROTOCOLS_NDS1
        nds1-12_2 )
endif ( NOT DEFINED NDS_TESTING_PROTOCOLS_NDS1 )
if ( NOT DEFINED NDS_TESTING_PROTOCOLS_NDS2 )
    set( NDS_TESTING_PROTOCOLS_NDS2
        nds2-1_6 nds2-1_5 )
endif ( NOT DEFINED NDS_TESTING_PROTOCOLS_NDS2 )
if ( DEFINED CTEST_TESTING_TIMEOUT )
    set( CTEST_TESTING_TIMEOUT 60 )
endif ( DEFINED CTEST_TESTING_TIMEOUT )

if( NOT CTEST_MEMORYCHECK_COMMAND )
    find_program( CTEST_MEMORYCHECK_COMMAND NAMES valgrind )
endif( NOT CTEST_MEMORYCHECK_COMMAND )
if( NOT MEMORYCHECK_COMMAND )
    set( MEMORYCHECK_COMMAND ${CTEST_MEMORYCHECK_COMMAND} )
endif( NOT MEMORYCHECK_COMMAND )

if( NOT CTEST_MEMORYCHECK_COMMAND_OPTIONS )
    set( CTEST_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full" )
endif( NOT CTEST_MEMORYCHECK_COMMAND_OPTIONS )
if( NOT MEMORYCHECK_COMMAND_OPTIONS )
    set( MEMORYCHECK_COMMAND_OPTIONS ${CTEST_MEMORYCHECK_COMMAND_OPTIONS} )
endif( NOT MEMORYCHECK_COMMAND_OPTIONS )


include(CTest)
enable_testing( )

set(PROG_NDS_TESTER "${CMAKE_SOURCE_DIR}/tests/nds_tester.py" )
set(NDS_TESTER_FLAGS
    "--builddir=\${CMAKE_CURRENT_BINARY_DIR}"
    "--abs-top-srcdir=${CMAKE_SOURCE_DIR}"
    "--abs-srcdir=\${CMAKE_CURRENT_SOURCE_DIR}"
    "--abs-top-builddir=${CMAKE_BINARY_DIR}"
)

#========================================================================
# Prepare for distribuition
#========================================================================
#   G e n e r a l
#------------------------------------------------------------------------
set( CPACK_PACKAGE_VENDOR "LIGO" )
set( CPACK_PACKAGE_MAJOR ${${PROJECT_NAME}_MAJOR_VERSION} )
set( CPACK_PACKAGE_MINOR ${${PROJECT_NAME}_MINOR_VERSION} )
set( CPACK_PACKAGE_PATCH ${${PROJECT_NAME}_PATCH_VERSION} )
set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Client interface to NDS and NDS2 servers" )
set( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_MAJOR}.${CPACK_PACKAGE_MINOR}.${CPACK_PACKAGE_PATCH}" )
#------------------------------------------------------------------------
#   S O U R C E
#------------------------------------------------------------------------
set( CPACK_SOURCE_GENERATOR TBZ2 )
set( CPACK_SOURCE_PACKAGE_FILE_NAME
     ${PROJECT_NAME}-${${PROJECT_NAME}_VERSION} )
#set( CPACK_SYSTEM_NAME noarch )
set( CPACK_SOURCE_IGNORE_FILES "/.*~$/;/(CVS|autom4te[.]cache)/;/[.]svn/;[.]swap$;[.]#;.*~$;cscope.*")


include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckTypeSize)
include(CheckIncludeFiles)

include(CPack)

find_package(Doxygen)
find_package(Sed)
find_package(PythonInterp)

find_program(PROG_MATLAB matlab)

if(WIN32)
  if(IS_DIRECTORY "C:/Program Files/Mcirosoft SDKs/Windows/v7.0" )
    list(APPEND CMAKE_SYSTEM_PREFIX_PATH "C:/Program Files/Mcirosoft SDKs/Windows/v7.0")
  endif(IS_DIRECTORY "C:/Program Files/Mcirosoft SDKs/Windows/v7.0" )
endif(WIN32)
#========================================================================
# Check for header files
#========================================================================
check_include_files("sys/socket.h" HAVE_SYS_SOCKET_H)
check_include_files("sys/time.h"   HAVE_SYS_TIME_H)
check_include_files("arpa/inet.h"  HAVE_ARPA_INET_H)
check_include_files("netinet/in.h" HAVE_NETINET_IN_H)
check_include_files("errno.h"	   HAVE_ERRNO_H)
check_include_files("fcntl.h"	   HAVE_FCNTL_H)
check_include_files("fnmatch.h"    HAVE_FNMATCH_H)
check_include_files("io.h"         HAVE_IO_H)
check_include_files("inttypes.h"   HAVE_INTTYPES_H)
check_include_files("limits.h"     HAVE_LIMITS_H)
check_include_files("netdb.h"      HAVE_NETDB_H)
check_include_files("pthread.h"    HAVE_PTHREAD_H)
check_include_files("stdarg.h"     HAVE_STDARG_H)
check_include_files("stdint.h"     HAVE_STDINT_H)
check_include_files("stdio.h"      HAVE_STDIO_H)
check_include_files("stdlib.h"     HAVE_STDLIB_H)
check_include_files("string.h"     HAVE_STRING_H)
check_include_files("unistd.h"     HAVE_UNISTD_H)
check_include_files("winsock2.h"   HAVE_WINSOCK2_H)
check_include_files("ws2def.h"     HAVE_WS2DEF_H)
check_include_files("sqlite3.h"    HAVE_SQLITE3_H)
check_include_files("dlfcn.h"      HAVE_DLFCN_H)
check_include_files("win.h"        HAVE_WIN_H)

#========================================================================
# Check for prototypes
#========================================================================
if(${HAVE_WINSOCK2_H})
  set(HAVE_CLOSESOCKET 1)
endif(${HAVE_WINSOCK2_H})

#========================================================================
# Check the size of certain types
#========================================================================
check_type_size(size_t SIZEOF_SIZE_T)
check_type_size(int SIZEOF_INT)
check_type_size(long SIZEOF_LONG)
check_type_size("long long" SIZEOF_LONG_LONG)
check_type_size(time_t SIZEOF_TIME_T)
set(CMAKE_EXTRA_INCLUDE_FILES "stdint.h")
check_type_size(int16_t SIZEOF_INT16_T)
set(CMAKE_EXTRA_INCLUDE_FILES)
check_type_size(char16_t SIZEOF_CHAR16_T)

if(WIN32)
    # caution - ENV{ProgramFiles} on Win64 is adjusted to point to the arch of the running executable
    # which, since CMake is 32-bit on Windows as I write this, will always be = $ENV{ProgramFiles(x86)}
    # so we only use this environment variable if we figure out we're on win32
    set(pf86 "ProgramFiles(x86)")
    file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _PROG_FILES) # 32-bit dir on win32, useless to us on win64
    file(TO_CMAKE_PATH "$ENV{${pf86}}" _PROG_FILES_X86) # 32-bit dir: only set on win64
    file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _PROG_FILES_W6432) # 64-bit dir: only set on win64
    
    if(CMAKE_SIZEOF_VOID_P MATCHES "8")
        # 64-bit build on win64
        set(_PROGFILESDIR "${_PROG_FILES_W6432}")
    else()
        if(_PROG_FILES_W6432)
            # 32-bit build on win64
            set(_PROGFILESDIR "${_PROG_FILES_X86}")
        else()
            # 32-bit build on win32
            set(_PROGFILESDIR "${_PROG_FILES}")
        endif()
    endif()
endif(WIN32)

#========================================================================
# Set some compiler options
#========================================================================

# If using MSVC, disable warnings about 'unsecure' CRT funtions
# (such as memcpy)
if(MSVC)
  add_definitions( "-D_CRT_SECURE_NO_WARNINGS=1" )
endif(MSVC)

#========================================================================
# Automake/Autoconf compatibility for variable substitution
#========================================================================
# set( prefix ${CMAKE_INSTALL_PREFIX} )
# set_autotools_path( datarootdir ${SHARE_INSTALL_DIR} "\${prefix}" )
# set( exec_prefix "${prefix}" )
# set_autotools_path( bindir ${BIN_INSTALL_DIR} "\${exec_prefix}" )
# set_autotools_path( libdir ${LIB_INSTALL_DIR} "\${exec_prefix}" )
# set_autotools_path( libexecdir ${LIBEXEC_INSTALL_DIR} "\${exec_prefix}" )
# set_autotools_path( includedir ${INCLUDE_INSTALL_DIR} "\${prefix}" )
# set( abs_top_builddir ${CMAKE_BINARY_DIR} )
# set( abs_top_srcdir ${CMAKE_SOURCE_DIR} )
# set( VERSION ${${PROJECT_NAME}_VERSION} )

set( pythondir_script "import distutils.sysconfig; print( distutils.sysconfig.get_python_lib(0,0,\"${CMAKE_INSTALL_PREFIX}\") );" )
set( pyexecdir_script "import distutils.sysconfig; print( distutils.sysconfig.get_python_lib(0,0,\"${CMAKE_INSTALL_PREFIX}\") );" )

execute_process(
    COMMAND ${PYTHON_EXECUTABLE} -c "${pythondir_script}"
    OUTPUT_VARIABLE pythondir_full 
    OUTPUT_STRIP_TRAILING_WHITESPACE
    )
execute_process(
    COMMAND ${PYTHON_EXECUTABLE} -c "${pyexecdir_script}"
    OUTPUT_VARIABLE pyexecdir_full 
    OUTPUT_STRIP_TRAILING_WHITESPACE
    )
#========================================================================
# Setup environment files
#========================================================================
if ( NOT WIN32 )
    configure_file( ${CMAKE_SOURCE_DIR}/config/nds2-client-user-env.sh.in
                    ${CMAKE_CURRENT_BINARY_DIR}/nds2-client-user-env.sh )
    configure_file( ${CMAKE_SOURCE_DIR}/config/nds2-client-user-env.csh.in
                    ${CMAKE_CURRENT_BINARY_DIR}/nds2-client-user-env.csh
                    @ONLY)
    install(
        PROGRAMS
            ${CMAKE_CURRENT_BINARY_DIR}/nds2-client-user-env.sh
            ${CMAKE_CURRENT_BINARY_DIR}/nds2-client-user-env.csh
        DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}
        COMPONENT applications
    )
endif ( NOT WIN32 )

#========================================================================
# Setup code coverage helpers
#========================================================================
if (${COVERAGE_LCOV})
    configure_file( ${CMAKE_SOURCE_DIR}/config/cmake/run_coverage_report.sh.in
                    ${CMAKE_CURRENT_BINARY_DIR}/run_coverage_report.sh )
    configure_file( ${CMAKE_SOURCE_DIR}/config/cmake/clean_coverage.sh.in
                    ${CMAKE_CURRENT_BINARY_DIR}/clean_coverage.sh )
endif(${COVERAGE_LCOV})

#========================================================================
# Traverse the tree
#========================================================================

add_subdirectory(src)
add_subdirectory(swig)
add_subdirectory(doc)
add_subdirectory(man)

#========================================================================
# Creation of testing customization file
#========================================================================
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in
                ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake
                @ONLY )
#========================================================================
# Prepare for distribuition
#========================================================================
#------------------------------------------------------------------------
#   B I N A R Y
#------------------------------------------------------------------------
#------------------------------------------------------------------------
# Take action
#------------------------------------------------------------------------
cpack_add_component_group(Runtime
                          DESCRIPTION "Pieces needed for running")
cpack_add_component_group(Development
                          DESCRIPTION
                            "All of the pieces needed to write custom applications to interface with an NDS server.")
cpack_add_component(applications
	            DISPLAY_NAME "NDS Application"
                    DESCRIPTION
                     "A set of useful tools to communicate with NDS servers"
                    GROUP Runtime)
cpack_add_component(libraries
	            DISPLAY_NAME "NDS Libraries"
                    DESCRIPTION
                     "Libraries for building NDS clients"
                    GROUP Development)
cpack_add_component(headers
	            DISPLAY_NAME "NDS Headrs"
                    DESCRIPTION
                     "Headers for compiling NDS clients"
                    GROUP Development
		    DEPENDS libraries)
set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_HELP_LINK "https://wiki.ligo.org/DASWG/NDSClient")
#========================================================================
# Testing of the packaging
#========================================================================
set( AX_SOURCE_SPEC_FILENAME "${NDS_CONFIG_PATH}/${PROJECT_NAME}.spec.in" )
ax_packaging( )
#========================================================================
# Save command line to file for later rebuilding
#========================================================================
set(USED_CMD_LINE "cmake ")
get_cmake_property(CACHE_VARS CACHE_VARIABLES)
foreach(CACHE_VAR ${CACHE_VARS})
  get_property(CACHE_VAR_HELPSTRING CACHE ${CACHE_VAR} PROPERTY HELPSTRING)
  if(CACHE_VAR_HELPSTRING STREQUAL "No help, variable specified on the command line.")
    get_property(CACHE_VAR_TYPE CACHE ${CACHE_VAR} PROPERTY TYPE)
    if(CACHE_VAR_TYPE STREQUAL "UNINITIALIZED")
      set(CACHE_VAR_TYPE)
    else()
      set(CACHE_VAR_TYPE :${CACHE_VAR_TYPE})
    endif()
    set(CMAKE_ARGS "${CMAKE_ARGS} -D${CACHE_VAR}${CACHE_VAR_TYPE}=\"${${CACHE_VAR}}\"")
  endif()
endforeach()
set(USED_CMD_LINE "${CMAKE_COMMAND} ${CMAKE_ARGS} ${CMAKE_SOURCE_DIR}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config.status ${USED_CMD_LINE} )
#========================================================================
# Report configuration information
#  CMAKE_MAKE_PROGRAM:FILEPATH
#========================================================================
message(STATUS "=========================================================")
message(STATUS "  nds2-client has now ben successfully configured:")
is_enabled( SASL_FOUND )
message(STATUS "      SASL authentication is       ${IS_ENABLED_VALUE}")
is_enabled( GSSAPI_FOUND )
message(STATUS "      GSSAPI authentication is     ${IS_ENABLED_VALUE}")
is_enabled( SQLITE_EXTERNAL )
message(STATUS "      using external SQLITE is is  ${IS_ENABLED_VALUE}")
is_enabled( ENABLE_SWIG_JAVA )
message(STATUS "      SWIG interface for Java is   ${IS_ENABLED_VALUE}")
is_enabled( ENABLE_SWIG_PYTHON )
message(STATUS "      SWIG interface for Python is ${IS_ENABLED_VALUE}")
is_enabled( ENABLE_SWIG_OCTAVE )
message(STATUS "      SWIG interface for Octave is ${IS_ENABLED_VALUE}")
message(STATUS "          Octave version is        ${OCTAVE_VERSION_STRING}" )
is_enabled( ENABLE_SWIG_MATLAB )
message(STATUS "      SWIG interface for MATLAB is ${IS_ENABLED_VALUE}")
message(STATUS " Other programs:" )
message(STATUS "      MATLAB                       ${PROG_MATLAB}" )
message(STATUS " installation directories:" )
message(STATUS "      CMAKE_INSTALL_BINDIR         ${CMAKE_INSTALL_BINDIR}" )
message(STATUS "      CMAKE_INSTALL_DATADIR        ${CMAKE_INSTALL_DATADIR}" )
message(STATUS "      CMAKE_INSTALL_PKGDATADIR     ${CMAKE_INSTALL_PKGDATADIR}" )
message(STATUS " ")
message(STATUS "  Now run 'cmake --build .' to build nds2-client")
message(STATUS "  and run 'cpack' to package nds2-client")
message(STATUS "=========================================================")
