Re: [CMake] Cross-compiling for Tizen emulator

2013-12-05 Thread Stephen Kelly
Bogdan Cristea wrote:

> SET(CMAKE_FIND_ROOT_PATH
> /home/bogdan/dev/src/tizenbuildtools/emulator/GBS-ROOT/local/BUILD-
ROOTS/scratch.i586.0)

This is not passed as --sysroot. However, cmake master supports a 
CMAKE_SYSROOT variable.

 http://www.cmake.org/cmake/help/git-master/variable/CMAKE_SYSROOT.html

Please test a master build or a nightly build so that we know CMAKE_SYSROOT 
works for you.
 
 SET(CMAKE_SYSROOT
 /home/bogdan/dev/src/tizenbuildtools/emulator/GBS-ROOT/local/BUILD-
ROOTS/scratch.i586.0)


Thanks,

Steve.


--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindQt4 regression (changing QT_QMAKE_EXECUTABLE)

2013-12-05 Thread Clinton Stimpson
On Thursday, December 05, 2013 11:33:58 PM Simon Sasburg wrote:
> I've run into a problem after updating my cmake in using the FindQt4 module.
> 
> It used to be the case that when QT_QMAKE_EXECUTABLE was changed by the
> user or by a SET(... FORCE) command, all the derived cache entries would be
> refreshed, however this does not work anymore.
> 
> The cause seems to be git commit 21123416b4c2d49fe981279b10fbc78c8d07c491
> which removes the following code:
> 
>   if(QT_QMAKE_EXECUTABLE_LAST)
> string(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}"
> "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED)
>   endif()
>   set(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL ""
> FORCE)
> 
> I've attached a patch that restores this code so this works again, could
> this be included in the next cmake release?
> 
> Best regards,
> Simon

Thanks!  I noticed this problem recently too.

I've put it in for you.
http://cmake.org/gitweb?p=cmake.git;a=commit;h=4ee3b655

Clint
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Cross-compiling for Tizen emulator

2013-12-05 Thread Bogdan Cristea

Hi

I am trying to write a toolchain cmake script in order to crosscompile a 
cpp program for Tizen emulator. Here is the cmake script I am using:


SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER 
/home/bogdan/tizen-sdk/tools/i386-linux-gnueabi-gcc-4.5/bin/i386-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER 
/home/bogdan/tizen-sdk/tools/i386-linux-gnueabi-gcc-4.5/bin/i386-linux-gnueabi-g++)
SET(CMAKE_FIND_ROOT_PATH 
/home/bogdan/dev/src/tizenbuildtools/emulator/GBS-ROOT/local/BUILD-ROOTS/scratch.i586.0)

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

However, at compile I get errors about missing files: crt1.o, cdti.o and 
the compiler is not detected. I have checked that the above 
CMAKE_FIND_ROOT_PATH is set with the path that is normally specified in 
the --sysroot command line option of the gcc compiler. Any ideas how to 
solve this issue ?


thanks
Bogdan

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] FindQt4 regression (changing QT_QMAKE_EXECUTABLE)

2013-12-05 Thread Simon Sasburg
I've run into a problem after updating my cmake in using the FindQt4 module.

It used to be the case that when QT_QMAKE_EXECUTABLE was changed by the
user or by a SET(... FORCE) command, all the derived cache entries would be
refreshed, however this does not work anymore.

The cause seems to be git commit 21123416b4c2d49fe981279b10fbc78c8d07c491
which removes the following code:

  if(QT_QMAKE_EXECUTABLE_LAST)
string(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}"
"${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED)
  endif()
  set(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL ""
FORCE)

I've attached a patch that restores this code so this works again, could
this be included in the next cmake release?

Best regards,
Simon


0001-FindQt4-Restore-ability-to-handle-a-changed-QT_QMAKE.patch
Description: Binary data
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] [CMAKE] Getting compilation date through CMake

2013-12-05 Thread Matthew Woehlke

On 2013-12-05 15:46, Fraser Hutchison wrote:

If you can specify CMake version 2.8.11 as a minimum, you could use
the string(TIMESTAMP ...) command instead:

