diff --git a/vinca/templates/bld_ament_cmake.bat.in b/vinca/templates/bld_ament_cmake.bat.in index 182adc4..d1a8227 100644 --- a/vinca/templates/bld_ament_cmake.bat.in +++ b/vinca/templates/bld_ament_cmake.bat.in @@ -37,6 +37,8 @@ set "CMAKE_GENERATOR=Visual Studio %VS_MAJOR% %VS_YEAR%" :: The equivalent in bash is PYTHON_INSTALL_DIR=`python -c ...` FOR /F "tokens=* USEBACKQ" %%i IN (`python -c "import os;print(os.path.relpath(os.environ['SP_DIR'],os.environ['LIBRARY_PREFIX']).replace('\\','/'))"`) DO SET PYTHON_INSTALL_DIR=%%i +:: Name intermediate directories and object files by short hashes (CMake >= 4.2): long +:: package names otherwise push object paths past MSVC's 260 characters (error C1083). cmake ^ -G "%CMAKE_GENERATOR%" ^ -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ @@ -49,6 +51,7 @@ cmake ^ -DBUILD_SHARED_LIBS=ON ^ -DBUILD_TESTING=OFF ^ -DCMAKE_OBJECT_PATH_MAX=255 ^ + -DCMAKE_INTERMEDIATE_DIR_STRATEGY=SHORT ^ --compile-no-warning-as-error ^ -DPYTHON_INSTALL_DIR=%PYTHON_INSTALL_DIR% ^ @(additional_cmake_args) ^ diff --git a/vinca/templates/bld_catkin.bat.in b/vinca/templates/bld_catkin.bat.in index 20b865c..1f8c341 100644 --- a/vinca/templates/bld_catkin.bat.in +++ b/vinca/templates/bld_catkin.bat.in @@ -28,8 +28,11 @@ pushd build set SKIP_TESTING=@(skip_testing) +:: Name intermediate directories and object files by short hashes (CMake >= 4.2): long +:: package names otherwise push object paths past MSVC's 260 characters (error C1083). cmake ^ -G "Ninja" ^ + -DCMAKE_INTERMEDIATE_DIR_STRATEGY=SHORT ^ --compile-no-warning-as-error ^ -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ -DCMAKE_BUILD_TYPE=Release ^ diff --git a/vinca/templates/bld_colcon_merge.bat.in b/vinca/templates/bld_colcon_merge.bat.in index d62f4c4..54883e2 100644 --- a/vinca/templates/bld_colcon_merge.bat.in +++ b/vinca/templates/bld_colcon_merge.bat.in @@ -24,6 +24,7 @@ colcon build ^ --cmake-args ^ --compile-no-warning-as-error ^ -G Ninja ^ + -DCMAKE_INTERMEDIATE_DIR_STRATEGY=SHORT ^ -DCMAKE_BUILD_TYPE=Release ^ -DBUILD_TESTING=OFF ^ -DPYTHON_INSTALL_DIR=%PYTHON_INSTALL_DIR% ^