aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Chang <twmr7@outlook.com>2017-07-08 23:03:07 +0800
committerJames Chang <twmr7@outlook.com>2017-07-08 23:03:07 +0800
commit8d011eee976962a460bd8ed361ae8cc1b339651e (patch)
treea386ad374ee4cf7f2326db43da5ed14cb8d32e3e
parent17df9be71f23f2e5ac1c792f7220065ff940fc42 (diff)
downloadvcpkg-8d011eee976962a460bd8ed361ae8cc1b339651e.tar.gz
vcpkg-8d011eee976962a460bd8ed361ae8cc1b339651e.zip
[eigen3] fix the missing CMakeLists.txt problem and copy additional Eigen directory to include
-rw-r--r--ports/eigen3/CONTROL2
-rw-r--r--ports/eigen3/portfile.cmake14
2 files changed, 15 insertions, 1 deletions
diff --git a/ports/eigen3/CONTROL b/ports/eigen3/CONTROL
index 4dd1cd983..d93fc145a 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 ba968950a..219abadfa 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)