string(TIMESTAMP _output "%d/%m/%Y")

Bear in mind that these only execute when CMake runs (i.e. at configure time)
rather than at build time, so strictly-speaking you're not actually grabbing the
compile date.


Of course you could put that in a CMake script and execute it with e.g. 
'${CMAKE_COMMAND} -p ${CMAKE_CURRENT_SOURCE_DIR}/get_date.cmake' in a 
custom command :-). Then it would truly be the compile date. (Needless 
to say, the script would need to write the date into some generated 
source file, e.g. with configure_file.)


--
Matthew

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Feature request - Build Button

2013-12-05 Thread Jean-Christophe Fillion-Robin
That would be a great addition.
Jc


On Thu, Dec 5, 2013 at 4:19 PM, Eric Noulard  wrote:

> 2013/12/5 Macumber, Daniel :
> > I’m sure this has come up before but I’m curious if CMake-GUI would ever
> > consider adding a “Build” button?  This seems like a logical step after
> > “Configure” and “Generate”, if it was available on the command line it
> could
> > also help automate CMake based builds on different systems.
>
> You can do that on the command line with
>
> cmake --build /path/to/buildtree
>
> > Right now
> > scripts that build on multiple systems have to use CMake and then call
> > whatever system specific build command there is for that system.  I
> assume
> > there is some rational reason why CMake doesn’t do this but I think it
> would
> > be good if it could.
>
> Command line can do it. I guess adding a build button to CMake-GUI
> wouldn't be
> that difficult.
>
> >
> >
> >
> > Just my 2 cents,
> > Dan
> >
> >
> > --
> >
> > Powered by www.kitware.com
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Kitware offers various services to support the CMake community. For more
> > information on each offering, please visit:
> >
> > CMake Support: http://cmake.org/cmake/help/support.html
> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
> > CMake Training Courses: http://cmake.org/cmake/help/training.html
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/listinfo/cmake
>
>
>
> --
> Erk
> L'élection n'est pas la démocratie -- http://www.le-message.org
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
+1 919 869 8849
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Feature request - Build Button

2013-12-05 Thread Eric Noulard
2013/12/5 Macumber, Daniel :
> I’m sure this has come up before but I’m curious if CMake-GUI would ever
> consider adding a “Build” button?  This seems like a logical step after
> “Configure” and “Generate”, if it was available on the command line it could
> also help automate CMake based builds on different systems.

You can do that on the command line with

cmake --build /path/to/buildtree

> Right now
> scripts that build on multiple systems have to use CMake and then call
> whatever system specific build command there is for that system.  I assume
> there is some rational reason why CMake doesn’t do this but I think it would
> be good if it could.

Command line can do it. I guess adding a build button to CMake-GUI wouldn't be
that difficult.

>
>
>
> Just my 2 cents,
> Dan
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



-- 
Erk
L'élection n'est pas la démocratie -- http://www.le-message.org
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] [CMAKE] Getting compilation date through CMake

2013-12-05 Thread Fraser Hutchison

  
  
Hi Jon,

You'd have to invoke the command prompt to execute this I think.  On
Windows this should be the value of the COMSPEC environment
variable, so your command would be something like:

execute_process(COMMAND
    $ENV{COMSPEC} /c date /t
    OUTPUT_VARIABLE _output
)

However, this is Windows-specific.  If you can specify CMake version
2.8.11 as a minimum, you could use the string(TIMESTAMP ...)
command instead:

string(TIMESTAMP _output "%d/%m/%Y")

Bear in mind that these only execute when CMake runs (i.e. at
configure time) rather than at build time, so strictly-speaking
you're not actually grabbing the compile date.

Cheers,
Fraser.


On 05/12/2013 19:32, Jon Haitz
  Legarreta wrote:


  Hi there,
I was trying to get the compilation time through a
CMake-executed command in order to know the compilation time of
a given project.
In my custom.cmake file I was using

execute_process(COMMAND
    date -t 
    OUTPUT_VARIABLE _output 
)

