first commit
This commit is contained in:
32
extern/cmake/2.85/share/cmake-2.8/Modules/FortranCInterface/Verify/CMakeLists.txt
vendored
Normal file
32
extern/cmake/2.85/share/cmake-2.8/Modules/FortranCInterface/Verify/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
#=============================================================================
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
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})
|
||||
|
||||
if(NOT VERIFY_CXX)
|
||||
# The entry point (main) is defined in C; link with the C compiler.
|
||||
set_property(TARGET VerifyFortranC PROPERTY LINKER_LANGUAGE C)
|
||||
endif()
|
||||
5
extern/cmake/2.85/share/cmake-2.8/Modules/FortranCInterface/Verify/VerifyC.c
vendored
Normal file
5
extern/cmake/2.85/share/cmake-2.8/Modules/FortranCInterface/Verify/VerifyC.c
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
#include <stdio.h>
|
||||
void VerifyC(void)
|
||||
{
|
||||
printf("VerifyC\n");
|
||||
}
|
||||
4
extern/cmake/2.85/share/cmake-2.8/Modules/FortranCInterface/Verify/VerifyCXX.cxx
vendored
Normal file
4
extern/cmake/2.85/share/cmake-2.8/Modules/FortranCInterface/Verify/VerifyCXX.cxx
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
extern "C" void VerifyCXX(void)
|
||||
{
|
||||
delete new int;
|
||||
}
|
||||
3
extern/cmake/2.85/share/cmake-2.8/Modules/FortranCInterface/Verify/VerifyFortran.f
vendored
Normal file
3
extern/cmake/2.85/share/cmake-2.8/Modules/FortranCInterface/Verify/VerifyFortran.f
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
subroutine VerifyFortran
|
||||
print *, 'VerifyFortran'
|
||||
end
|
||||
16
extern/cmake/2.85/share/cmake-2.8/Modules/FortranCInterface/Verify/main.c
vendored
Normal file
16
extern/cmake/2.85/share/cmake-2.8/Modules/FortranCInterface/Verify/main.c
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user