Blame cmake/modules/TestForHighBitCharacters.cmake

Packit ed3af9
# cmake/modules/TestForHighBitCharacters.cmake
Packit ed3af9
#
Packit ed3af9
# Copyright (C) 2006  Alan W. Irwin
Packit ed3af9
#
Packit ed3af9
# This file is part of PLplot.
Packit ed3af9
#
Packit ed3af9
# PLplot is free software; you can redistribute it and/or modify
Packit ed3af9
# it under the terms of the GNU Library General Public License as published
Packit ed3af9
# by the Free Software Foundation; version 2 of the License.
Packit ed3af9
#
Packit ed3af9
# PLplot is distributed in the hope that it will be useful,
Packit ed3af9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit ed3af9
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit ed3af9
# GNU Library General Public License for more details.
Packit ed3af9
#
Packit ed3af9
# You should have received a copy of the GNU Library General Public License
Packit ed3af9
# along with the file PLplot; if not, write to the Free Software
Packit ed3af9
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
Packit ed3af9
Packit ed3af9
# Check if ctype.h macros work on characters with the high bit set.
Packit ed3af9
if(NOT DEFINED CMAKE_HIGH_BIT_CHARACTERS)
Packit ed3af9
   message(STATUS 
Packit ed3af9
      "Check for whether ctype.h macros work on characters with the\n"
Packit ed3af9
   "   high bit set."
Packit ed3af9
   )
Packit ed3af9
  try_compile(CMAKE_HIGH_BIT_CHARACTERS  
Packit ed3af9
    ${CMAKE_BINARY_DIR}
Packit ed3af9
    ${CMAKE_SOURCE_DIR}/CMakeModules/TestForHighBitCharacters.c
Packit ed3af9
    OUTPUT_VARIABLE OUTPUT)
Packit ed3af9
  if(CMAKE_HIGH_BIT_CHARACTERS)
Packit ed3af9
    message(STATUS "High-bit characters - work")
Packit ed3af9
    set(HIGH_BIT_CHARACTERS 1 CACHE INTERNAL
Packit ed3af9
      "Do ctype.h macros work on high-bit characters")
Packit ed3af9
      file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
Packit ed3af9
      "Determining if ctype.h macros work on high-bit characters passed with "
Packit ed3af9
      "the following output:\n${OUTPUT}\n\n")
Packit ed3af9
  else(CMAKE_HIGH_BIT_CHARACTERS)
Packit ed3af9
    message(STATUS "High-bit characters - don't work")
Packit ed3af9
    set(HIGH_BIT_CHARACTERS 0 CACHE INTERNAL
Packit ed3af9
      "Do ctype.h macros work on high-bit characters")
Packit ed3af9
      file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
Packit ed3af9
      "Determining if ctype.h macros work on high-bit characters failed with "
Packit ed3af9
      "the following output:\n${OUTPUT}\n\n")
Packit ed3af9
  endif(CMAKE_HIGH_BIT_CHARACTERS)
Packit ed3af9
endif(NOT DEFINED CMAKE_HIGH_BIT_CHARACTERS)