vcpkg/ports/hypre/fix-root-cmakelists.patch

60 lines
1.8 KiB
Diff
Raw Normal View History

2017-08-08 23:45:09 +08:00
--- a/CMakeLists.txt Mon Mar 13 21:37:24 2017
+++ b/CMakeLists.txt Sun Aug 06 19:34:00 2017
2017-05-16 17:00:05 +08:00
@@ -1,6 +1,8 @@
cmake_minimum_required (VERSION 2.8.8)
project (hypre)
+include(GenerateExportHeader)
+
# The version number.
2017-08-08 23:45:09 +08:00
set (HYPRE_VERSION 2.11.2)
set (HYPRE_DATE 2017/03/13)
@@ -618,6 +620,8 @@
2017-05-16 17:00:05 +08:00
struct_ls/sparse_msg_solve.c
)
+set_source_files_properties(struct_ls/pfmg3_setup_rap.c PROPERTIES LANGUAGE CXX)
+
# Headers and sources: sstruct_mv
list (APPEND HYPRE_HEADERS
sstruct_mv/HYPRE_sstruct_mv.h
2017-08-08 23:45:09 +08:00
@@ -758,11 +762,11 @@
2017-05-16 17:00:05 +08:00
find_package (MPI)
if ((MPI_C_FOUND) AND (NOT CMAKE_C_COMPILER STREQUAL MPI_C_COMPILER))
include_directories (${MPI_C_INCLUDE_PATH})
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_C_COMPILE_FLAGS}")
+ #set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_C_COMPILE_FLAGS}")
endif ()
if ((MPI_CXX_FOUND) AND (NOT CMAKE_CXX_COMPILER STREQUAL MPI_CXX_COMPILER))
include_directories (${MPI_CXX_INCLUDE_PATH})
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}")
+ #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}")
endif ()
endif (NOT HYPRE_SEQUENTIAL)
2017-08-08 23:45:09 +08:00
@@ -807,7 +811,23 @@
2017-05-16 17:00:05 +08:00
add_library (HYPRE ${HYPRE_SOURCES} ${FEI_LIBS})
2017-08-08 23:45:09 +08:00
2017-05-16 17:00:05 +08:00
-install (TARGETS HYPRE DESTINATION lib)
2017-08-08 23:45:09 +08:00
+if (NOT HYPRE_SEQUENTIAL)
+ target_link_libraries(HYPRE ${MPI_C_LIBRARIES})
+endif()
+
+if (WIN32 AND BUILD_SHARED_LIBS)
2017-05-16 17:00:05 +08:00
+ set_target_properties(HYPRE PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
+endif()
+
+generate_export_header(HYPRE EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/_hypre_export.h)
+list(APPEND HYPRE_HEADERS ${CMAKE_BINARY_DIR}/_hypre_export.h)
+
+install (TARGETS HYPRE
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
2017-08-08 23:45:09 +08:00
+
2017-05-16 17:00:05 +08:00
install (FILES ${HYPRE_HEADERS} DESTINATION include)
# add_subdirectory (test EXCLUDE_FROM_ALL)