
I created the latest Ada language support files by looking at what is
done for C, C++, and Fortran for CMake-3.4.0-rc3 (where the
"<INCLUDES"> internal language support change was first implemented)
and modifying the C version appropriately for Ada.  (I have
temporarily copied the relevant files to the C, CXX, and Fortran
directories and edited them to remove gratuitious differences so that
the actual important differences show up using the sed...diff commands
below.)

I. CMakeDetermine${LANG}Compiler.cmake where LANG = CXX, Fortran,
and (eventually) Ada.

* Compare ${LANG} with C version to get an idea of what the key differences are between
those two language support files.  Use sed scripts to get rid of the obvious and
expected differences.

LANG=CXX
LANGFLAG=CXX
LANGFLAG_ALT='C[+][+]'
sed -e "s?CMAKE_${LANG}?CMAKE_C?g" -e "s?_${LANGFLAG}?_CC?g" -e "s?${LANGFLAG}?CC?g" -e "s?${LANGFLAG_ALT}?C?g" <${LANG}/CMakeDetermine${LANG}Compiler.cmake |diff -au C/CMakeDetermineCCompiler.cmake - | less

Similar experiments with
LANG=Fortran
LANGFLAG=FC
LANGFLAG_ALT='gfortran'

showed that Fortran case had extra complexity so ignore that except if there is
some real doubt about the C/CXX differences.

* Create the initial Ada version from a mass-edited CXX version
(since the C++ names, e.g., CXX, g++, etc., are more distinctive
[and thus easier to mass-edit] and for the gcc case g++ is an
add-on to gcc similar in some respects to the gnatmake add-on
to the gcc suite that we are supporting here).

cp CXX/CMakeDetermineCXXCompiler.cmake CMakeDetermineAdaCompiler.cmake

sed -i -e 's?CMAKE_CXX?CMAKE_Ada?g' -e 's?_CXX?_ADA?g' -e 's?C[+][+]?Ada?g' CMakeDetermineAdaCompiler.cmake

* Insert full license text (with addition of copyright to Alan W. Irwin),
drop all cross-compile and toolchain logic, drop MSVC and xcode logic blocks,
change anything related to CXX or C++ to Ada equivalent, e.g.,

set(CMAKE_Ada_COMPILER_LIST gnatgcc gcc)
set(CMAKE_Ada_COMPILER_NAMES gnatmake)

* Final check of all changes

sed -e "s?CMAKE_Ada?CMAKE_CXX?g" -e "s?ADA?CXX?g" -e "s?Ada?C[+][+]?g" < CMakeDetermineAdaCompiler.cmake |diff -au CXX/CMakeDetermineCXXCompiler.cmake - | less


II. CMake${LANG}Compiler.cmake.in where LANG = CXX and (eventually) Ada.

* Compare ${LANG} with C version to get an idea of what the key differences are between
those two language support files.  Use sed scripts to get rid of the obvious and
expected differences.

LANG=CXX
LANGFLAG=CXX
LANGFLAG_ALT='C[+][+]'
sed -e "s?CMAKE_${LANG}?CMAKE_C?g" -e "s?_${LANGFLAG}?_CC?g" -e "s?${LANGFLAG}?CC?g" -e "s?${LANGFLAG_ALT}?C?g" <${LANG}/CMake${LANG}Compiler.cmake.in |diff -au C/CMakeCCompiler.cmake.in - | less

* Create the initial Ada version from a mass-edited CXX version
(since the C++ names, e.g., CXX, g++, etc., are more distinctive
[and thus easier to mass-edit] and for the gcc case g++ is an
add-on to gcc similar in some respects to the gnatmake add-on
to the gcc suite that we are supporting here).

cp CXX/CMakeCXXCompiler.cmake.in CMakeAdaCompiler.cmake.in

sed -i -e 's?CMAKE_CXX?CMAKE_Ada?g' -e 's?_CXX?_ADA?g' -e 's?C[+][+]?Ada?g' CMakeAdaCompiler.cmake.in

