Skip to content

Commit

Permalink
CMake: restore compatibility with v3.10 and older
Browse files Browse the repository at this point in the history
The COMPILE_OPTIONS property exists only from CMake 3.11 onwards.

fixes Reference-LAPACK#975
  • Loading branch information
christoph-conrads committed Jan 13, 2024
1 parent db501d9 commit ec2805b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BLAS/SRC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ if(BUILD_INDEX64_EXT_API)
#Add _64 suffix to all Fortran functions via macros
foreach(F IN LISTS SOURCES_64_F)
if(CMAKE_Fortran_COMPILER_ID STREQUAL "NAG")
set(COPT_64_F -fpp)
set_source_files_properties(${F} PROPERTIES COMPILE_FLAGS "-fpp")
else()
set(COPT_64_F -cpp)
set_source_files_properties(${F} PROPERTIES COMPILE_FLAGS "-cpp")
endif()
file(STRINGS ${F} ${F}.lst)
list(FILTER ${F}.lst INCLUDE REGEX "subroutine|SUBROUTINE|external|EXTERNAL|function|FUNCTION")
Expand All @@ -137,10 +137,10 @@ if(BUILD_INDEX64_EXT_API)
string(REGEX REPLACE "^[a-zA-Z0-9_ *]*(subroutine|SUBROUTINE|external|EXTERNAL|function|FUNCTION)[ ]*[*]?" "" FUNC ${FUNC})
string(REGEX REPLACE "[(][a-zA-Z0-9_, )]*$" "" FUNC ${FUNC})
string(STRIP ${FUNC} FUNC)
list(APPEND COPT_64_F "-D${FUNC}=${FUNC}_64")
list(APPEND COPT_64_F "${FUNC}=${FUNC}_64")
endforeach()
list(REMOVE_DUPLICATES COPT_64_F)
set_source_files_properties(${F} PROPERTIES COMPILE_OPTIONS "${COPT_64_F}")
set_source_files_properties(${F} PROPERTIES COMPILE_DEFINITIONS "${COPT_64_F}")
endforeach()
endif()

Expand Down

0 comments on commit ec2805b

Please sign in to comment.