Skip to content

Commit

Permalink
fix compiling error
Browse files Browse the repository at this point in the history
  • Loading branch information
minggo committed Nov 28, 2024
1 parent 3a59aba commit 869008c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
20 changes: 0 additions & 20 deletions CI/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,6 @@ installFbxSdk() {
echo "FBX SDK MacOS pkg: $fbxSdkMacOSPkgFile"
sudo installer -pkg "$fbxSdkMacOSPkgFile" -target /
ln -s "/Applications/Autodesk/FBX SDK/$fbxSdkVersion" fbxsdk/Home
elif [ "$IsLinux" = true ]; then
fbxSdkUrl='https://www.autodesk.com/content/dam/autodesk/www/adn/fbx/2020-2-1/fbx202021_fbxsdk_linux.tar.gz'
fbxSdkTarball=fbxsdk/fbxsdk.tar.gz

echo "Downloading FBX SDK tar ball from $fbxSdkUrl ..."
downloadFile "$fbxSdkUrl" "$fbxSdkTarball"
tar -zxvf "$fbxSdkTarball" -C fbxsdk

fbxSdkInstallationProgram=fbxsdk/fbx202021_fbxsdk_linux
chmod ugo+x "$fbxSdkInstallationProgram"

fbxSdkHomeLocation="$HOME/fbxsdk/install"
echo "Installing from $fbxSdkInstallationProgram..."
mkdir -p "$fbxSdkHomeLocation"

# This is really a HACK way after many tries...
yes yes | "$fbxSdkInstallationProgram" "$fbxSdkHomeLocation"
echo ''

echo "Installation finished($fbxSdkHomeLocation)."
else
echo 'FBXSDK is not available on target platform.'
exit 1
Expand Down
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,26 @@ set (FBXSDK_INCLUDE_DIR "${FbxSdkHome}/include")
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if (EXISTS "${FbxSdkHome}/lib/vs2022")
set (FBXSDK_LIBRARY "${FbxSdkHome}/lib/vs2022/x64/${FbxSdkConfiguration}/libfbxsdk.lib")
set (FbxSdkDynLibraries "${FbxSdkHome}/lib/vs2022/x64/${FbxSdkConfiguration}/libfbxsdk.dll")
elseif (EXISTS "${FbxSdkHome}/lib/vs2019")
set (FBXSDK_LIBRARY "${FbxSdkHome}/lib/vs2019/x64/${FbxSdkConfiguration}/libfbxsdk.lib")
set (FbxSdkDynLibraries "${FbxSdkHome}/lib/vs2019/x64/${FbxSdkConfiguration}/libfbxsdk.dll")
else ()
set (FbxSdkLibraries "${FbxSdkHome}/lib/vs2017/x64/${FbxSdkConfiguration}/libfbxsdk.lib")
set (FbxSdkDynLibraries "${FbxSdkHome}/lib/vs2017/x64/${FbxSdkConfiguration}/libfbxsdk.dll")
endif ()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set (FBXSDK_LIBRARY "${FbxSdkHome}/lib/clang/${FbxSdkConfiguration}/libfbxsdk.a")
set (FbxSdkDynLibraries "${FbxSdkHome}/lib/clang/${FbxSdkConfiguration}/libfbxsdk.dylib")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (FBXSDK_LIBRARY "${FbxSdkHome}/lib/gcc/x64/${FbxSdkConfiguration}/libfbxsdk.a")
set (FbxSdkDynLibraries "${FbxSdkHome}/lib/gcc/x64/${FbxSdkConfiguration}/libfbxsdk.so")
else ()
message (FATAL_ERROR "Can not decide FBX SDK library to use cause of unknown C++ compiler ID: ${CMAKE_CXX_COMPILER_ID}")
endif ()
message (STATUS "FBX SDK include directories: ${FBXSDK_INCLUDE_DIR}")
message (STATUS "FBX SDK libraries: ${FBXSDK_LIBRARY}")
message (STATUS "FBX SDK dynamic libraries: ${FbxSdkDynLibraries}")

# DRACO
ExternalProject_Add(Draco
Expand Down Expand Up @@ -237,3 +242,10 @@ target_include_directories(appFBX2glTF PUBLIC
"third_party/CLI11"
)
target_link_libraries(appFBX2glTF libFBX2glTF)

install (TARGETS appFBX2glTF DESTINATION "bin")
install (FILES $<TARGET_LINKER_FILE:appFBX2glTF> DESTINATION "lib" OPTIONAL)
if (CMAKE_BUILD_TYPE EQUAL "DEBUG")
install (FILES $<TARGET_PDB_FILE:appFBX2glTF> DESTINATION "bin" OPTIONAL)
endif()
install (FILES ${FbxSdkDynLibraries} DESTINATION "bin")

0 comments on commit 869008c

Please sign in to comment.