Skip to content

Commit

Permalink
[assimp] Fix release/debug library issue. Fixes microsoft#4026.
Browse files Browse the repository at this point in the history
  • Loading branch information
ras0219-msft committed Aug 8, 2018
1 parent 1cb142d commit dbef253
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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.1.0-1
Version: 4.1.0-2
Description: The Open Asset import library
Build-Depends: zlib
14 changes: 11 additions & 3 deletions ports/assimp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ vcpkg_apply_patches(
)

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

set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")

Expand All @@ -26,6 +28,14 @@ vcpkg_configure_cmake(
-DASSIMP_BUILD_ZLIB=OFF
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF
-DASSIMP_INSTALL_PDB=OFF
-DZLIB_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include
-DZLIB_FOUND=1
OPTIONS_RELEASE
-DZLIB_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/zlib.lib
-DZLIB_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/zlib.lib
OPTIONS_DEBUG
-DZLIB_LIBRARIES=${CURRENT_INSTALLED_DIR}/debug/lib/zlibd.lib
-DZLIB_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/zlibd.lib
)

vcpkg_install_cmake()
Expand All @@ -40,10 +50,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(READ ${CURRENT_PACKAGES_DIR}/share/assimp/assimp-config.cmake ASSIMP_CONFIG)
string(REPLACE "get_filename_component(ASSIMP_ROOT_DIR \"\${_PREFIX}\" PATH)"
"set(ASSIMP_ROOT_DIR \${_PREFIX})" ASSIMP_CONFIG ${ASSIMP_CONFIG})
string(REPLACE "assimp\${ASSIMP_LIBRARY_SUFFIX}"
"assimp\${ASSIMP_LIBRARY_SUFFIX}.lib" ASSIMP_CONFIG ${ASSIMP_CONFIG})
string(REPLACE "set( ASSIMP_LIBRARIES \${ASSIMP_LIBRARIES})"
"set( ASSIMP_LIBRARIES \${ASSIMP_LIBRARY_DIRS}/\${ASSIMP_LIBRARIES})" ASSIMP_CONFIG ${ASSIMP_CONFIG})
"set( ASSIMP_LIBRARIES optimized \${ASSIMP_LIBRARY_DIRS}/\${ASSIMP_LIBRARIES}.lib debug \${ASSIMP_LIBRARY_DIRS}/../debug/lib/\${ASSIMP_LIBRARIES}d.lib)" ASSIMP_CONFIG ${ASSIMP_CONFIG})
file(WRITE ${CURRENT_PACKAGES_DIR}/share/assimp/assimp-config.cmake "${ASSIMP_CONFIG}")

# Handle copyright
Expand Down

0 comments on commit dbef253

Please sign in to comment.