* Drop the numerical variants of the compiler features for 1998, 2011, and 2014 that
are only relevant to C++ standards.

*
set(CMAKE_CXX_IGNORE_EXTENSIONS ads;h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS adb)
set(CMAKE_CXX_LINKER_PREFERENCE Prefered)

* Final check of all changes

sed -e "s?CMAKE_Ada?CMAKE_CXX?g" -e "s?ADA?CXX?g" -e "s?Ada?C[+][+]?g" < CMakeAdaCompiler.cmake.in |diff -au CXX/CMakeCXXCompiler.cmake.in - | less

III. CMakeTest${LANG}Compiler.cmake

* Compare ${LANG} with C version to get an idea of what the key differences are between
those two language support files.  Use sed scripts to get rid of the obvious and
expected differences.

LANG=CXX
LANGFLAG=CXX
LANGFLAG_ALT='C[+][+]'
sed -e "s?CMAKE_${LANG}?CMAKE_C?g" -e "s?_${LANGFLAG}?_CC?g" -e "s?${LANGFLAG}?CC?g" -e "s?${LANGFLAG_ALT}?C?g" <${LANG}/CMakeTest${LANG}Compiler.cmake |diff -au C/CMakeTestCCompiler.cmake - | less

* Create the initial Ada version from a mass-edited CXX version
(since the C++ names, e.g., CXX, g++, etc., are more distinctive
[and thus easier to mass-edit] and for the gcc case g++ is an
add-on to gcc similar in some respects to the gnatmake add-on
to the gcc suite that we are supporting here).

cp CXX/CMakeTestCXXCompiler.cmake CMakeTestAdaCompiler.cmake

sed -i -e 's?CMAKE_CXX?CMAKE_Ada?g' -e 's?_CXX?_ADA?g' -e 's?C[+][+]?Ada?g' CMakeTestAdaCompiler.cmake

* Insert full license text (with addition of copyright to Alan W. Irwin) and
drop all ABI determination.

* Final check of all changes

sed -e "s?CMAKE_Ada?CMAKE_CXX?g" -e "s?ADA?CXX?g" -e "s?Ada?C[+][+]?g" < CMakeTestAdaCompiler.cmake |diff -au CXX/CMakeTestCXXCompiler.cmake - | less

IV. CMake${LANG}Information.cmake

* Compare ${LANG} with C version to get an idea of what the key differences are between
those two language support files.  Use sed scripts to get rid of the obvious and
expected differences.

LANG=CXX
LANGFLAG=CXX
LANGFLAG_ALT='C[+][+]'
sed -e "s?CMAKE_${LANG}?CMAKE_C?g" -e "s?_${LANGFLAG}?_CC?g" -e "s?${LANGFLAG}?CC?g" -e "s?${LANGFLAG_ALT}?C?g" <${LANG}/CMake${LANG}Information.cmake |diff -au C/CMakeCInformation.cmake - | less

* Create the initial Ada version from a mass-edited CXX version
(since the C++ names, e.g., CXX, g++, etc., are more distinctive
[and thus easier to mass-edit] and for the gcc case g++ is an
add-on to gcc similar in some respects to the gnatmake add-on
to the gcc suite that we are supporting here).

cp CXX/CMakeCXXInformation.cmake CMakeAdaInformation.cmake

sed -i -e 's?CMAKE_CXX?CMAKE_Ada?g' -e 's?_CXX?_ADA?g' -e 's?C[+][+]?Ada?g' CMakeAdaInformation.cmake

* Insert full license text (with addition of copyright to Alan W. Irwin);

* Final check of all changes

sed -e "s?CMAKE_Ada?CMAKE_CXX?g" -e "s?ADA?CXX?g" -e "s?Ada?C[+][+]?g" < CMakeAdaInformation.cmake |diff -au CXX/CMakeCXXInformation.cmake - | less

