[CMake] Re: setting other compile flag for 1 source file

2007-11-25 Thread Cees Wesseling
Hi,
It seems that that is frequently requested feature for gcc but alas it
is not implemented for gcc. Hence I am looking for another option to
disable optimization op a per file level.
 
Thanks, Cees
 
> Doesn't GCC have #pragma operators to control this from within the
> file?  MSVC does.
> 
> Cheers,
> Brandon Van Every
 
>> On Nov 18, 2007 10:32 AM, Cees Wesseling http://www.cmake.org/mailman/listinfo/cmake> > wrote:
>> Hi,
>> 
>> On a large project I am running into a possible optimization bug in
gcc.
>> I nailed the problem down to 1 source file. To bypass the problem I
want
>> to compile the offending source file, with no optimization instead of
>> the default settings for release mode.
>> 
>> Is there already a mechanism for that in cmake that I can't find or
do I
>> just have to build a custom rule for that file?
>> 
>> Any hints how to do this most efficiently are appreciated.
>> 
>> Thanks, Cees

 

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Win32: exporting symbols for DLLs - simpler method ?

2007-11-25 Thread Christian Ehrlicher
Eric Noulard schrieb:
> 2007/11/23, Christian Ehrlicher <[EMAIL PROTECTED]>:
>> Eric Noulard schrieb:
>>> 2) is possible if you use .def file instead of 
>>> __declspec(dllexport/dllimport)
>>> see e.g.
>>> http://www.codeproject.com/dll/SimpleDllP3.asp
>>>
>> This is the old way to export functions and imho very error-prone (you
>> have to change your function name on two places for proper export).
> 
> Yes that's right.
> 
>> Also this does not work for linux.
> 
> I'm no shared lib specialist but as far as I know when
> you build a shared lib on linux the default behavior
> is to export all symbols?
> 
> As far as understood from
> " How to Write Shared Libraries"
> http://people.redhat.com/drepper/dsohowto.pdf
> 
Since gcc 4.x has support for __attribute__ ((visibility()). The effect
of this atribute is nearly the same like dllexport on windows - hiding
private symbols to speedup shared lib loading. kde4 is using this (maybe
more an effect because we need it on windows than really using it to
speedup shared lib loading, don't know ;) )
>> You'll need a single #define FOO_EXPORT for every lib you create.
> 
> Yes I agree with that if you do not use .def.
> 
>>> I'm interested in your problem too because I personnally
>>> would like to throw away those LIB_EXPORTS prefix from the source.
>> I don't understand this.
> 
> I wanted to say that I don't like to have all those
> WHATEVER_EXPORTS in my header files.
> I think it makes the header less readable.
The only thing you need is a FOO_EXPORT before every class / function.
When you move out the import/export stuff into an own header (like it's
done in kde4) it's not that unreadable :)


Christian



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] DLL import/export flag differentiation

2007-11-25 Thread Christian Ehrlicher
Nicholas Yue schrieb:
> Hi,
> 
>   I am attempting to migrate the ANN build to CMake for my own ease of
> cross platform maintenance.
> 
>   The cmake configuration works fine on OSX but have problem Windows
> because of the additional linkage requirement.
> 
>   I understand that there is no per target DEFINITIONS setup so I'd like
> to hear advice from experience cmake user how I should configure my build.
> 
>   The library needs the -DDLL_EXPORT while the application must not have
> that set so that it imports the exported symbols.
> 
>   At the moment, my build fails at the ann_test target because it
> inherits the -DDLL_EXPORT flag from the top.
> 
You can you set_target_properties for this. E.g.:
set_target_properties(kdewin32 PROPERTIES DEFINE_SYMBOL MAKE_KDEWIN32_LIB )


HTH
Christian Ehrlicher
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Re: setting other compile flag for 1 source file

2007-11-25 Thread Brandon Van Every
On Nov 25, 2007 10:46 AM, Cees Wesseling <[EMAIL PROTECTED]> wrote:
>
> It seems that that is frequently requested feature for gcc but alas it is
> not implemented for gcc. Hence I am looking for another option to disable
> optimization op a per file level.

I Googled the following about GCC and #pragma
http://gcc.gnu.org/onlinedocs/gcc/Pragmas.html
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
do these help?


Cheers,
Brandon Van Every
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] setting other compile flag for 1 source file

2007-11-25 Thread Bill Lorensen
Cees,

You can set compiler flags on individual files using
SET_SOURCE_FILES_PROPERTIES.

IF(CMAKE_COMPILER_IS_GNUCC)
SET_SOURCE_FILES_PROPERTIES(
  mycode.cxx
  PROPERTIES COMPILE_FLAGS -O0
 )
ENDIF(CMAKE_COMPILER_IS_GNUCC)

Bill

On Nov 18, 2007 10:32 AM, Cees Wesseling <[EMAIL PROTECTED]> wrote:

> Hi,
>
> On a large project I am running into a possible optimization bug in gcc.
> I nailed the problem down to 1 source file. To bypass the problem I want
> to compile the offending source file, with no optimization instead of
> the default settings for release mode.
>
> Is there already a mechanism for that in cmake that I can't find or do I
> just have to build a custom rule for that file?
>
> Any hints how to do this most efficiently are appreciated.
>
> Thanks, Cees
> ___
> CMake mailing list
> CMake@cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Using the WiX Generator for CPack

2007-11-25 Thread Marcus

Hi,

A CPack WiX Generator is mentioned on this page in the wiki:


Does this generator actually exist?  I can't find any other information 
about it.


Thanks,
Marcus
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Re: setting other compile flag for 1 source file

2007-11-25 Thread Jesper Eskilson
Cees Wesseling wrote:
> Hi,
> 
> It seems that that is frequently requested feature for gcc but alas
> it is not implemented for gcc. Hence I am looking for another option
> to disable optimization op a per file level.

To specify file-specific compiler flags, use set_source_file_properties:

set_source_files_properties(weird-code.c
PROPERTIES COMPILE_FLAGS -Wno-funny-opts)

--
/Jesper

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake