[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Makefile generator and header files in 2.8.8
From:       "David Nadlinger" <code () klickverbot ! at>
Date:       2012-05-25 15:03:10
Message-ID: A21C6D38-73CF-4DA3-9E4F-620DA5BE5F4E () klickverbot ! at
[Download RAW message or body]

On 25 May 2012, at 16:48, Eric Noulard wrote:
> 2012/5/25 David Nadlinger <code@klickverbot.at>:
>> In our project, we are explicitly adding all the header files along 
>> with the
>> source files to the respective build targets in order for them to 
>> show up in
>> CMake-generated Visual C++ projects.
>>
>> Up to and including 2.8.7, this worked well as the Makefile generator 
>> simply
>> ignored the header files, but starting with 2.8.8, this no longer 
>> seems to
>> be the case.
>
> Which means?
> Generated makefile tries to compile the header?
Yes, it compiles both .h and .o files as separate object files.

> On which platform do you get that buggy behavior?
cmake version 2.8.8, on OS X 10.7, installed via MacPorts

> Could you give us a strip down example of the problem
> may be with one header and one C/C++ file?

Sorry, yes – this seems to be a fairly minimal test case (create some 
arbitrary test.c/test.h files to run):

---
cmake_minimum_required(VERSION 2.6)

set(TEST_SRC test.c test.h)
set_source_files_properties(${TEST_SRC} PROPERTIES LANGUAGE CXX)

add_library(test ${TEST_SRC})
---

Oh well, RTFM 
(http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_sf:LANGUAGE): 
 »Do not set this for header or files that should not be compiled. « I 
guess we have been relying on unspecified behavior all the time, then.

Anyway, thanks for your quick response,
David
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic