From e44c19d1ccc01a9d0217bf5341d387560702f2a3 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 24 Oct 2011 13:36:49 +0200 Subject: hopefully this workaround of cmake bug #9220 works for MSVC too --- blas/CMakeLists.txt | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'blas') diff --git a/blas/CMakeLists.txt b/blas/CMakeLists.txt index 03346a936..55440f4dc 100644 --- a/blas/CMakeLists.txt +++ b/blas/CMakeLists.txt @@ -1,25 +1,19 @@ project(EigenBlas CXX) -if( NOT DEFINED EIGEN_Fortran_COMPILER_WORKS OR EIGEN_Fortran_COMPILER_WORKS) +include("../cmake/language_support.cmake") - enable_language(Fortran OPTIONAL) +workaround_9220(Fortran EIGEN_Fortran_COMPILER_WORKS) - if(CMAKE_Fortran_COMPILER_WORKS) - set(EIGEN_Fortran_COMPILER_WORKS TRUE CACHE INTERNAL "workaround cmake's enable_language issue") - else() - set(EIGEN_Fortran_COMPILER_WORKS FALSE CACHE INTERNAL "workaround cmake's enable_language issue") - endif() - +if(EIGEN_Fortran_COMPILER_WORKS) + enable_language(Fortran OPTIONAL) endif() add_custom_target(blas) set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp xerbla.cpp) -if(CMAKE_Fortran_COMPILER_WORKS) - -message(WARNING " No fortran compiler has been detected, the blas build will be incomplete.") +if(EIGEN_Fortran_COMPILER_WORKS) set(EigenBlas_SRCS ${EigenBlas_SRCS} complexdots.f @@ -29,8 +23,11 @@ set(EigenBlas_SRCS ${EigenBlas_SRCS} zhbmv.f zhpr.f ztpmv.f chpmv.f ctbmv.f ctpsv.f dsbmv.f dspr.f dtpmv.f sspr2.f stbsv.f zhpmv.f ztbmv.f ztpsv.f ) +else() + +message(WARNING " No fortran compiler has been detected, the blas build will be incomplete.") -endif(CMAKE_Fortran_COMPILER_WORKS) +endif() add_library(eigen_blas_static ${EigenBlas_SRCS}) add_library(eigen_blas SHARED ${EigenBlas_SRCS}) @@ -47,7 +44,7 @@ install(TARGETS eigen_blas eigen_blas_static LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -if(CMAKE_Fortran_COMPILER_WORKS) +if(EIGEN_Fortran_COMPILER_WORKS) if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest -- cgit v1.2.3