From 246296b0a42dce26365b7eee1136207f94007f4d Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Thu, 18 Nov 2021 17:28:31 -0500 Subject: [PATCH] Set _ENABLE_Fortran=OFF by default for WIN32 (#299) It is very hard to get a Fortran compiler for native Windows so do everyone a favor and just disable it by default for WIN32. --- tribits/ReleaseNotes.txt | 6 ++++++ tribits/core/package_arch/TribitsGlobalMacros.cmake | 6 +++++- tribits/doc/guides/TribitsCoreDetailedReference.rst | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tribits/ReleaseNotes.txt b/tribits/ReleaseNotes.txt index edf524e7a..683899d4f 100644 --- a/tribits/ReleaseNotes.txt +++ b/tribits/ReleaseNotes.txt @@ -2,6 +2,12 @@ Release Notes for TriBITS ---------------------------------------- +2021/11/18: + +(*) MAJOR: The default value for _ENABLE_Fortran is set to OFF on + WIN32 systems. (Getting a Fortran compiler for native Windows is not + typically very easy.) + 2021/10/11: (*) MAJOR: The `Config.cmake` for each enabled package generated in diff --git a/tribits/core/package_arch/TribitsGlobalMacros.cmake b/tribits/core/package_arch/TribitsGlobalMacros.cmake index 91c2a6cf4..34e0bdfef 100644 --- a/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -291,7 +291,11 @@ macro(tribits_define_global_options_and_define_extra_repos) set(${PROJECT_NAME}_ENABLE_CXX11 ON) if ("${${PROJECT_NAME}_ENABLE_Fortran_DEFAULT}" STREQUAL "") - set(${PROJECT_NAME}_ENABLE_Fortran_DEFAULT ON) + if (WIN32) + set(${PROJECT_NAME}_ENABLE_Fortran_DEFAULT OFF) + else() + set(${PROJECT_NAME}_ENABLE_Fortran_DEFAULT ON) + endif() endif() option(${PROJECT_NAME}_ENABLE_Fortran diff --git a/tribits/doc/guides/TribitsCoreDetailedReference.rst b/tribits/doc/guides/TribitsCoreDetailedReference.rst index 092ccb1ab..45feeb1e9 100644 --- a/tribits/doc/guides/TribitsCoreDetailedReference.rst +++ b/tribits/doc/guides/TribitsCoreDetailedReference.rst @@ -368,6 +368,10 @@ These options are described below. This default can be set in `/ProjectName.cmake`_ or `/CMakeLists.txt`_. + On WIN32 sytems, the default for ``${PROJECT_NAME}_ENABLE_Fortran_DEFAULT`` + is set to ``OFF`` since it can be difficult to get a Fortran compiler for + native Windows. + Given that a native Fortran compiler is not supported by default on Windows and on most Mac OSX systems, projects that have optional Fortran code may decide to set the default depending on the platform by setting, for example::