[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.26 1.27 foo.c 1.1 1.2 foo.cxx NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Jul 27 12:43:45 EDT 2009


Update of /cvsroot/CMake/CMake/Tests/Fortran
In directory public:/mounts/ram/cvs-serv32550/Tests/Fortran

Modified Files:
	CMakeLists.txt foo.c 
Added Files:
	foo.cxx 
Log Message:
ENH: Test Fortran and C++ in one executable

This extends the Fortran-to-C interface test to add a C++ source file.
The executable can only link with the C++ linker and with the proper
Fortran runtime libraries.  These libraries should be detected by CMake
automatically, so this tests verifies the detection functionality.


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Fortran/CMakeLists.txt,v
retrieving revision 1.26
retrieving revision 1.27
diff -C 2 -d -r1.26 -r1.27
*** CMakeLists.txt	27 Jul 2009 16:43:27 -0000	1.26
--- CMakeLists.txt	27 Jul 2009 16:43:42 -0000	1.27
***************
*** 1,4 ****
  cmake_minimum_required (VERSION 2.6)
! project(testf Fortran C)
  message("CTEST_FULL_OUTPUT ")
  set(CMAKE_VERBOSE_MAKEFILE 1)
--- 1,4 ----
  cmake_minimum_required (VERSION 2.6)
! project(testf Fortran C CXX)
  message("CTEST_FULL_OUTPUT ")
  set(CMAKE_VERBOSE_MAKEFILE 1)
***************
*** 31,35 ****
    endif()
    set(FORTRAN_FUNCTIONS ${FORTRAN_FUNCTIONS} my_sub mysub )
!   set(srcs ${srcs} mysub.f foo.c)
    create_fortran_c_interface("F_" FORTRAN_FUNCTIONS 
      "${testf_BINARY_DIR}/foo.h")
--- 31,35 ----
    endif()
    set(FORTRAN_FUNCTIONS ${FORTRAN_FUNCTIONS} my_sub mysub )
!   set(srcs ${srcs} mysub.f foo.c foo.cxx)
    create_fortran_c_interface("F_" FORTRAN_FUNCTIONS 
      "${testf_BINARY_DIR}/foo.h")

Index: foo.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Fortran/foo.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** foo.c	29 Oct 2008 14:58:40 -0000	1.1
--- foo.c	27 Jul 2009 16:43:42 -0000	1.2
***************
*** 2,6 ****
  extern F_test_mod_sub();
  extern F_mysub();
! int main()
  {
    F_mysub();
--- 2,6 ----
  extern F_test_mod_sub();
  extern F_mysub();
! int foo()
  {
    F_mysub();

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



More information about the Cmake-commits mailing list