From 8d011eee976962a460bd8ed361ae8cc1b339651e Mon Sep 17 00:00:00 2001 From: James Chang Date: Sat, 8 Jul 2017 23:03:07 +0800 Subject: [PATCH] [eigen3] fix the missing CMakeLists.txt problem and copy additional Eigen directory to include --- ports/eigen3/CONTROL | 2 +- ports/eigen3/portfile.cmake | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ports/eigen3/CONTROL b/ports/eigen3/CONTROL index 4dd1cd983c..d93fc145a8 100644 --- a/ports/eigen3/CONTROL +++ b/ports/eigen3/CONTROL @@ -1,3 +1,3 @@ Source: eigen3 -Version: 3.3.3-3 +Version: 3.3.3-4 Description: C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. diff --git a/ports/eigen3/portfile.cmake b/ports/eigen3/portfile.cmake index ba968950a6..219abadfaf 100644 --- a/ports/eigen3/portfile.cmake +++ b/ports/eigen3/portfile.cmake @@ -6,7 +6,14 @@ vcpkg_download_distfile(ARCHIVE FILENAME "eigen-3.3.3.tar.bz2" SHA512 bb5a8b761371e516f0a344a7c9f6e369e21c2907c8548227933ca6010fc607a66c8d6ff7c41b1aec3dea7d482ce8c2a09e38ae5c7a2c5b16bdd8007e7a81ecc3 ) + vcpkg_extract_source_archive(${ARCHIVE}) +# check if required file exists +if((NOT EXISTS ${SOURCE_PATH}/Eigen/CMakeLists.txt) OR (NOT EXISTS ${SOURCE_PATH}/unsupported/Eigen/CMakeLists.txt)) + message(STATUS "Missing CMakeLists.txt in cache, remove ${CURRENT_BUILDTREES_DIR} and try again.") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}) + vcpkg_extract_source_archive(${ARCHIVE}) +endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -25,6 +32,13 @@ file(READ "${CURRENT_PACKAGES_DIR}/share/eigen3/Eigen3Targets.cmake" EIGEN_TARGE string(REPLACE "set(_IMPORT_PREFIX " "get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}/../..\" ABSOLUTE) #" EIGEN_TARGETS "${EIGEN_TARGETS}") file(WRITE "${CURRENT_PACKAGES_DIR}/share/eigen3/Eigen3Targets.cmake" "${EIGEN_TARGETS}") +# Copy the eigen header files to conventional location for user-wide MSBuild integration +file(COPY ${SOURCE_PATH}/Eigen DESTINATION ${CURRENT_PACKAGES_DIR}/include) +# and no need to leave CMakeLists.txt there +if(EXISTS ${CURRENT_PACKAGES_DIR}/include/Eigen/CMakeLists.txt) + file(REMOVE ${CURRENT_PACKAGES_DIR}/include/Eigen/CMakeLists.txt) +endif() + # Put the licence file where vcpkg expects it file(COPY ${SOURCE_PATH}/COPYING.README DESTINATION ${CURRENT_PACKAGES_DIR}/share/eigen3) file(RENAME ${CURRENT_PACKAGES_DIR}/share/eigen3/COPYING.README ${CURRENT_PACKAGES_DIR}/share/eigen3/copyright)