Skip to content

Commit

Permalink
[assimp] Fix assimp overwriting CMAKE_PREFIX_PATH.
Browse files Browse the repository at this point in the history
  • Loading branch information
ras0219-msft committed Nov 1, 2017
1 parent 7435624 commit 0a4b09d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ports/assimp/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: assimp
Version: 4.0.1-1
Version: 4.0.1-2
Description: The Open Asset import library
Build-Depends: zlib
12 changes: 12 additions & 0 deletions ports/assimp/dont-overwrite-prefix-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d781d1f..0d64d50 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,7 +92,6 @@ if (WIN32)
endif()

IF(MSVC)
- set (CMAKE_PREFIX_PATH "D:\\libs\\devil")
OPTION( ASSIMP_INSTALL_PDB
"Install MSVC debug files."
ON
19 changes: 10 additions & 9 deletions ports/assimp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ vcpkg_from_github(

vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/const-compare-worditerator.patch
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/const-compare-worditerator.patch"
"${CMAKE_CURRENT_LIST_DIR}/dont-overwrite-prefix-path.patch"
)

file(REMOVE ${SOURCE_PATH}/cmake-modules/FindZLIB.cmake)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS -DASSIMP_BUILD_TESTS=False
-DASSIMP_BUILD_ASSIMP_VIEW=False
-DASSIMP_BUILD_ZLIB=False
-DASSIMP_BUILD_ASSIMP_TOOLS=False
-DASSIMP_INSTALL_PDB=False
-DZLIB_HOME=${CURRENT_INSTALLED_DIR}
OPTIONS -DASSIMP_BUILD_TESTS=OFF
-DASSIMP_BUILD_ASSIMP_VIEW=OFF
-DASSIMP_BUILD_ZLIB=OFF
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF
-DASSIMP_INSTALL_PDB=OFF
)

vcpkg_install_cmake()
Expand All @@ -30,8 +33,6 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/assimp-4.0")
vcpkg_copy_pdbs()

file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

file(READ ${CURRENT_PACKAGES_DIR}/share/assimp/assimp-config.cmake ASSIMP_CONFIG)
Expand Down

0 comments on commit 0a4b09d

Please sign in to comment.