[CMake] how to write a cmakelist to call a function in another c or cxx file

Hendrik Sattler post at hendrik-sattler.de
Sat Jan 16 13:09:08 EST 2010


Am Samstag 16 Januar 2010 15:40:55 schrieb Yixun Liu:
> ADD_EXECUTABLE(main main.cxx  )
> 
> TARGET_LINK_LIBRARIES(main ITKCommon ITKIO vtkCommon vtkIO )
> 
> It works well.
> Now I need to ,in main.cxx,  invoke a function, let's say func(),
> defined in another c file, let's say test.c.

You need to compile all sources, so
  ADD_EXECUTABLE(main main.cxx test.c)

HS


More information about the CMake mailing list