[Cmake-commits] [cmake-commits] king committed CMakeLists.txt NONE 1.1 VerifyC.c NONE 1.1 VerifyCXX.cxx NONE 1.1 VerifyFortran.f NONE 1.1 main.c NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Aug 24 08:49:37 EDT 2009


Update of /cvsroot/CMake/CMake/Modules/FortranCInterface/Verify
In directory public:/mounts/ram/cvs-serv31631/Modules/FortranCInterface/Verify

Added Files:
	CMakeLists.txt VerifyC.c VerifyCXX.cxx VerifyFortran.f main.c 
Log Message:
Create FortranCInterface_VERIFY function

This function builds a simple test project using a combination of
Fortran and C (and optionally C++) to verify that the compilers are
compatible.  The idea is to help projects report very early to users
that the compilers specified cannot mix languages.


--- NEW FILE: VerifyFortran.f ---
      subroutine VerifyFortran
        print *, 'VerifyFortran'
      end

--- NEW FILE: CMakeLists.txt ---
cmake_minimum_required(VERSION 2.7)
project(VerifyFortranC C Fortran)

option(VERIFY_CXX "Whether to verify C++ and Fortran" OFF)
if(VERIFY_CXX)
  enable_language(CXX)
  set(VerifyCXX VerifyCXX.cxx)
  add_definitions(-DVERIFY_CXX)
endif()

include(FortranCInterface)

FortranCInterface_HEADER(VerifyFortran.h SYMBOLS VerifyFortran)
include_directories(${VerifyFortranC_BINARY_DIR})

add_executable(VerifyFortranC main.c VerifyC.c VerifyFortran.f ${VerifyCXX})

--- NEW FILE: VerifyCXX.cxx ---
extern "C" void VerifyCXX(void)
{
  delete new int;
}

--- NEW FILE: main.c ---
extern void VerifyC(void);
#ifdef VERIFY_CXX
extern void VerifyCXX(void);
#endif
#include "VerifyFortran.h"
extern void VerifyFortran(void);

int main(void)
{
  VerifyC();
#ifdef VERIFY_CXX
  VerifyCXX();
#endif
  VerifyFortran();
  return 0;
}

--- NEW FILE: VerifyC.c ---
#include <stdio.h>
void VerifyC(void)
{
  printf("VerifyC\n");
}



More information about the Cmake-commits mailing list