<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hello,</div>

<div>&nbsp;</div>

<div>we&#39;re compiling CUDA code in a sub-library of a bigger project which depends on ITK, VTK, Qt, RTK and a further proprietary library.</div>

<div>&nbsp;</div>

<div>The CMakeLists.txt of this sub-library looks somehow like this:</div>

<div>&nbsp;</div>

<div>
<div>#====================================================================</div>

<div>
<div>SET(OWN_LIB_NAME CBCTUtils)</div>

<div>SET(&#36;{OWN_LIB_NAME}_HDRS<br/>
&nbsp;&nbsp;&nbsp; ...<br/>
&nbsp; oraCudaImagingRingPerspectiveReorientationFilter.h<br/>
)</div>

<div>SET(&#36;{OWN_LIB_NAME}_SRCS<br/>
&nbsp;&nbsp; ...<br/>
&nbsp; oraCudaImagingRingPerspectiveReorientationFilter.cxx<br/>
)</div>

<div>CUDA_COMPILE(&#36;{OWN_LIB_NAME}_CUDA<br/>
&nbsp; oraCudaImagingRingPerspectiveReorientationFilter.hcu<br/>
&nbsp; oraCudaImagingRingPerspectiveReorientationFilter.cu<br/>
)</div>

<div># include dirs</div>

<div>INCLUDE_DIRECTORIES(<br/>
&nbsp; &#36;{CBCT_BIN_DIR}<br/>
&nbsp; &#36;{CBCT_SOURCE_DIR}<br/>
&nbsp; &#36;{RTK_INCLUDE_DIRS}<br/>
&nbsp; &#36;{RTK_LIBRARY_DIRS}<br/>
)</div>

<div># add utilities library</div>

<div>ADD_LIBRARY(&#36;{OWN_LIB_NAME} STATIC<br/>
&nbsp;&nbsp; &nbsp;&#36;{&#36;{OWN_LIB_NAME}_SRCS}<br/>
&nbsp;&nbsp; &nbsp;&#36;{&#36;{OWN_LIB_NAME}_HDRS}<br/>
&nbsp;&nbsp; &nbsp;&#36;{&#36;{OWN_LIB_NAME}_CUDA}<br/>
)</div>