It turns out that the _output variable is empty when I compile
my project. However, the command works well from the command
line. I'm working on a Win 7  64-bit machine.

I wanted to avoid using an extra C/C++ code file to get the
current time.

Am I missing something?

Thank you,
JON HAITZ

  

  

  
  


  

  

  
  

  

  

  

  

  
  
  
  
  --

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


  

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Feature request - Build Button

2013-12-05 Thread Macumber, Daniel
I'm sure this has come up before but I'm curious if CMake-GUI would ever 
consider adding a "Build" button?  This seems like a logical step after 
"Configure" and "Generate", if it was available on the command line it could 
also help automate CMake based builds on different systems.  Right now scripts 
that build on multiple systems have to use CMake and then call whatever system 
specific build command there is for that system.  I assume there is some 
rational reason why CMake doesn't do this but I think it would be good if it 
could.

Just my 2 cents,
Dan
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Compile C files with C++

2013-12-05 Thread Tom Browder
On Thu, Dec 5, 2013 at 1:44 PM, Pau Garcia i Quiles
 wrote:
> Hello,
>
> If you have more than 200 CMakeLists.txt, IMHO you should create two macros
> to wrap add_executable/add_library: add_executable_maybe_cxx /
> add_library_maybe_cxx

Good idea, but the changes needed I think are about the same
effort-wise.  Besides, I have to watch stepping on other toes while
I'm going through the list--maybe later we'll look into it.

Thanks!

Best regards,

-Tom
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Compile C files with C++

2013-12-05 Thread Pau Garcia i Quiles
Hello,

If you have more than 200 CMakeLists.txt, IMHO you should create two macros
to wrap add_executable/add_library: add_executable_maybe_cxx /
add_library_maybe_cxx


On Thu, Dec 5, 2013 at 7:54 PM, Tom Browder  wrote:

> On Thu, Dec 5, 2013 at 12:38 PM, J Decker  wrote:
> > then maybe just stripping the names, and/or adding the
> > CMAKE_CURRENT_SOURCE_DIR for each one as appropriate
>
> No, I still need choice, so, e.g., I'm using these lines in each
> CMakeLists.txt (modified as necessary, of course; and it works so
> far):
>
> # choose to use C++ compiler on all files
> if(ENABLE_ALL_CXX_COMPILE)
>   set_source_files_properties(${LIBRT_SOURCES} PROPERTIES LANGUAGE CXX)
> endif()
>
> -Tom
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] [CMAKE] Getting compilation date through CMake

2013-12-05 Thread Jon Haitz Legarreta
Hi there,
I was trying to get the compilation time through a CMake-executed command
in order to know the compilation time of a given project.
In my custom.cmake file I was using

execute_process(COMMAND
date -t
OUTPUT_VARIABLE _output
)

It turns out that the _output variable is empty when I compile my project.
However, the command works well from the command line. I'm working on a Win
7  64-bit machine.

I wanted to avoid using an extra C/C++ code file to get the current time.

Am I missing something?

Thank you,
JON HAITZ
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Compile C files with C++

2013-12-05 Thread Tom Browder
On Thu, Dec 5, 2013 at 12:38 PM, J Decker  wrote:
> then maybe just stripping the names, and/or adding the
> CMAKE_CURRENT_SOURCE_DIR for each one as appropriate

No, I still need choice, so, e.g., I'm using these lines in each
CMakeLists.txt (modified as necessary, of course; and it works so
far):

# choose to use C++ compiler on all files
if(ENABLE_ALL_CXX_COMPILE)
  set_source_files_properties(${LIBRT_SOURCES} PROPERTIES LANGUAGE CXX)
endif()

-Tom
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Fwd: Compile C files with C++

2013-12-05 Thread Tom Browder
Should have been posted here


-- Forwarded message --
From: Tom Browder 
Date: Thu, Dec 5, 2013 at 12:31 PM
Subject: Re: [CMake] Compile C files with C++
To: J Decker 


On Thu, Dec 5, 2013 at 12:21 PM, J Decker  wrote:
> I mean .cpp
>
> and I mean in the first message, is that same list used for the
> add_library or add_executable you do later?

