@@ -177,15 +177,17 @@ if (USE_THREAD)
177
177
target_link_libraries (${OpenBLAS_LIBNAME} ${CMAKE_THREAD_LIBS_INIT} )
178
178
endif ()
179
179
180
- if (NOT MSVC AND NOT NOFORTRAN )
180
+ if (MSVC OR NOT NOFORTRAN )
181
+ # Broken without fortran on unix
181
182
add_subdirectory (utest )
183
+ endif ()
184
+
185
+ if (NOT MSVC AND NOT NOFORTRAN )
182
186
# Build test and ctest
183
187
add_subdirectory (test )
184
188
if (NOT NO_CBLAS )
185
189
add_subdirectory (ctest )
186
190
endif ()
187
- elseif (MSVC )
188
- add_subdirectory (utest )
189
191
endif ()
190
192
191
193
set_target_properties (${OpenBLAS_LIBNAME} PROPERTIES
@@ -201,31 +203,33 @@ install(TARGETS ${OpenBLAS_LIBNAME}
201
203
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
202
204
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
203
205
204
- set (OPENBLAS_TMP ${CMAKE_BINARY_DIR} /openblas_config.tmp )
205
- file (WRITE ${OPENBLAS_TMP} "#ifndef OPENBLAS_CONFIG_H\n " )
206
- file (APPEND ${OPENBLAS_TMP} "#define OPENBLAS_CONFIG_H\n " )
206
+ message (STATUS "Generating openblas_config.h in ${CMAKE_INSTALL_INCLUDEDIR} " )
207
+
208
+ set (OPENBLAS_CONFIG_H ${CMAKE_BINARY_DIR} /openblas_config.h )
209
+ file (WRITE ${OPENBLAS_CONFIG_H} "#ifndef OPENBLAS_CONFIG_H\n " )
210
+ file (APPEND ${OPENBLAS_CONFIG_H} "#define OPENBLAS_CONFIG_H\n " )
207
211
file (STRINGS ${PROJECT_BINARY_DIR} /config.h __lines )
208
212
foreach (line ${__lines} )
209
213
string (REPLACE "#define " "" line ${line} )
210
- file (APPEND ${OPENBLAS_TMP } "#define OPENBLAS_${line} \n " )
214
+ file (APPEND ${OPENBLAS_CONFIG_H } "#define OPENBLAS_${line} \n " )
211
215
endforeach ()
212
- file (APPEND ${OPENBLAS_TMP} "#define OPENBLAS_VERSION \" OpenBLAS ${OpenBLAS_VERSION} \"\n " )
213
- file (READ ${CMAKE_CURRENT_SOURCE_DIR} /openblas_config_template.h __template )
214
- file (APPEND ${OPENBLAS_TMP} "${__template} " )
215
- file (APPEND ${OPENBLAS_TMP} "#endif /* OPENBLAS_CONFIG_H */\n " )
216
- configure_file (${OPENBLAS_TMP} ${CMAKE_BINARY_DIR} /openblas_config.h COPYONLY )
217
-
218
- install (FILES ${CMAKE_BINARY_DIR} /openblas_config.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
216
+ file (APPEND ${OPENBLAS_CONFIG_H} "#define OPENBLAS_VERSION \" OpenBLAS ${OpenBLAS_VERSION} \"\n " )
217
+ file (READ ${CMAKE_CURRENT_SOURCE_DIR} /openblas_config_template.h OPENBLAS_CONFIG_TEMPLATE_H_CONTENTS )
218
+ file (APPEND ${OPENBLAS_CONFIG_H} "${OPENBLAS_CONFIG_TEMPLATE_H_CONTENTS} \n " )
219
+ file (APPEND ${OPENBLAS_CONFIG_H} "#endif /* OPENBLAS_CONFIG_H */\n " )
220
+ install (FILES ${OPENBLAS_CONFIG_H} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
219
221
220
222
if (NOT NOFORTRAN )
221
223
message (STATUS "Generating f77blas.h in ${CMAKE_INSTALL_INCLUDEDIR} " )
222
224
223
- file (WRITE ${CMAKE_BINARY_DIR} /f77blas.h "" )
224
- file (APPEND ${CMAKE_BINARY_DIR} /f77blas.h "#ifndef OPENBLAS_F77BLAS_H\n #define OPENBLAS_F77BLAS_H\n #include \" openblas_config.h\"\n " )
225
+ set (F77BLAS_H ${CMAKE_BINARY_DIR} /f77blas.h )
226
+ file (WRITE ${F77BLAS_H} "#ifndef OPENBLAS_F77BLAS_H\n " )
227
+ file (APPEND ${F77BLAS_H} "#define OPENBLAS_F77BLAS_H\n " )
228
+ file (APPEND ${F77BLAS_H} "#include \" openblas_config.h\"\n " )
225
229
file (READ ${CMAKE_CURRENT_SOURCE_DIR} /common_interface.h COMMON_INTERFACE_H_CONTENTS )
226
- file (APPEND ${CMAKE_BINARY_DIR} /f77blas.h "${COMMON_INTERFACE_H_CONTENTS} " )
227
- file (APPEND ${CMAKE_BINARY_DIR} /f77blas.h "#endif" )
228
- install (FILES ${CMAKE_BINARY_DIR} /f77blas.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
230
+ file (APPEND ${F77BLAS_H} "${COMMON_INTERFACE_H_CONTENTS} \n " )
231
+ file (APPEND ${F77BLAS_H} "#endif" )
232
+ install (FILES ${F77BLAS_H} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
229
233
endif ()
230
234
231
235
if (NOT NO_CBLAS )
0 commit comments