<div>SET_TARGET_PROPERTIES(&#36;{OWN_LIB_NAME} PROPERTIES LINKER_LANGUAGE CXX)</div>

<div>TARGET_LINK_LIBRARIES(&#36;{OWN_LIB_NAME}<br/>
&nbsp; &#36;{RTK_LIBS}<br/>
&nbsp; &#36;{CUDA_LIBRARIES}<br/>
&nbsp; &#36;{CUDA_cufft_LIBRARY}<br/>
&nbsp; &#36;{OPENCL_LIBRARIES}<br/>
&nbsp; ITKCommon<br/>
&nbsp; ITKNumerics<br/>
&nbsp; ORAIFTools<br/>
&nbsp; ORAIFImageAccess<br/>
&nbsp; ORAIFNReg2D3DDRREngine<br/>
&nbsp; ORAIFNReg2D3DMathMethods<br/>
&nbsp; ORAIFNReg2D3DAlgorithm<br/>
&nbsp; ExperimentalORAIFImagingRing<br/>
)</div>

<div># unit test</div>

<div>IF(CBCT_BUILD_TESTING)<br/>
&nbsp; ADD_SUBDIRECTORY(&#36;{CMAKE_CURRENT_SOURCE_DIR}/testing)<br/>
ENDIF(CBCT_BUILD_TESTING)</div>
</div>

<div>#====================================================================</div>

<div>&nbsp;</div>

<div>The problem is that obviously the underlying generated cl.exe call is incredibly long:</div>

<div>&nbsp;</div>

<div>cl.exe -D__CUDA_ARCH__=100 -nologo -E -TP&nbsp;&nbsp; -DCUDA_FLOAT_MATH_FUNCTIONS -DCUDA_NO_SM_11_ATOMIC_INTRINSICS<br/>
-DCUDA_NO_SM_12_ATOMIC_INTRINSICS -DCUDA_NO_SM_13_DOUBLE_INTRINSICS&nbsp; -D__CUDACC__&nbsp; /DWIN32 /D_WINDOWS /W3 /Zm1000 /GR<br/>
/EHsc -DNOMINMAX /MD /O2 /Ob2 /D NDEBUG -I&quot;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v4.2/include&quot;<br/>
-I&quot;C:/dev-libs/gdcm-2.0.14-64bit-build&quot; -I&quot;C:/dev-libs/itk-3.20.1/Code/Review&quot;<br/>
-I&quot;C:/dev-libs/itk-3.20.1-64bit-review-build/Utilities/vxl/core&quot;<br/>
... -I&quot;C:/QtSDK/Qt4.8.3-64bit/include/QtGui&quot; -I&quot;C:/QtSDK/Qt4.8.3-64bit/include/QtNetwork&quot;<br/>
-I&quot;C:/QtSDK/Qt4.8.3-64bit/include/QtCore&quot; -I&quot;C:/QtSDK/Qt4.8.3-64bit/include&quot;<br/>
-I&quot;C:/QtSDK/Qt4.8.3-64bit/include/QtGui&quot; -I&quot;C:/QtSDK/Qt4.8.3-64bit/include/QtNetwork&quot;<br/>
-I&quot;C:/QtSDK/Qt4.8.3-64bit/include/QtCore&quot; -I&quot;C:/dev/ORA-CBCT-64bit-build&quot;<br/>
...<br/>
...<br/>
...<br/>
-I&quot;C:/dev/ORA-CBCT-64bit-build&quot; -I&quot;C:/dev/ORA-CBCT-64bit-build&quot;<br/>
-I&quot;C:/dev/ORA-CBCT/trunk/tools&quot; -I&quot;C:/dev/ORA-CBCT/trunk/core&quot;<br/>
-I&quot;C:/dev/ORA-CBCT/trunk/core/utils&quot; -I&quot;C:/dev/ORA-CBCT/trunk/gui&quot; &quot;<br/>
-IC:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v4.2/bin/../include&quot; &quot;<br/>
-IC:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v4.2/bin/../include/cudart&quot;&nbsp;&nbsp; -D &quot;__CUDACC__&quot; -D &quot;QT_DLL&quot;<br/>
-D &quot;QT_GUI_LIB&quot; -D &quot;QT_NETWORK_LIB&quot; -D &quot;QT_CORE_LIB&quot; -D &quot;QT_DLL&quot; -D &quot;QT_GUI_LIB&quot; -D &quot;QT_NETWORK_LIB&quot;<br/>
-D &quot;QT_CORE_LIB&quot; -D &quot;NVCC&quot; -FI &quot;cuda_runtime.h&quot; &quot;C:/dev/ORA-CBCT/trunk/core/utils/oraCudaImagingRingPerspectiveReorientationFilter.cu&quot; &gt; &quot;C:/Users/RA-Admin/AppData/Local/Temp/tmpxft_00001cdc_00000000-7_oraCudaImagingRingPerspectiveReorientationFilter.cpp1.ii&quot;</div>

<div>&nbsp;</div>

<div>(more than 9000 characters - which is obviously too long for cl.exe &quot;The command line is too long.&quot;)</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>Many of the implied included directories (which are automatically derived by CMake) are definitely not required for compiling this library - cross-checked this on the command line manually.</div>

<div>&nbsp;</div>

<div>Is it possible to control (manipulate?) the generated includes in this call by invoking the one other cmake macro? Is there some other workaround besides from placing the source code of the dependent libs in folds such &quot;C:&#92;a&quot; a.s.o. in order to get the resultant string shorter?</div>

<div>&nbsp;</div>

<div>Thanks.</div>

<div>&nbsp;</div>

<div>Lars</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>
</div>

<div>&nbsp;</div></div></body></html>