[CMake] cmake uppercase source file problem

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Aug 22 07:18:08 EDT 2008


On Thu, Aug 21, 2008 at 7:56 AM, Ralf Habacker <ralf.habacker at freenet.de> wrote:
> Ralf Habacker schrieb:
>>
>> Hi,
>>
>> while working on a C++ project migrating from old Turbo C++ ide's I
>> encountered a problem with uppercase extensions.
>
> Update/additional informations:
>
> I tried to use
>
> SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
>
> and to patch cmake source to add the .CPP as default c++ extension, but
> nothing helps.
>
> I suggest that
>
> - cmake should general print a kind of  <file ... is ignored> message if the
> related extension is not known because otherwise it may be hard to track
> down those silent-file-ignore-errors
>
> and
> - cmake should have support extensions case insensitive on windows
>

I was able to compile a .c file as C++ using cmake
set_source_files_properties / LANGUAGE.


$ cmake --help-command set_source_files_properties
cmake version 2.6-patch 0
------------------------------------------------------------------------------


  set_source_files_properties
       Source files can have properties that affect how they are built.

         set_source_files_properties(file1 file2 ...
                                     PROPERTIES prop1 value1
                                     prop2 value2 ...)

       Set properties on a file.  The syntax for the command is to list all
       the files you want to change, and then provide the values you want to
       set next.  You can make up your own properties as well.  The following
       are used by CMake.  The ABSTRACT flag (boolean) is used by some class
       wrapping commands.  If WRAP_EXCLUDE (boolean) is true then many
       wrapping commands will ignore this file.  If GENERATED (boolean) is
       true then it is not an error if this source file does not exist when
       it is added to a target.  Obviously, it must be created (presumably by
       a custom command) before the target is built.  If the HEADER_FILE_ONLY
       (boolean) property is true then the file is not compiled.  This is
       useful if you want to add extra non build files to an IDE.
       OBJECT_DEPENDS (string) adds dependencies to the object file.
       COMPILE_FLAGS (string) is passed to the compiler as additional command
       line arguments when the source file is compiled.  LANGUAGE (string)
       CXX|C will change the default compiler used to compile the source
       file.  The languages used need to be enabled in the PROJECT command.
       If SYMBOLIC (boolean) is set to true the build system will be informed
       that the source file is not actually created on disk but instead used
       as a symbolic name for a build rule.


HTH
-- 
Mathieu


More information about the CMake mailing list