Skip to content

Commit

Permalink
[suitesparse] Porfile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KindDragon committed Jul 10, 2017
1 parent 88fdd8d commit 83e3a29
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion ports/suitesparse/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: suitesparse
Version: 4.5.5-1
Version: 4.5.5-2
Build-Depends: metis, clapack
Description: algebra library
22 changes: 2 additions & 20 deletions ports/suitesparse/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ vcpkg_extract_source_archive(${SUITESPARSE} ${SUITESPARSEWIN_PATH})
vcpkg_apply_patches(
SOURCE_PATH ${SUITESPARSEWIN_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-install-suitesparse.patch"
PATCHES "${CMAKE_CURRENT_LIST_DIR}/remove-debug-postfix.patch"
)

vcpkg_configure_cmake(
Expand All @@ -63,11 +64,7 @@ vcpkg_configure_cmake(

vcpkg_install_cmake()

file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/suitesparse/)

file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/SuiteSparse-config.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config.cmake)
file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/SuiteSparse-config-release.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-release.cmake)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/cmake/SuiteSparse-config-debug.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-debug.cmake)
vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake")

file(RENAME ${CURRENT_PACKAGES_DIR}/UseSuiteSparse.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/UseSuiteSparse.cmake)
file(RENAME ${CURRENT_PACKAGES_DIR}/SuiteSparseConfig.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake)
Expand All @@ -77,24 +74,9 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/SuiteSparseConfig.cmake)
# Update paths in SuiteSparseConfig.cmake
file(READ ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake _contents)
string(REPLACE "set(SuiteSparse_LIB_POSTFIX \"64\")" "set(SuiteSparse_LIB_POSTFIX \"\")" _contents "${_contents}")
string(REPLACE "\#\# do nothing, it's OK" "include(${USE_SuiteSparse})" _contents "${_contents}")

file(WRITE ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake "${_contents}")

# Update paths in SuiteSparse-config.cmake
file(READ ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config.cmake _contents)
string(REPLACE "get_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)"
"get_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)" _contents "${_contents}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config.cmake "${_contents}")

# Update paths in SuiteSparse-config-debug.cmake
file(READ ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-debug.cmake _contents)
string(REPLACE "\${_IMPORT_PREFIX}/lib/" "\${_IMPORT_PREFIX}/debug/lib/" _contents "${_contents}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-debug.cmake "${_contents}")

#clean folders
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# Handle copyright of suitesparse and suitesparse-metis-for-windows
Expand Down
11 changes: 11 additions & 0 deletions ports/suitesparse/remove-debug-postfix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- CMakeLists.txt Mon Feb 22 22:18:25 2016
+++ CMakeLists.txt Wed Jul 05 14:14:21 2017
@@ -35,7 +35,7 @@

# We want libraries to be named "libXXX" and "libXXXd" in all compilers:
# ------------------------------------------------------------------------
-set(CMAKE_DEBUG_POSTFIX "d")
+#set(CMAKE_DEBUG_POSTFIX "d")
IF(MSVC)
set(SP_LIB_PREFIX "lib") # Libs are: "libXXX"
ENDIF(MSVC)

0 comments on commit 83e3a29

Please sign in to comment.