[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.27 1.28 foo.c 1.2 NONE foo.cxx 1.1 NONE mainc.c NONE 1.1 maincxx.c NONE 1.1 myc.c NONE 1.1 mycxx.cxx NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Aug 4 14:06:47 EDT 2009


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

Modified Files:
	CMakeLists.txt 
Added Files:
	mainc.c maincxx.c myc.c mycxx.cxx 
Removed Files:
	foo.c foo.cxx 
Log Message:
Test C, C++, Fortran interface combinations

Previously the Fortran test created a single executable containing C,
C++, and Fortran sources.  This commit divides the executable into three
libraries corresponding to each language, and two executables testing
Fortran/C only and Fortran/C/C++ together.  The result tests more
combinations of using the languages together, and that language
requirements propagate through linking.


--- NEW FILE: myc.c ---
#include "foo.h"
extern F_test_mod_sub(void);
extern F_mysub(void);
int myc(void)
{
  F_mysub();
  F_my_sub();
#ifdef F_test_mod_sub
  F_test_mod_sub();
#endif
  return 0;
}

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

--- foo.c DELETED ---

--- NEW FILE: maincxx.c ---
extern int myc(void);
extern int mycxx(void);
int main()
{
  return myc() + mycxx();
}

--- NEW FILE: mainc.c ---
extern int myc(void);
int main()
{
  return myc();
}

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Fortran/CMakeLists.txt,v
retrieving revision 1.27
retrieving revision 1.28
diff -C 2 -d -r1.27 -r1.28
*** CMakeLists.txt	27 Jul 2009 16:43:42 -0000	1.27
--- CMakeLists.txt	4 Aug 2009 18:06:45 -0000	1.28
***************
*** 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")
--- 31,34 ----
***************
*** 62,66 ****
    message("Fortran = ${CMAKE_Fortran_COMPILER_ID}")
    message("C = ${CMAKE_C_COMPILER_ID}")
!   add_executable(foo ${srcs})
    # print out some stuff to help debug on machines via cdash
    file(READ "${testf_BINARY_DIR}/foo.h" fooh)
--- 61,78 ----
    message("Fortran = ${CMAKE_Fortran_COMPILER_ID}")
    message("C = ${CMAKE_C_COMPILER_ID}")
! 
!   add_library(myfort mysub.f ${srcs})
! 
!   add_library(myc myc.c)
!   target_link_libraries(myc myfort)
! 
!   add_library(mycxx mycxx.cxx)
!   target_link_libraries(mycxx myc)
! 
!   add_executable(mainc mainc.c)
!   target_link_libraries(mainc myc)
!   add_executable(maincxx maincxx.c)
!   target_link_libraries(maincxx mycxx)
! 
    # print out some stuff to help debug on machines via cdash
    file(READ "${testf_BINARY_DIR}/foo.h" fooh)

--- foo.cxx DELETED ---



More information about the Cmake-commits mailing list