CMakeLists.txt 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #=============================================================================
  2. # Copyright 2009 Kitware, Inc.
  3. #
  4. # Distributed under the OSI-approved BSD License (the "License");
  5. # see accompanying file Copyright.txt for details.
  6. #
  7. # This software is distributed WITHOUT ANY WARRANTY; without even the
  8. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. # See the License for more information.
  10. #=============================================================================
  11. cmake_minimum_required(VERSION 2.7)
  12. project(VerifyFortranC C Fortran)
  13. option(VERIFY_CXX "Whether to verify C++ and Fortran" OFF)
  14. if(VERIFY_CXX)
  15. enable_language(CXX)
  16. set(VerifyCXX VerifyCXX.cxx)
  17. add_definitions(-DVERIFY_CXX)
  18. endif()
  19. include(FortranCInterface)
  20. FortranCInterface_HEADER(VerifyFortran.h SYMBOLS VerifyFortran)
  21. include_directories(${VerifyFortranC_BINARY_DIR})
  22. add_executable(VerifyFortranC main.c VerifyC.c VerifyFortran.f ${VerifyCXX})
  23. if(NOT VERIFY_CXX)
  24. # The entry point (main) is defined in C; link with the C compiler.
  25. set_property(TARGET VerifyFortranC PROPERTY LINKER_LANGUAGE C)
  26. endif()