@@ -199,18 +199,21 @@ set_target_properties(${OpenBLAS_LIBNAME} PROPERTIES
199
199
install (TARGETS ${OpenBLAS_LIBNAME}
200
200
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
201
201
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
202
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
203
-
204
- # Install include files
205
- set (GENCONFIG_BIN ${CMAKE_BINARY_DIR} /gen_config_h${CMAKE_EXECUTABLE_SUFFIX} )
206
-
207
- execute_process (COMMAND ${GENCONFIG_BIN}
208
- ${CMAKE_CURRENT_SOURCE_DIR} /config.h
209
- ${CMAKE_CURRENT_SOURCE_DIR} /openblas_config_template.h
210
- OUTPUT_VARIABLE OPENBLAS_CONFIG_H_CONTENTS )
211
-
212
- file (WRITE ${CMAKE_BINARY_DIR} /openblas_config.tmp "${OPENBLAS_CONFIG_H_CONTENTS} " )
213
- configure_file (${CMAKE_BINARY_DIR} /openblas_config.tmp ${CMAKE_BINARY_DIR} /openblas_config.h COPYONLY )
202
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
203
+
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 " )
207
+ file (STRINGS ${PROJECT_BINARY_DIR} /config.h __lines )
208
+ foreach (line ${__lines} )
209
+ string (REPLACE "#define " "" line ${line} )
210
+ file (APPEND ${OPENBLAS_TMP} "#define OPENBLAS_${line} \n " )
211
+ 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 )
214
217
215
218
install (FILES ${CMAKE_BINARY_DIR} /openblas_config.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
216
219
0 commit comments