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 869008c commit 7eb0dd2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CI/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ runCMake() {
-S. -B"${cmakeBuildDir}"
else
cmake -DCMAKE_TOOLCHAIN_FILE="vcpkg/scripts/buildsystems/vcpkg.cmake" \
-DCMAKE_PREFIX_PATH="./vcpkg/installed/x64-windows-static" \
-DVCPKG_TARGET_TRIPLET="x64-windows-static" \
-DCMAKE_BUILD_TYPE=$"{buildType}" \
-DCMAKE_INSTALL_PREFIX="${cmakeInstallPrefix}/${buildType}" \
-DFbxSdkHome:STRING="${fbxSdkHome}" \
Expand Down
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,21 @@ message (STATUS "CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
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")
set (FBXSDK_LIBRARY "${FbxSdkHome}/lib/vs2022/x64/${FbxSdkConfiguration}/libfbxsdk-mt.lib")
elseif (EXISTS "${FbxSdkHome}/lib/vs2019")
set (FBXSDK_LIBRARY "${FbxSdkHome}/lib/vs2019/x64/${FbxSdkConfiguration}/libfbxsdk.lib")
set (FbxSdkDynLibraries "${FbxSdkHome}/lib/vs2019/x64/${FbxSdkConfiguration}/libfbxsdk.dll")
set (FBXSDK_LIBRARY "${FbxSdkHome}/lib/vs2019/x64/${FbxSdkConfiguration}/libfbxsdk-mt.lib")
else ()
set (FbxSdkLibraries "${FbxSdkHome}/lib/vs2017/x64/${FbxSdkConfiguration}/libfbxsdk.lib")
set (FbxSdkDynLibraries "${FbxSdkHome}/lib/vs2017/x64/${FbxSdkConfiguration}/libfbxsdk.dll")
set (FbxSdkLibraries "${FbxSdkHome}/lib/vs2017/x64/${FbxSdkConfiguration}/libfbxsdk-mt.lib")
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 @@ -243,9 +237,15 @@ target_include_directories(appFBX2glTF PUBLIC
)
target_link_libraries(appFBX2glTF libFBX2glTF)

install (TARGETS appFBX2glTF DESTINATION "bin")
install (FILES $<TARGET_LINKER_FILE:appFBX2glTF> DESTINATION "lib" OPTIONAL)
if(MSVC)
set_target_properties(libFBX2glTF PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(appFBX2glTF PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

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

install (TARGETS appFBX2glTF DESTINATION "bin")

0 comments on commit 7eb0dd2

Please sign in to comment.