@@ -98,33 +98,47 @@ install(
9898
9999include (FetchContent)
100100
101- # Find NodeJS and Yarn
102- find_program (NODEJS_EXECUTABLE node)
103- if (NOT NODEJS_EXECUTABLE)
104- message (FATAL_ERROR "NodeJS not found. Please install NodeJS to build foxsight." )
105- endif ()
106-
107- find_program (YARN_EXECUTABLE yarn)
108- if (NOT YARN_EXECUTABLE)
109- message (FATAL_ERROR "Yarn not found. Please install Yarn to build foxsight." )
110- endif ()
111-
112101# Fetch the foxsight project
113102FetchContent_Declare(
114103 foxsight
115104 GIT_REPOSITORY https://github.com/nvidia-isaac/lichtblick
116105 GIT_TAG main_internal
106+ GIT_SHALLOW TRUE
117107)
118108
119109FetchContent_MakeAvailable(foxsight)
120110
121111# Define the path to the foxsight directory
122112set (FOXSIGHT_DIR ${foxsight_SOURCE_DIR} )
123113
114+ # ---------------------------------------------------------------------------
115+ # Yarn / NodeJS — use vendored Yarn 3.6.3 if present
116+ # ---------------------------------------------------------------------------
117+
118+ # Find NodeJS and Yarn
119+ find_program (NODEJS_EXECUTABLE node)
120+ if (NOT NODEJS_EXECUTABLE)
121+ message (FATAL_ERROR "NodeJS not found. Please install NodeJS to build foxsight." )
122+ endif ()
123+
124+ # Absolute path to the Yarn binary you committed in foxsight/main_internal
125+ set (FOXSIGHT_VENDORED_YARN
126+ "${foxsight_SOURCE_DIR} /.yarn/releases/yarn-3.6.3.cjs" )
127+
128+ # Decide which command to invoke during the build
129+ if (EXISTS "${FOXSIGHT_VENDORED_YARN} " )
130+ # Use the vendored copy through "node <file>"
131+ set (YARN_COMMAND ${NODEJS_EXECUTABLE} "${FOXSIGHT_VENDORED_YARN} " )
132+ else ()
133+ # Fallback to a system-wide yarn (keeps previous behaviour)
134+ find_program (YARN_EXECUTABLE yarn REQUIRED)
135+ set (YARN_COMMAND ${YARN_EXECUTABLE} )
136+ endif ()
137+
124138# Add custom target to build foxsight
125139add_custom_target (build_foxsight ALL
126- COMMAND ${YARN_EXECUTABLE } install
127- COMMAND ${YARN_EXECUTABLE } run web:build :prod >> foxsight_install.log 2>&1
140+ COMMAND env YARN_CHECKSUM_BEHAVIOR=update PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 ELECTRON_SKIP_BINARY_DOWNLOAD=1 ${YARN_COMMAND } install
141+ COMMAND ${YARN_COMMAND } run web:build :prod >> foxsight_install.log 2>&1
128142 WORKING_DIRECTORY ${FOXSIGHT_DIR}
129143 COMMENT "Building foxsight using FetchContent"
130144)
0 commit comments