Skip to content

Commit ec2805b

Browse files
CMake: restore compatibility with v3.10 and older
The COMPILE_OPTIONS property exists only from CMake 3.11 onwards. fixes #975
1 parent db501d9 commit ec2805b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

BLAS/SRC/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ if(BUILD_INDEX64_EXT_API)
124124
#Add _64 suffix to all Fortran functions via macros
125125
foreach(F IN LISTS SOURCES_64_F)
126126
if(CMAKE_Fortran_COMPILER_ID STREQUAL "NAG")
127-
set(COPT_64_F -fpp)
127+
set_source_files_properties(${F} PROPERTIES COMPILE_FLAGS "-fpp")
128128
else()
129-
set(COPT_64_F -cpp)
129+
set_source_files_properties(${F} PROPERTIES COMPILE_FLAGS "-cpp")
130130
endif()
131131
file(STRINGS ${F} ${F}.lst)
132132
list(FILTER ${F}.lst INCLUDE REGEX "subroutine|SUBROUTINE|external|EXTERNAL|function|FUNCTION")
@@ -137,10 +137,10 @@ if(BUILD_INDEX64_EXT_API)
137137
string(REGEX REPLACE "^[a-zA-Z0-9_ *]*(subroutine|SUBROUTINE|external|EXTERNAL|function|FUNCTION)[ ]*[*]?" "" FUNC ${FUNC})
138138
string(REGEX REPLACE "[(][a-zA-Z0-9_, )]*$" "" FUNC ${FUNC})
139139
string(STRIP ${FUNC} FUNC)
140-
list(APPEND COPT_64_F "-D${FUNC}=${FUNC}_64")
140+
list(APPEND COPT_64_F "${FUNC}=${FUNC}_64")
141141
endforeach()
142142
list(REMOVE_DUPLICATES COPT_64_F)
143-
set_source_files_properties(${F} PROPERTIES COMPILE_OPTIONS "${COPT_64_F}")
143+
set_source_files_properties(${F} PROPERTIES COMPILE_DEFINITIONS "${COPT_64_F}")
144144
endforeach()
145145
endif()
146146

0 commit comments

Comments
 (0)