-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable build with FBX SDK on macOS (#124)
Summary: - Update FindFbxSdk.cmake logic for macOS to properly find Iconv, creating FindIconv.cmake - Install FBX SDK 2020.3.7 on the macOS CI jobs - Update README about FBX support for macOS - [x] Adheres to the [style guidelines](https://facebookincubator.github.io/momentum/docs/developer_guide/style_guide) - [x] Codebase formatted by running `pixi run lint` Test Plan: **Local testing**: 1. Install FBX SDK for macOS from https://aps.autodesk.com/developer/overview/fbx-sdk 2. Run: ``` $ MOMENTUM_BUILD_IO_FBX=ON pixi run test_py ``` **CI**: Confirmed that the build passes with MOMENTUM_BUILD_IO_FBX: - momentum: https://github.com/facebookincubator/momentum/actions/runs/11646358777/job/32430353382#step:5:60 - pymomentum: https://github.com/facebookincubator/momentum/actions/runs/11646358777/job/32430353542#step:5:61 Differential Revision: D65391142 Pulled By: jeongseok-meta
- Loading branch information
1 parent
860837a
commit f1f1505
Showing
6 changed files
with
84 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,21 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install FBX SDK | ||
run: | | ||
curl -O https://damassets.autodesk.net/content/dam/autodesk/www/files/fbx202037_fbxsdk_clang_mac.pkg.tgz | ||
tar -xvf fbx202037_fbxsdk_clang_mac.pkg.tgz | ||
sudo installer -pkg fbx202037_fbxsdk_clang_macos.pkg -target / | ||
- name: Set up pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
cache: true | ||
|
||
- name: Build and test Momentum | ||
run: | | ||
pixi run test${{ matrix.mode }} | ||
MOMENTUM_BUILD_IO_FBX=ON \ | ||
pixi run test${{ matrix.mode }} | ||
- name: Install Momentum and Build hello_world | ||
run: | | ||
|
@@ -53,10 +60,19 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install FBX SDK | ||
run: | | ||
curl -O https://damassets.autodesk.net/content/dam/autodesk/www/files/fbx202037_fbxsdk_clang_mac.pkg.tgz | ||
tar -xvf fbx202037_fbxsdk_clang_mac.pkg.tgz | ||
sudo installer -pkg fbx202037_fbxsdk_clang_macos.pkg -target / | ||
- name: Set up pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
cache: true | ||
|
||
- name: Build and test PyMomentum | ||
run: | | ||
pixi run test_py | ||
MOMENTUM_BUILD_IO_FBX=ON \ | ||
pixi run test_py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# This module defines | ||
# Iconv_FOUND : Variable indicating if the iconv support was found. | ||
# Iconv_INCLUDE_DIRS: The directories containing the iconv headers. | ||
# Iconv_LIBRARIES : The iconv libraries to be linked. | ||
# Iconv::Iconv :IMPORTED target | ||
|
||
execute_process( | ||
COMMAND xcrun --sdk macosx --show-sdk-path | ||
OUTPUT_VARIABLE XCODE_SDK_PATH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
find_path( | ||
Iconv_INCLUDE_DIR "iconv.h" | ||
PATHS "${XCODE_SDK_PATH}/usr/include" | ||
PATH_SUFFIXES "include" | ||
) | ||
|
||
find_library(Iconv_LIBRARY NAMES iconv | ||
PATHS "${XCODE_SDK_PATH}/usr/lib" | ||
NO_DEFAULT_PATH | ||
) | ||
set(Iconv_LIBRARIES ${Iconv_LIBRARY}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Iconv | ||
FAIL_MESSAGE DEFAULT_MGS | ||
REQUIRED_VARS Iconv_INCLUDE_DIR Iconv_LIBRARIES | ||
) | ||
|
||
if(Iconv_FOUND) | ||
add_library(Iconv::Iconv INTERFACE IMPORTED) | ||
set_target_properties(Iconv::Iconv PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${Iconv_INCLUDE_DIR}" | ||
INTERFACE_LINK_LIBRARIES "${Iconv_LIBRARIES}" | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters