[Cmake] Adding Header files to CMakeLists.txt

Bill Hoffman bill.hoffman at kitware.com
Fri Aug 17 10:31:10 EDT 2001


I think what might be better is a new command in cmake:

It would work like this:

HEADER_FILES(ian_sources)

It would search the source list for .h files.
For unix it would be a no-op, but for msdev, it would
add the sources.

Is there anyway to turn off the class browsing features in msdev?
The problem with adding the .h files is that for a large project, 
it may take a LONG time to load.

-Bill


At 11:20 AM 8/17/2001 +0100, Ian Scott wrote:
>Hi,
>
>I've been playing around with adding .h files to the CMakeLists.txt, so that
>they appear in my generated .dsp file.* This appears to do the correct thing
>under NT, adding them to the "Header Files" cmSourceGroup, and then into the
>correct place in the dsp file.
>
>My CMakeLists.txt file looks like
>
>
>ADD_LIBRARY(ian ian_sources)
>
>SOURCE_FILES(ian_sources
>ian_file1.cxx
>ian_file1.h
>ian_file2.cxx
>ian_file2.h
>)
>
>
>However using the same CMakeLists.txt file under Unix, it attempts to build
>ian_file2.o and ian_file1.o twice
>
>So my solution is
>ADD_LIBRARY(ian ian_sources)
>
>SOURCE_FILES(ian_sources
>ian_file1.cxx
>ian_file2.cxx
>)
>
>IF (WIN32)
>  SOURCE_FILES(ian_sources
>  ian_file1.h
>  ian_file2.h
>  )
>ENDIF(WIN32)
>
>This appears to work satisfactorily. However, I wondered if it was
>necessary, or if I or CMake was doing something wrong?
>
>Many thanks,
>Ian.
>
>
>* I know that some UNIX users will have doubts about the desirability of
>this. However, our NT users have been complaining loudly about the lack of
>.h files in the produced DSP files, and our UNIX users are willing to
>tolerate additions to the CMakeLists.txt.
>
>
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake 





More information about the CMake mailing list