Re: [CMake] cannot include txx files using CMake
On Wed, Oct 20, 2010 at 12:05 PM, Prathamesh Kulkarni prathameshmkulka...@gmail.com wrote: Hello all, I want to interface VTK and ITK. Hence I copied the required 4 files (2 txx and 2 cpp) in InsightApplications/Auxilliary/vtk to a common source directory which I want to include in all my other project source directories. In doing this, I am using the following CMake commands: SET(IMPORTED_SRCS ${Common1_SOURCE_DIR}/src/*.cpp ${Common2_SOURCE_DIR}/src/Common.cpp ${Common2_SOURCE_DIR}/src/*.txx ) SET(IMPORTED_HDRS ${Common1_SOURCE_DIR}/include/*.h ${Common2_SOURCE_DIR}/include/*.h ) FILE(GLOB SRCS src/*.cpp src/*.c src/*.txx ${IMPORTED_SRCS}) FILE(GLOB HDRS include/*.h ${IMPORTED_HDRS}) ADD_EXECUTABLE(Project1 ${SRCS} ${HDRS}) However, this is not helping me to include Common2 source and header files in Project1's respective files. What am I doing wrong here? I would avoid using GLOB like this it causes more problems then it is worth. John ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] cannot include txx files using CMake
On Wed, Oct 20, 2010 at 12:19 PM, Prathamesh Kulkarni prathameshmkulka...@gmail.com wrote: Okay, could you please suggest an alternative over this issue? I add each file one by one in variables. The following is from an app used for unit testing my Qt SQLITE database for my current application. SET( DEMO_SRCS ./src/main.cxx ./src/MainWindow.cxx ./src/CmdCreateDB.cxx ./src/CmdAddUser.cxx ./src/CmdAddStudy.cxx ./src/CmdAddCase.cxx ./src/CmdAddImage.cxx ./src/CmdAddCaseAltID.cxx #./src/CmdAddCaseLocation.cxx ./src/CmdAddImageSeries.cxx ./src/CmdAddStudyMode.cxx ./src/CmdAddSRSMPart.cxx ./src/CmdAddSRSMCasePart.cxx #./src/CmdAddStudySMPart.cxx ./src/CmdUpdateRSSSMCompletion.cxx ./src/CmdSetCurrentReaderStudyMode.cxx ./src/CmdGetStudyModeReaderParticipation.cxx ./src/CmdGetReaderTotalCaseCount.cxx ./src/CmdGetReaderTotalCaseList.cxx ./src/CmdGetReaderCompletedCaseCount.cxx ./src/CmdGetReaderCompletedCaseList.cxx ./src/CmdGetReaderRecentCaseCount.cxx ./src/CmdGetReaderRecentCaseList.cxx ./src/CmdCounterBalanceStudyModes.cxx ./src/CmdUpdateAdmin.cxx ./src/CmdLstReadersInStudy.cxx ./src/CmdAddReaderStudyModeCompletion.cxx ./src/CmdAddReaderCaseCompletion.cxx ./src/CmdTestImageSeriesCosines.cxx ./src/CmdVerifyDB.cxx ) SET( DEMO_HDRS ./Include/CmdCreateDB.h ./Include/CmdAddUser.h ./Include/CmdAddStudy.h ./Include/CmdAddCase.h ./Include/CmdAddImage.h ./Include/CmdAddCaseAltID.h # ./Include/CmdAddCaseLocation.h ./Include/CmdAddImageSeries.h ./Include/CmdAddStudyMode.h ./Include/CmdAddSRSMPart.h #./Include/CmdAddStudySMPart.h ./Include/CmdAddSRSMCasePart.h ./Include/CmdUpdateRSSSMCompletion.h ./Include/CmdSetCurrentReaderStudyMode.h ./Include/CmdGetStudyModeReaderParticipation.h ./Include/CmdGetReaderTotalCaseCount.h ./Include/CmdGetReaderTotalCaseList.h ./Include/CmdGetReaderCompletedCaseCount.h ./Include/CmdGetReaderCompletedCaseList.h ./Include/CmdGetReaderRecentCaseCount.h ./Include/CmdGetReaderRecentCaseList.h ./Include/CmdCounterBalanceStudyModes.h ./Include/CmdUpdateAdmin.h ./Include/CmdLstReadersInStudy.h ./Include/CmdAddReaderStudyModeCompletion.h ./Include/CmdAddReaderCaseCompletion.h ./Include/CmdTestImageSeriesCosines.h ./Include/CmdVerifyDB.h ) SET( DEMO_MOC_HDRS ./Include/MainWindow.h ) # some .ui files SET( DEMO_UIS ) # and finally an resource file SET( DEMO_RCS ) # this command will generate rules that will run rcc on all files from DEMO_RCS # in result DEMO_RC_SRCS variable will contain paths to files produced by rcc QT4_ADD_RESOURCES( DEMO_RC_SRCS ${DEMO_RCS} ) # and finally this will run moc: QT4_WRAP_CPP( DEMO_MOC_SRCS ${DEMO_MOC_HDRS} ) # this will run uic on .ui files: QT4_WRAP_UI( DEMO_UI_HDRS ${DEMO_UIS} ) add_executable(dbDev0 ${DEMO_SRCS} ${DEMO_MOC_SRCS} ${DEMO_HDRS} ${DEMO_MOC_HDRS} ${DEMO_UI_HDRS} ${DEMO_RC_SRCS} ) target_link_libraries(dbDev0 ${QT_LIBRARIES} ${UPMC_EXTERNAL_LIBS} ) ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] cannot include txx files using CMake
Okay, could you please suggest an alternative over this issue? - Prathamesh On Wed, Oct 20, 2010 at 11:16 AM, John Drescher dresche...@gmail.comwrote: On Wed, Oct 20, 2010 at 12:05 PM, Prathamesh Kulkarni prathameshmkulka...@gmail.com wrote: Hello all, I want to interface VTK and ITK. Hence I copied the required 4 files (2 txx and 2 cpp) in InsightApplications/Auxilliary/vtk to a common source directory which I want to include in all my other project source directories. In doing this, I am using the following CMake commands: SET(IMPORTED_SRCS ${Common1_SOURCE_DIR}/src/*.cpp ${Common2_SOURCE_DIR}/src/Common.cpp ${Common2_SOURCE_DIR}/src/*.txx ) SET(IMPORTED_HDRS ${Common1_SOURCE_DIR}/include/*.h ${Common2_SOURCE_DIR}/include/*.h ) FILE(GLOB SRCS src/*.cpp src/*.c src/*.txx ${IMPORTED_SRCS}) FILE(GLOB HDRS include/*.h ${IMPORTED_HDRS}) ADD_EXECUTABLE(Project1 ${SRCS} ${HDRS}) However, this is not helping me to include Common2 source and header files in Project1's respective files. What am I doing wrong here? I would avoid using GLOB like this it causes more problems then it is worth. John ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] cannot include txx files using CMake
I do not understand why I am having errors for only .txx files and not for .cpp files placed in the same common folder. Any help would be highly appreciated. Right now, I am forced to paste common the files in all the project folders where ever they are required. - Prathamesh On Wed, Oct 20, 2010 at 12:13 PM, Prathamesh Kulkarni prathameshmkulka...@gmail.com wrote: Thanks, I tried getting rid of the GLOB. But I am still getting the same error as earlier: fatal error C1083: Cannot open include file: 'itkImageToVTKImageFilter.txx': No such file or directory (This file is present in a common directory) The CMakeLists now looks like this: SET(IMPORTED_SRCS ${OCTIO_SOURCE_DIR}/src/OCTBScan.cpp ${OCTIO_SOURCE_DIR}/src/OCTCScan.cpp ${OCTIO_SOURCE_DIR}/src/OCTBScanHeader.cpp ${OCTIO_SOURCE_DIR}/src/OCTCScanHeader.cpp ${OCTCommon_SOURCE_DIR}/src/OCTCommon.cpp ${OCTCommon_SOURCE_DIR}/src/itkImageToVTKImageFilter.txx ${OCTCommon_SOURCE_DIR}/src/itkVTKImageToImageFilter.txx ) SET(IMPORTED_HDRS ${OCTIO_SOURCE_DIR}/include/OCTBScan.h ${OCTIO_SOURCE_DIR}/include/OCTCScan.h ${OCTIO_SOURCE_DIR}/include/OCTBScanHeader.h ${OCTIO_SOURCE_DIR}/include/OCTCScanHeader.h ${OCTCommon_SOURCE_DIR}/include/OCTCommon.h ${OCTCommon_SOURCE_DIR}/include/itkImageToVTKImageFilter.h ${OCTCommon_SOURCE_DIR}/include/itkVTKImageToImageFilter.h ) #FILE(GLOB SRCS src/*.cpp src/*.c src/*.txx ${IMPORTED_SRCS}) #${IMPORTED_SRCS1}) #FILE(GLOB HDRS include/*.h ${IMPORTED_HDRS}) #${IMPORTED_HDRS1}) SET(SRCS ./src/OCTBScanVisualization.cpp ./src/OCTCScanVisualization.cpp ./src/OCTVisualization_main.cpp #${IMPORTED_SRCS} ) SET(HDRS ./include/OCTBScanVisualization.h ./include/OCTCScanVisualization.h #${IMPORTED_HDRS} ) ADD_EXECUTABLE(OCTVisualization ${SRCS} ${HDRS} ${IMPORTED_SRCS} ${IMPORTED_HDRS}) What am I doing wrong here? - Prathamesh On Wed, Oct 20, 2010 at 11:26 AM, John Drescher dresche...@gmail.comwrote: On Wed, Oct 20, 2010 at 12:19 PM, Prathamesh Kulkarni prathameshmkulka...@gmail.com wrote: Okay, could you please suggest an alternative over this issue? I add each file one by one in variables. The following is from an app used for unit testing my Qt SQLITE database for my current application. SET( DEMO_SRCS ./src/main.cxx ./src/MainWindow.cxx ./src/CmdCreateDB.cxx ./src/CmdAddUser.cxx ./src/CmdAddStudy.cxx ./src/CmdAddCase.cxx ./src/CmdAddImage.cxx ./src/CmdAddCaseAltID.cxx #./src/CmdAddCaseLocation.cxx ./src/CmdAddImageSeries.cxx ./src/CmdAddStudyMode.cxx ./src/CmdAddSRSMPart.cxx ./src/CmdAddSRSMCasePart.cxx #./src/CmdAddStudySMPart.cxx ./src/CmdUpdateRSSSMCompletion.cxx ./src/CmdSetCurrentReaderStudyMode.cxx ./src/CmdGetStudyModeReaderParticipation.cxx ./src/CmdGetReaderTotalCaseCount.cxx ./src/CmdGetReaderTotalCaseList.cxx ./src/CmdGetReaderCompletedCaseCount.cxx ./src/CmdGetReaderCompletedCaseList.cxx ./src/CmdGetReaderRecentCaseCount.cxx ./src/CmdGetReaderRecentCaseList.cxx ./src/CmdCounterBalanceStudyModes.cxx ./src/CmdUpdateAdmin.cxx ./src/CmdLstReadersInStudy.cxx ./src/CmdAddReaderStudyModeCompletion.cxx ./src/CmdAddReaderCaseCompletion.cxx ./src/CmdTestImageSeriesCosines.cxx ./src/CmdVerifyDB.cxx ) SET( DEMO_HDRS ./Include/CmdCreateDB.h ./Include/CmdAddUser.h ./Include/CmdAddStudy.h ./Include/CmdAddCase.h ./Include/CmdAddImage.h ./Include/CmdAddCaseAltID.h # ./Include/CmdAddCaseLocation.h ./Include/CmdAddImageSeries.h ./Include/CmdAddStudyMode.h ./Include/CmdAddSRSMPart.h #./Include/CmdAddStudySMPart.h ./Include/CmdAddSRSMCasePart.h ./Include/CmdUpdateRSSSMCompletion.h ./Include/CmdSetCurrentReaderStudyMode.h ./Include/CmdGetStudyModeReaderParticipation.h ./Include/CmdGetReaderTotalCaseCount.h ./Include/CmdGetReaderTotalCaseList.h ./Include/CmdGetReaderCompletedCaseCount.h ./Include/CmdGetReaderCompletedCaseList.h ./Include/CmdGetReaderRecentCaseCount.h ./Include/CmdGetReaderRecentCaseList.h ./Include/CmdCounterBalanceStudyModes.h ./Include/CmdUpdateAdmin.h ./Include/CmdLstReadersInStudy.h ./Include/CmdAddReaderStudyModeCompletion.h ./Include/CmdAddReaderCaseCompletion.h ./Include/CmdTestImageSeriesCosines.h ./Include/CmdVerifyDB.h ) SET( DEMO_MOC_HDRS ./Include/MainWindow.h ) # some .ui files SET( DEMO_UIS ) # and finally an resource file SET( DEMO_RCS ) # this command will generate rules that will run rcc on all files from DEMO_RCS # in result DEMO_RC_SRCS variable will contain paths to files produced by rcc QT4_ADD_RESOURCES( DEMO_RC_SRCS
Re: [CMake] cannot include txx files using CMake
On 10/20/2010 07:55 PM, Prathamesh Kulkarni wrote: I do not understand why I am having errors for only .txx files and not for .cpp files placed in the same common folder. Any help would be highly appreciated. Right now, I am forced to paste common the files in all the project folders where ever they are required. Does ${OCTCommon_SOURCE_DIR}/src appear in the include path, i.e. have you said INCLUDE_DIRECTORIES(${OCTCommon_SOURCE_DIR}/src) and have you said it at the right place? How do the #include directives for the txx files look like? Do they involve subdirectories, e.g. do they possibly read #include src/itkImageToVTKImageFilter.txx? Could you post the complete compile line which fails due to that missing include file? Regards, Michael On Wed, Oct 20, 2010 at 12:13 PM, Prathamesh Kulkarni prathameshmkulka...@gmail.com wrote: Thanks, I tried getting rid of the GLOB. But I am still getting the same error as earlier: fatal error C1083: Cannot open include file: 'itkImageToVTKImageFilter.txx': No such file or directory (This file is present in a common directory) The CMakeLists now looks like this: SET(IMPORTED_SRCS ${OCTIO_SOURCE_DIR}/src/OCTBScan.cpp ${OCTIO_SOURCE_DIR}/src/OCTCScan.cpp ${OCTIO_SOURCE_DIR}/src/OCTBScanHeader.cpp ${OCTIO_SOURCE_DIR}/src/OCTCScanHeader.cpp ${OCTCommon_SOURCE_DIR}/src/OCTCommon.cpp ${OCTCommon_SOURCE_DIR}/src/itkImageToVTKImageFilter.txx ${OCTCommon_SOURCE_DIR}/src/itkVTKImageToImageFilter.txx ) SET(IMPORTED_HDRS ${OCTIO_SOURCE_DIR}/include/OCTBScan.h ${OCTIO_SOURCE_DIR}/include/OCTCScan.h ${OCTIO_SOURCE_DIR}/include/OCTBScanHeader.h ${OCTIO_SOURCE_DIR}/include/OCTCScanHeader.h ${OCTCommon_SOURCE_DIR}/include/OCTCommon.h ${OCTCommon_SOURCE_DIR}/include/itkImageToVTKImageFilter.h ${OCTCommon_SOURCE_DIR}/include/itkVTKImageToImageFilter.h ) #FILE(GLOB SRCS src/*.cpp src/*.c src/*.txx ${IMPORTED_SRCS}) #${IMPORTED_SRCS1}) #FILE(GLOB HDRS include/*.h ${IMPORTED_HDRS}) #${IMPORTED_HDRS1}) SET(SRCS ./src/OCTBScanVisualization.cpp ./src/OCTCScanVisualization.cpp ./src/OCTVisualization_main.cpp #${IMPORTED_SRCS} ) SET(HDRS ./include/OCTBScanVisualization.h ./include/OCTCScanVisualization.h #${IMPORTED_HDRS} ) ADD_EXECUTABLE(OCTVisualization ${SRCS} ${HDRS} ${IMPORTED_SRCS} ${IMPORTED_HDRS}) What am I doing wrong here? - Prathamesh On Wed, Oct 20, 2010 at 11:26 AM, John Drescher dresche...@gmail.comwrote: On Wed, Oct 20, 2010 at 12:19 PM, Prathamesh Kulkarni prathameshmkulka...@gmail.com wrote: Okay, could you please suggest an alternative over this issue? I add each file one by one in variables. The following is from an app used for unit testing my Qt SQLITE database for my current application. SET( DEMO_SRCS ./src/main.cxx ./src/MainWindow.cxx ./src/CmdCreateDB.cxx ./src/CmdAddUser.cxx ./src/CmdAddStudy.cxx ./src/CmdAddCase.cxx ./src/CmdAddImage.cxx ./src/CmdAddCaseAltID.cxx #./src/CmdAddCaseLocation.cxx ./src/CmdAddImageSeries.cxx ./src/CmdAddStudyMode.cxx ./src/CmdAddSRSMPart.cxx ./src/CmdAddSRSMCasePart.cxx #./src/CmdAddStudySMPart.cxx ./src/CmdUpdateRSSSMCompletion.cxx ./src/CmdSetCurrentReaderStudyMode.cxx ./src/CmdGetStudyModeReaderParticipation.cxx ./src/CmdGetReaderTotalCaseCount.cxx ./src/CmdGetReaderTotalCaseList.cxx ./src/CmdGetReaderCompletedCaseCount.cxx ./src/CmdGetReaderCompletedCaseList.cxx ./src/CmdGetReaderRecentCaseCount.cxx ./src/CmdGetReaderRecentCaseList.cxx ./src/CmdCounterBalanceStudyModes.cxx ./src/CmdUpdateAdmin.cxx ./src/CmdLstReadersInStudy.cxx ./src/CmdAddReaderStudyModeCompletion.cxx ./src/CmdAddReaderCaseCompletion.cxx ./src/CmdTestImageSeriesCosines.cxx ./src/CmdVerifyDB.cxx ) SET( DEMO_HDRS ./Include/CmdCreateDB.h ./Include/CmdAddUser.h ./Include/CmdAddStudy.h ./Include/CmdAddCase.h ./Include/CmdAddImage.h ./Include/CmdAddCaseAltID.h # ./Include/CmdAddCaseLocation.h ./Include/CmdAddImageSeries.h ./Include/CmdAddStudyMode.h ./Include/CmdAddSRSMPart.h #./Include/CmdAddStudySMPart.h ./Include/CmdAddSRSMCasePart.h ./Include/CmdUpdateRSSSMCompletion.h ./Include/CmdSetCurrentReaderStudyMode.h ./Include/CmdGetStudyModeReaderParticipation.h ./Include/CmdGetReaderTotalCaseCount.h ./Include/CmdGetReaderTotalCaseList.h ./Include/CmdGetReaderCompletedCaseCount.h ./Include/CmdGetReaderCompletedCaseList.h ./Include/CmdGetReaderRecentCaseCount.h ./Include/CmdGetReaderRecentCaseList.h ./Include/CmdCounterBalanceStudyModes.h ./Include/CmdUpdateAdmin.h ./Include/CmdLstReadersInStudy.h