[Cmake] SOURCE_FILES default extension

Bill Hoffman bill.hoffman at kitware.com
Tue Jan 22 15:37:23 EST 2002


Cmake looks for the file with no extension first, then tries cxx cpp, mm, h, etc.
At one point I thought it would be better if you had to give the extension.
However, at this point, it would be hard to change all the projects using cmake.
I guess it could be a style for list files, that you should use the full file name,
but I would not want to break/change existing projects.

-Bill


At 03:40 PM 1/22/2002 -0500, Brad King wrote:


>---------- Forwarded message ----------
>Date: Tue, 22 Jan 2002 13:49:28 -0500
>From: "Lorensen, William E (CRD)" <lorensen at crd.ge.com>
>To: cmake at public.kitware.com
>Subject: [Cmake] SOURCE_FILES default extension
>
>How does cmake find the extension to use in the SOURCE_FILES statement?
>
>I just had an example that used VTK and ITK. My SOURCE_FILES line looked like this
>SOURCE_FILES(Distance_SRCS
>Distance
>Options
>)
>
>The first time cmake generated the Makefile, it correctly guessed the extension as "cxx". I
>successfully built the program (called Distance). Then I edited the source file and did another
>gmake. cmake generated a new Makefile with the compile line using the executable name rather than the
>.cxx file.
>Seems that the second time, it found that the file listed in the SOURCE_FILES was there (the
>executable this time) and messed up my Makefile. If I remove the Distance file and rerun cmake, it
>generates the correct Makefile.
>
>To fix the problem, I changed my command to:
>
>SOURCE_FILES(Distance_SRCS
>Distance.cxx
>Options.cxx
>)
>
>and all was fine.
>
>Seems that cmake should REQUIRE an extension on these source files.
>
>Bill
>
>
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake




More information about the CMake mailing list