No.  We have over 200 CMakeLists.txt and I'm painfully starting to
modify each one--bummer!

Thanks all (the bug fixes would be nice).

Best regards,

-Tom
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Compile C files with C++

2013-12-05 Thread J Decker
Sorry and another soultuion when globbing, copy all the c files to
.cxx files and use those instead
then you can have different flags for the different modes also

On Thu, Dec 5, 2013 at 10:19 AM, J Decker  wrote:
> that works... it's path specific though, are you also using
> ${all_c_files} as the source names?
> if your globbing ends up including the path the base source name won't
> match or vice versa...
>
> On Thu, Dec 5, 2013 at 6:16 AM, Tom Browder  wrote:
>> I found this 2009 thread:
>>
>>   http://marc.info/?l=cmake&m=123851619629929&w=2
>>
>> discussing this issue and I tried all suggestions but still cannot get
>> C files compiled with C++.
>>
>> The last suggestion was to glob all C source files and set a LANGUAGE
>> CXX property on each.  I put this at the very top of my master
>> CMakeLists.txt file:
>>
>>   file(GLOB_RECURSE all_c_files ${CMAKE_SOURCE_DIR}/src/*.c)
>>   set_source_files_properties(${all_c_files} PROPERTIES LANGUAGE CXX)
>>
>> to no avail (I also tried putting double quotes around the glob expression).
>>
>> Ideas?
>>
>> Best regards,
>>
>> -Tom
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at: 
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more 
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Compile C files with C++

2013-12-05 Thread J Decker
that works... it's path specific though, are you also using
${all_c_files} as the source names?
if your globbing ends up including the path the base source name won't
match or vice versa...

On Thu, Dec 5, 2013 at 6:16 AM, Tom Browder  wrote:
> I found this 2009 thread:
>
>   http://marc.info/?l=cmake&m=123851619629929&w=2
>
> discussing this issue and I tried all suggestions but still cannot get
> C files compiled with C++.
>
> The last suggestion was to glob all C source files and set a LANGUAGE
> CXX property on each.  I put this at the very top of my master
> CMakeLists.txt file:
>
>   file(GLOB_RECURSE all_c_files ${CMAKE_SOURCE_DIR}/src/*.c)
>   set_source_files_properties(${all_c_files} PROPERTIES LANGUAGE CXX)
>
> to no avail (I also tried putting double quotes around the glob expression).
>
> Ideas?
>
> Best regards,
>
> -Tom
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Compile C files with C++

2013-12-05 Thread Tom Browder
On Thu, Dec 5, 2013 at 8:16 AM, Tom Browder  wrote:
> I found this 2009 thread:
>
>   http://marc.info/?l=cmake&m=123851619629929&w=2

The same or equivalent issue has been filed under bugs 2360
(2009-03-05), 8851 (2009-04-06), and 12514 (2012-08011).   I see no
action since issue 12514 was last updated.

Best regards,

-Tom
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Compile C files with C++

2013-12-05 Thread Pau Garcia i Quiles
Hello,

Try with add_executable / add_library before setting the source files
properties.


On Thu, Dec 5, 2013 at 3:16 PM, Tom Browder  wrote:

> I found this 2009 thread:
>
>   http://marc.info/?l=cmake&m=123851619629929&w=2
>
> discussing this issue and I tried all suggestions but still cannot get
> C files compiled with C++.
>
> The last suggestion was to glob all C source files and set a LANGUAGE
> CXX property on each.  I put this at the very top of my master
> CMakeLists.txt file:
>
>   file(GLOB_RECURSE all_c_files ${CMAKE_SOURCE_DIR}/src/*.c)
>   set_source_files_properties(${all_c_files} PROPERTIES LANGUAGE CXX)
>
> to no avail (I also tried putting double quotes around the glob
> expression).
>
> Ideas?
>
> Best regards,
>
> -Tom
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Compile C files with C++

2013-12-05 Thread Tom Browder
I found this 2009 thread:

  http://marc.info/?l=cmake&m=123851619629929&w=2

discussing this issue and I tried all suggestions but still cannot get
C files compiled with C++.

The last suggestion was to glob all C source files and set a LANGUAGE
CXX property on each.  I put this at the very top of my master
CMakeLists.txt file:

  file(GLOB_RECURSE all_c_files ${CMAKE_SOURCE_DIR}/src/*.c)
  set_source_files_properties(${all_c_files} PROPERTIES LANGUAGE CXX)

to no avail (I also tried putting double quotes around the glob expression).

Ideas?

Best regards,

-Tom
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake + Eclipse with a team

2013-12-05 Thread Eric Noulard
2013/12/5 David Erickson :
> Hi Eric-
> Thanks for the response! See inline-
>
>
> On 12/4/2013 11:17 PM, Eric Noulard wrote:
>>
>> 2013/12/5 David Erickson :
>>>
>>> Hi All-
>>> We would like to use cmake for our build infrastructure, and Eclipse for
>>> code editing/debugging.  I found and read
>>> (http://www.vtk.org/Wiki/Eclipse_CDT4_Generator) which worked as
>>> expected..
>>> However, what became apparent is that anytime we update our source code
>>> working tree there is the possibility that another developer has added
>>> directories/files and/or changes the CMakeLists.txt file, rendering our
>>> Eclipse configuration out of date for the new code.  The two major
>>> limitations I see are:
>>>
>>> 1) Having to delete the project from Eclipse, regenerate
>>> .project/.cproject,
>>> and re-import the project anytime the source code structure changes
>>> 2) Related to the above, losing any local modifications to the project
>>> configuration made after generation when regenerating it
>>
>> When I want that I do not use Eclipse CDT generator
>> I use plain Makefile/Ninja generator and configure my own CDT project by
>> hand.
>> .project/.cproject go into the source tree whereas the generated bits goes
>> into a separate build dir (usually /build)
>
>
> This sounds like it could be a good option, although I am wondering how it
> works when you would also like to build dependent  shared libraries?  For
> example, my directory structure looks like:
>
> Top Level Directory/
> -project A/
> -- ...
> -library B/
> -- ...
> -library C/
> -- ...
>
> A depends on B, and B depends on C, each have their own CMakeList.txt file,
> and A's contains an add_subirectory call for B, and B similarly has the same
> function call for C.  I'm assuming I would want three different top level
> Eclipse projects, one each for A, B, and C, and it seems like this could be
> tricky to set up properly?

May be, I don't know.
I don't use this scheme, currently I always have single eclipse project.

>>> How are other teams dealing with these problems? Problem #1 is the much
>>> larger issue I suspect, but solving both would be ideal.
>>>
>>> As a secondary question, why doesn't the generator create a
>>> .project/.cproject in the root directory of a project,
>>
>> The usual way for CMake to deal with that is out-of-source build:
>> http://www.cmake.org/Wiki/CMake_FAQ#Out-of-source_build_trees
>> In that case every generated bits goes into "build tree",
>> this is fine but with Eclipse which does not not support to have
>> a .project/.cproject outside source if you want to have VCS work.
>>
>> You can workaround that by setting
>> ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT to 1.
>>
>> You can dig the CMake ML about out-of-source build and Eclipse and you'll
>> see more precisely what I am speaking of.
>
>
> I think my question may not have been clear (or I am misunderstanding your
> response), lets say I have:
>
> project A/
> -CMakeList.txt
> -build/
> -src/
>
> When I run cmake inside the build directory, it creates the .[c]project
> files within build, which becomes the root directory of the Eclipse project.
> Why not create the .[c]project files in the same directory as CMakeList.txt,
> but continue to put all generated output inside build/?  That way (ideally)
> there would be less symlinking needed, VCS would work, etc etc.

Yes and that the purpose of "ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT"
which makes CMake generate the .[c]project files
in the source tree and not in the build tree (as it is usually done).

This is a workaround because Eclipse is not able to handle out-of-source
project files.


-- 
Erk
L'élection n'est pas la démocratie -- http://www.le-message.org
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake + Eclipse with a team

2013-12-05 Thread Michael Jackson
I used to use Eclipse for coding with CMake and the what worked the best for me 
was the following (This assumes you are on Unix/Linux/OSX).

Start in "Project A". Create a directory "Build". Have CMake generate 
"Makefiles" using "Build" as the build directory.

Start up Eclipse. Create a new "Existing Makefile" project and during the setup 
of that project you need to adjust the build command to "make -C 
${ProjDirPath}/Build VERBOSE=1" which tells Eclipse to run make but use your 
already created Build directory with your makefiles.

Then Eclipse will show you the complete "file system" of Project A, VCS works, 
builds work (inside AND outside of Eclipse). The only downside is you get 
.project/.cproject in your Project A directory which you can have VCS easily 
ignore with a few config files. The procedure is described on the CMake wiki 
here

http://www.cmake.org/Wiki/CMake:Eclipse_UNIX_Tutorial  Look for "Option 2". 
THere are screen shots to help you through the setup.

Hope that helps.
Mike Jackson.

On Dec 5, 2013, at 3:16 AM, David Erickson  
wrote:

> Hi Eric-
> Thanks for the response! See inline-
> 
> On 12/4/2013 11:17 PM, Eric Noulard wrote:
>> 2013/12/5 David Erickson :
>>> Hi All-
>>> We would like to use cmake for our build infrastructure, and Eclipse for
>>> code editing/debugging.  I found and read
>>> (http://www.vtk.org/Wiki/Eclipse_CDT4_Generator) which worked as expected..
>>> However, what became apparent is that anytime we update our source code
>>> working tree there is the possibility that another developer has added
>>> directories/files and/or changes the CMakeLists.txt file, rendering our
>>> Eclipse configuration out of date for the new code.  The two major
>>> limitations I see are:
>>> 
>>> 1) Having to delete the project from Eclipse, regenerate .project/.cproject,
>>> and re-import the project anytime the source code structure changes
>>> 2) Related to the above, losing any local modifications to the project
>>> configuration made after generation when regenerating it
>> When I want that I do not use Eclipse CDT generator
>> I use plain Makefile/Ninja generator and configure my own CDT project by 
>> hand.
>> .project/.cproject go into the source tree whereas the generated bits goes
>> into a separate build dir (usually /build)
> 
> This sounds like it could be a good option, although I am wondering how it 
> works when you would also like to build dependent  shared libraries?  For 
> example, my directory structure looks like:
> 
> Top Level Directory/
> -project A/
> -- ...
> -library B/
> -- ...
> -library C/
> -- ...
> 
> A depends on B, and B depends on C, each have their own CMakeList.txt file, 
> and A's contains an add_subirectory call for B, and B similarly has the same 
> function call for C.  I'm assuming I would want three different top level 
> Eclipse projects, one each for A, B, and C, and it seems like this could be 
> tricky to set up properly?
> 
>> 
>>> How are other teams dealing with these problems? Problem #1 is the much
>>> larger issue I suspect, but solving both would be ideal.
>>> 
>>> As a secondary question, why doesn't the generator create a
>>> .project/.cproject in the root directory of a project,
>> The usual way for CMake to deal with that is out-of-source build:
>> http://www.cmake.org/Wiki/CMake_FAQ#Out-of-source_build_trees
>> In that case every generated bits goes into "build tree",
>> this is fine but with Eclipse which does not not support to have
>> a .project/.cproject outside source if you want to have VCS work.
>> 
>> You can workaround that by setting
>> ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT to 1.
>> 
>> You can dig the CMake ML about out-of-source build and Eclipse and you'll
>> see more precisely what I am speaking of.
> 
> I think my question may not have been clear (or I am misunderstanding your 
> response), lets say I have:
> 
> project A/
> -CMakeList.txt
> -build/
> -src/
> 
> When I run cmake inside the build directory, it creates the .[c]project files 
> within build, which becomes the root directory of the Eclipse project.  Why 
> not create the .[c]project files in the same directory as CMakeList.txt, but 
> continue to put all generated output inside build/?  That way (ideally) there 
> would be less symlinking needed, VCS would work, etc etc.
> 
>> 
>> 
>>> but just put all
>>> temporary/build data inside a build subdirectory - and create separate
>>> projects for each subdirectory?
>> Separate project for each subdir ? I don't think I get what you want.
> 
> See my top inline response, hopefully it makes it more clear, if not let me 
> know.
> 
> Thanks!
> David
> --
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.

[CMake] List of places supporting generator expressions

2013-12-05 Thread Petr Kmoch
Hi all,

I was trying to figure out whether the source file property
COMPILE_DEFINITIONS supports generator expressions and I found no clear way
how to do so (so I assume it does not, because genexes aren't mentioned in
its docs).

This got me thinking: is there a list somewhere of all contexts where
generator expressions are supported? I couldn't find anything like this in
the docs or on the Wiki. Am I missing something?

In the absence of such a list, are all contexts which use generator
expressions documented as such in the CMake docs? I.e. could a list of
genex-aware contexts be created simply by collecting all parts of the
documentation which list the genex syntax or otherwise mention genex
support?

Thanks.

Petr
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Cmake + Eclipse with a team

2013-12-05 Thread David Erickson

Hi Eric-
Thanks for the response! See inline-

On 12/4/2013 11:17 PM, Eric Noulard wrote:

2013/12/5 David Erickson :

Hi All-
We would like to use cmake for our build infrastructure, and Eclipse for
code editing/debugging.  I found and read
(http://www.vtk.org/Wiki/Eclipse_CDT4_Generator) which worked as expected..
However, what became apparent is that anytime we update our source code
working tree there is the possibility that another developer has added
directories/files and/or changes the CMakeLists.txt file, rendering our
Eclipse configuration out of date for the new code.  The two major
limitations I see are:

1) Having to delete the project from Eclipse, regenerate .project/.cproject,
and re-import the project anytime the source code structure changes
2) Related to the above, losing any local modifications to the project
configuration made after generation when regenerating it

When I want that I do not use Eclipse CDT generator
I use plain Makefile/Ninja generator and configure my own CDT project by hand.
.project/.cproject go into the source tree whereas the generated bits goes
into a separate build dir (usually /build)


This sounds like it could be a good option, although I am wondering how 
it works when you would also like to build dependent  shared libraries?  
For example, my directory structure looks like:


Top Level Directory/
-project A/
-- ...
-library B/
-- ...
-library C/
-- ...

A depends on B, and B depends on C, each have their own CMakeList.txt 
file, and A's contains an add_subirectory call for B, and B similarly 
has the same function call for C.  I'm assuming I would want three 
different top level Eclipse projects, one each for A, B, and C, and it 
seems like this could be tricky to set up properly?





How are other teams dealing with these problems? Problem #1 is the much
larger issue I suspect, but solving both would be ideal.

As a secondary question, why doesn't the generator create a
.project/.cproject in the root directory of a project,

The usual way for CMake to deal with that is out-of-source build:
http://www.cmake.org/Wiki/CMake_FAQ#Out-of-source_build_trees
In that case every generated bits goes into "build tree",
this is fine but with Eclipse which does not not support to have
a .project/.cproject outside source if you want to have VCS work.

You can workaround that by setting
ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT to 1.

You can dig the CMake ML about out-of-source build and Eclipse and you'll
see more precisely what I am speaking of.


I think my question may not have been clear (or I am misunderstanding 
your response), lets say I have:


project A/
-CMakeList.txt
-build/
-src/

When I run cmake inside the build directory, it creates the .[c]project 
files within build, which becomes the root directory of the Eclipse 
project.  Why not create the .[c]project files in the same directory as 
CMakeList.txt, but continue to put all generated output inside build/?  
That way (ideally) there would be less symlinking needed, VCS would 
work, etc etc.






but just put all
temporary/build data inside a build subdirectory - and create separate
projects for each subdirectory?

Separate project for each subdir ? I don't think I get what you want.


See my top inline response, hopefully it makes it more clear, if not let 
me know.


Thanks!
David
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake