Skip to content

Commit

Permalink
Fix MSVC linking for assimp and fcl (#1510)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeongseok Lee <jslee02@users.noreply.github.com>
  • Loading branch information
traversaro and jslee02 committed Oct 17, 2020
1 parent cf69920 commit 2ed57ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions cmake/Findassimp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@ find_path(ASSIMP_INCLUDE_DIRS assimp/scene.h

# Libraries
if(MSVC)
set(ASSIMP_LIBRARIES "assimp$<$<CONFIG:Debug>:d>")
find_package(assimp QUIET CONFIG)
if(TARGET assimp::assimp)
set(ASSIMP_LIBRARIES "assimp::assimp")
endif()
else()
find_library(ASSIMP_LIBRARIES
NAMES assimp
HINTS ${PC_ASSIMP_LIBDIR})
endif()

# Version
set(ASSIMP_VERSION ${PC_ASSIMP_VERSION})
if(PC_ASSIMP_VERSION)
set(ASSIMP_VERSION ${PC_ASSIMP_VERSION})
endif()

# Set (NAME)_FOUND if all the variables and the version are satisfied.
include(FindPackageHandleStandardArgs)
Expand Down
9 changes: 7 additions & 2 deletions cmake/Findfcl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ find_path(FCL_INCLUDE_DIRS

# Libraries
if(MSVC)
set(FCL_LIBRARIES "fcl$<$<CONFIG:Debug>:d>")
find_package(fcl QUIET CONFIG)
if(TARGET fcl)
set(FCL_LIBRARIES fcl)
endif()
else()
# Give explicit precedence to ${PC_FCL_LIBDIR}
find_library(FCL_LIBRARIES
Expand All @@ -44,7 +47,9 @@ else()
endif()

# Version
set(FCL_VERSION ${PC_FCL_VERSION})
if(PC_FCL_VERSION)
set(FCL_VERSION ${PC_FCL_VERSION})
endif()

# Set (NAME)_FOUND if all the variables and the version are satisfied.
include(FindPackageHandleStandardArgs)
Expand Down

0 comments on commit 2ed57ec

Please sign in to comment.