cmake_minimum_required(VERSION4.0.1)project(testprjLANGUAGESCFortran)# 调试输出编译器信息message(STATUS"CMAKE_C_COMPILER=${CMAKE_C_COMPILER}")message(STATUS"CMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}")message(STATUS"CMAK
-- CMAKE_Fortran_COMPILER_ID_MATCH_VENDORS=CCur -- CMAKE_Fortran_COMPILER_ID_MATCH_VENDOR_REGEX_CCur=Concurrent Fortran [0-9]+ Compiler -- CMAKE_Fortran_COMPILER_ID_RUN=1 -- CMAKE_Fortran_COMPILER_ID_TOOL_MATCH_INDEX=2 -- HELLO CMAKE_Fortran_COMPILER_ID_TOOL_MATCH_REGEX=CMAKE_FORTRAN...
Fortran 示例包含一个非常紧凑的表达式,我们使用CMAKE_Fortran_COMPILER_ID变量来构造预处理器定义,使用target_compile_definitions。为了适应这一点,我们不得不将“Intel”的案例从IS_INTEL_CXX_COMPILER更改为IS_Intel_FORTRAN_COMPILER。我们可以通过使用相应的CMAKE_C_COMPILER_ID和CMAKE_CXX_COMPILER_ID变量为 C ...
CMAKE_FORCE_CXX_COMPILER(<compiler> <compiler-id>) It sets CMAKE_CXX_COMPILER to the given compiler and the cmake internal variable CMAKE_CXX_COMPILER_ID to the given compiler-id. It also bypasses the check for working compiler and basic compiler information tests. Macro CMAKE_FORCE_Fortra...
在本配方中,我们将从 C++示例开始,稍后我们将展示一个 Fortran 示例,并尝试重构和简化 CMake 代码。 让我们考虑以下hello-world.cpp源代码: #include <cstdlib>#include <iostream>#include <string>std::string say_hello() {#ifdef IS_INTEL_CXX_COMPILER// only compiled when Intel compiler is selected//...
在编译带有调试符号的代码时,我通常还希望启用某些编译时和运行时检查,如下所示:IF(${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUGdeterm 浏览8提问于2016-09-13得票数 2 回答已采纳 1回答 flann依赖于matlab - MEX 、、、 CMake警告(dev)在...
CMakeDetermineCSharpCompiler.cmake CMakeDetermineCUDACompiler.cmake CMakeDetermineCXXCompiler.cmake CMakeDetermineCompileFeatures.cmake CMakeDetermineCompiler.cmake CMakeDetermineCompilerABI.cmake CMakeDetermineCompilerId.cmake CMakeDetermineFortranCompiler.cmake CMakeDetermineJavaCompiler.cmake ...
工具指南:从GCC到CMake的软件编译简化之路 GCC,即GNU Compiler Collection,是一套功能强大的编译器,能够编译包括C、C++、Objective-C、Fortran、Java在内的多种编程语言。当程序仅包含一个源文件时,直接使用gcc命令进行编译即可。然而,对于包含多个源文件的复杂程序,逐个编译会变得繁琐且容易出错。因此,make工具...
CMakeDetermineCSharpCompiler.cmake CMakeDetermineCUDACompiler.cmake CMakeDetermineCXXCompiler.cmake CMakeDetermineCompileFeatures.cmake CMakeDetermineCompiler.cmake CMakeDetermineCompilerABI.cmake CMakeDetermineCompilerId.cmake CMakeDetermineFortranCompiler.cmake CMakeDetermineJavaCompiler.cmake ...
PROGRAM CMakeFortranCompilerId #if 0 ! Identify the compiler #endif #if defined(_MSC_VER) PRINT *, 'INFO:simulate[MSVC]' # if _MSC_VER >= 1900 PRINT *, 'INFO:simulate_version[019.00]' # elif _MSC_VER >= 1800 PRINT *, 'INFO:simulate_version[018.00]...