[ITK Community] "The input line is too long" error when using ITK
Dan Mueller
dan.muel at gmail.com
Mon Dec 2 23:51:59 EST 2013
Hi,
I am encountering "The input line is too long" error when using ITK in
my own application.
My CMakeLists.txt finds and uses ITK as follows:
# Use ITK
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
Helper macros in CMake\ITKModuleAPI.cmake recurse the included modules
(currently I include all modules, the ITK default position), adding a
bunch of directories to the variable ITK_INCLUDE_DIRS, which are then
added to INCLUDE_DIRECTORIES by CMake\UseITK.cmake.
My own application then finds SWIG, and calls SWIG_ADD_MODULE and
SWIG_LINK_LIBRARIES. This results in a really long build command
(10791 characters long) in build.make (see truncation below):
Native/service/swig/MyAppCSHARP_wrap.cxx: ../Native/service/swig/MyApp.i
$(CMAKE_COMMAND) -E cmake_progress_report
C:\Work\Source\MyApp\Build\CMakeFiles $(CMAKE_PROGRESS_1)
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold
"Swig source"
cd /d C:\Work\Source\MyApp\Build\Native\service && "C:\Program
Files\CMake 2.8\bin\cmake.exe" -E make_directory
C:/Work/Source/MyApp/Build/Native/service
cd /d C:\Work\Source\MyApp\Build\Native\service &&
C:\Utils\swigwin-2.0.11\swig.exe -csharp -namespace "name.app.next"
-dllimport "libMyAppNative" -outdir
C:/Work/Source/MyApp/Build/Native/service -c++
-IC:/Work/Source/MyApp/Build/Native/ITKIOFactoryRegistration
-IC:/InsightToolkit-4.4.2/Modules/Video/IO/include
-IC:/InsightToolkit-4.4.2/Modules/Video/Filtering/include
-IC:/InsightToolkit-4.4.2/Modules/Video/Core/include
<TRUNCATED LOTS OF ITK INCLUDE DIRECTORIES>
-IC:/InsightToolkit-4.4.2/Modules/ThirdParty/DoubleConversion/src/double-conversion
-IC:/Work/Source/MyApp/Native/external/gtest-1.7.0
-IC:/Work/Source/MyApp/Native/external/gtest-1.7.0/include
-IC:/Utils/MinGW/boost32/include/boost-1_55
-IC:/Work/Source/MyApp/Native
-IC:/Work/Source/MyApp/Native/service/include
-IC:/Work/Source/MyApp/Native/service/src
-IC:/Work/Source/MyApp/Native/util/include
-IC:/Work/Source/MyApp/Native/frame/include
-IC:/Work/Source/MyApp/Native/app-IC:/Work/Source/MyApp/Native/app/includes
-IC:/Work/Source/MyApp/Native/app/name/codegearglue
-IC:/Work/Source/MyApp/Build/Native/app"-IC:/Program
Files/PostgreSQL/9.3/include" "-IC:/Program
Files/PostgreSQL/9.3/include/server" -o
C:/Work/Source/MyApp/Build/Native/service/swig/MyAppCSHARP_wrap.cxx
C:/Work/Source/MyApp/Native/service/swig/MyApp.i
This really long line (the bulk of which are the ITK include
directories) causes the following error:
[ 40%] Swig source
The input line is too long.
Native\service\CMakeFiles\MyAppNative.dir\build.make:75: recipe for
target 'Native/service/swig/MyAppCSHARP_wrap.cxx' failed
mingw32-make[2]: *** [Native/service/swig/MyAppCSHARP_wrap.cxx] Error 255
CMakeFiles\Makefile2:409: recipe for target
'Native/service/CMakeFiles/MyAppNative.dir/all' failed
mingw32-make[1]: *** [Native/service/CMakeFiles/MyAppNative.dir/all] Error 2
Makefile:84: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
As a work-around I will try to only include the required ITK modules,
and reduce directory name lengths (eg. rename
"C:/InsightToolkit-4.4.2" to "ITK-4.4.2"), however these are simply
temporary measures and not "real" solutions.
Does anyone have any ideas how I can better avoid this "The input line
is too long" error?
(The thread http://www.cmake.org/pipermail/cmake/2006-September/011284.html
suggests using a "link script" could help, but I think that would
require changes internal to CMake itself.)
I am using the following environment: Windows XP SP3, MinGW 4.8.1, ITK
4.4.2, CMake 2.8.12.1, Swig 2.0.11, Boost 1_55_0.
Regards, Dan
More information about the Community
mailing list