[CMake] cannot include txx files using CMake

John Drescher drescherjm at gmail.com
Wed Oct 20 12:16:50 EDT 2010


On Wed, Oct 20, 2010 at 12:05 PM, Prathamesh Kulkarni
<prathameshmkulkarni at 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


More information about the CMake mailing list