From b2b9d171464105886f33ca6c23ae4885cdcd1a1e Mon Sep 17 00:00:00 2001 From: Pavel Grunt Date: Mon, 30 Oct 2017 10:45:54 +0100 Subject: [PATCH] cmake: Allow to build without fortran --- CMakeLists.txt | 14 ++++++++------ cmake/system.cmake | 10 ++++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a379f549a..af9b7dd20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -183,13 +183,15 @@ if (NOT MSVC) if(SMP) target_link_libraries(${OpenBLAS_LIBNAME} pthread) target_link_libraries(${OpenBLAS_LIBNAME}_static pthread) -endif() + endif() -#build test and ctest -add_subdirectory(test) -if(NOT NO_CBLAS) -add_subdirectory(ctest) -endif() + if (NOT NOFORTRAN) + #build test and ctest + add_subdirectory(test) + if(NOT NO_CBLAS) + add_subdirectory(ctest) + endif() + endif() endif() set_target_properties(${OpenBLAS_LIBNAME} PROPERTIES diff --git a/cmake/system.cmake b/cmake/system.cmake index 75c8e9c55..69a78769a 100644 --- a/cmake/system.cmake +++ b/cmake/system.cmake @@ -150,10 +150,12 @@ if (NEED_PIC) set(CCOMMON_OPT "${CCOMMON_OPT} -fPIC") endif () - if (${F_COMPILER} STREQUAL "SUN") - set(FCOMMON_OPT "${FCOMMON_OPT} -pic") - else () - set(FCOMMON_OPT "${FCOMMON_OPT} -fPIC") + if (NOT NOFORTRAN) + if (${F_COMPILER} STREQUAL "SUN") + set(FCOMMON_OPT "${FCOMMON_OPT} -pic") + else () + set(FCOMMON_OPT "${FCOMMON_OPT} -fPIC") + endif () endif () endif ()