Re: [CMake] Project Folders in Visual Studio

2010-03-15 Thread Surya Kiran Gullapalli
There's a bug already reported for this.

You can find the details here

Surya
___
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

Re: [CMake] Project Folders in Visual Studio

2010-03-15 Thread Aaron_Wright
I have several libraries, each with numerous test programs, and a top 
level program. Each of these has an individual project in Visual Studio. 
In addition I have a doxygen and coverage target for each library or test 
program. And if I want to make a target depend on a file, I need to create 
a custom target that depends on that file and then make the original 
target depend on this new custom target. With any decent sized program the 
number of projects in Visual Studio can grow quickly.

-
Aaron Wright




From:
Pau Garcia i Quiles 
To:
aaron_wri...@selinc.com
Cc:
cmake@cmake.org
Date:
03/15/2010 02:42 PM
Subject:
Re: [CMake] Project Folders in Visual Studio
Sent by:
cmake-boun...@cmake.org



On Mon, Mar 15, 2010 at 7:49 PM,   wrote:
> I know this has been asked before but I don't think it got an answer. I 
have
> a situation where I have over 200 projects in Visual Studio with no
> organization. Is there anyway to put them under folders? It would really
> save me some headaches. Thanks.

I'm not sure what you are looking for, actually,

If you want each project to be in a different folder, CMake creates a
different project (thus a folder) each time you use
add_library/add_executable.

If you are looking to further split the sources in a project, take a
look at source_group.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
___
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

___
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

[CMake] Fwd: Project Folders in Visual Studio

2010-03-15 Thread John Drescher
On Mon, Mar 15, 2010 at 5:42 PM, Pau Garcia i Quiles
 wrote:
> On Mon, Mar 15, 2010 at 7:49 PM,   wrote:
>> I know this has been asked before but I don't think it got an answer. I have
>> a situation where I have over 200 projects in Visual Studio with no
>> organization. Is there anyway to put them under folders? It would really
>> save me some headaches. Thanks.
>
> I'm not sure what you are looking for, actually,
>
> If you want each project to be in a different folder, CMake creates a
> different project (thus a folder) each time you use
> add_library/add_executable.
>
> If you are looking to further split the sources in a project, take a
> look at source_group.
>
It's a grouping of projects in the solution explorer. At the top level
you can have folders (called solution folders) instead of all projects
dumped into a single view.

John



-- 
John M. Drescher
___
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


Re: [CMake] Project Folders in Visual Studio

2010-03-15 Thread Pau Garcia i Quiles
On Mon, Mar 15, 2010 at 7:49 PM,   wrote:
> I know this has been asked before but I don't think it got an answer. I have
> a situation where I have over 200 projects in Visual Studio with no
> organization. Is there anyway to put them under folders? It would really
> save me some headaches. Thanks.

I'm not sure what you are looking for, actually,

If you want each project to be in a different folder, CMake creates a
different project (thus a folder) each time you use
add_library/add_executable.

If you are looking to further split the sources in a project, take a
look at source_group.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
___
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


Re: [CMake] Fwd: Project Folders in Visual Studio

2010-03-15 Thread John Drescher
> for which putting them in solution folders to group them up
> was a good idea,

I see now. I was not aware of solution folders. Sorry for the noise.

John
___
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


[CMake] Fwd: Project Folders in Visual Studio

2010-03-15 Thread J Decker
-- Forwarded message --
From: J Decker 
Date: Mon, Mar 15, 2010 at 2:15 PM
Subject: Re: [CMake] Project Folders in Visual Studio
To: aaron_wri...@selinc.com


On Mon, Mar 15, 2010 at 11:49 AM,   wrote:
> I know this has been asked before but I don't think it got an answer. I have
> a situation where I have over 200 projects in Visual Studio with no
> organization. Is there anyway to put them under folders? It would really
> save me some headaches. Thanks.

I'd ask for the additional feature to classify sources into folders
too - this project that I'm doing used to be a lot of little
libraries, for which putting them in solution folders to group them up
was a good idea, but when I migrated to a more monolithic approach, I
put the sources still into project folders.

I haven't seen a way to sepcify either a project or source file folder
for building visual studio projects.

>
> -
> Aaron Wright
>
> ___
> 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
>
___
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


Re: [CMake] Project Folders in Visual Studio

2010-03-15 Thread John Drescher
On Mon, Mar 15, 2010 at 2:49 PM,   wrote:
> I know this has been asked before but I don't think it got an answer. I have
> a situation where I have over 200 projects in Visual Studio with no
> organization. Is there anyway to put them under folders? It would really
> save me some headaches. Thanks.
>

You are talking about class view or solution explorer. I have not seen
the ability to do this inside the Visual Studio GUI without using
cmake. As a result I break up my large projects to smaller projects so
that not everything is in one workspace.

John
___
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


[CMake] Project Folders in Visual Studio

2010-03-15 Thread Aaron_Wright
I know this has been asked before but I don't think it got an answer. I 
have a situation where I have over 200 projects in Visual Studio with no 
organization. Is there anyway to put them under folders? It would really 
save me some headaches. Thanks.

-
Aaron Wright
___
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

Re: [CMake] [PATCH] Support multiple arguments in CC,CXX,FC values

2010-03-15 Thread Alan W. Irwin

On 2010-03-15 09:07-0400 Brad King wrote:


Teach compiler identification to support values such as

 export CC='gcc -g -O2'

by separating the arguments on spaces.  We already do this for the
values of CFLAGS, CXXFLAGS, and FFLAGS.
---

Hi Alan,
Anyway, this patch should fix it.  Please test.


I applied that one-liner to rc4, and now my simple test project with

export CC='gcc -g -g'

and also the whole PLplot build with

export CC='gcc -g -fvisibility=hidden'
export CXX='g++ -g -fvisibility=hidden'
export FC='gfortran -g -fvisibility=hidden'

works properly again.

Thanks for this fix!

I hope it gets into 2.8.1.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__
___
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


Re: [CMake] [PATCH] Support multiple arguments in CC,CXX,FC values

2010-03-15 Thread Michael Wild

On 15. Mar, 2010, at 14:59 , Brad King wrote:

> Michael Wild wrote:
>> On 15. Mar, 2010, at 14:37 , Brad King wrote:
>>> using the "PROGRAM/PROGRAM_ARGS" option of get_filename_component()
>>> which already accounts for spaces in the path.  It uses an algorithm
>>> similar to what the Windows command prompt does.  It works backwards
>>> from the end and tries using everything to the left of each space
>>> as a file name until something is found.
>> 
>> Now, that's cool. Would be even better if this option was documented ;-)
> 
> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:get_filename_component
> 
> "If PROGRAM_ARGS is present with PROGRAM, then any command-line
> arguments present in the FileName string are split from the
> program name and stored in ArgVar. This is used to separate a
> program name from its arguments in a command line string."
> 
> -Brad

*blush* Really embarrassing, never read past the first paragraph, somehow 
assumed that all signatures are covered by the first synopsis...

Michael
___
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


Re: [CMake] [PATCH] Support multiple arguments in CC,CXX,FC values

2010-03-15 Thread Brad King
Michael Wild wrote:
> On 15. Mar, 2010, at 14:37 , Brad King wrote:
>> using the "PROGRAM/PROGRAM_ARGS" option of get_filename_component()
>> which already accounts for spaces in the path.  It uses an algorithm
>> similar to what the Windows command prompt does.  It works backwards
>> from the end and tries using everything to the left of each space
>> as a file name until something is found.
> 
> Now, that's cool. Would be even better if this option was documented ;-)

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:get_filename_component

"If PROGRAM_ARGS is present with PROGRAM, then any command-line
 arguments present in the FileName string are split from the
 program name and stored in ArgVar. This is used to separate a
 program name from its arguments in a command line string."

-Brad
___
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


Re: [CMake] [PATCH] Support multiple arguments in CC,CXX,FC values

2010-03-15 Thread Michael Wild

On 15. Mar, 2010, at 14:37 , Brad King wrote:

> Michael Wild wrote:
>> Won't that fail for compiler-installations with spaces in the path
>> (admittedly a bad idea, but on Windows probably not that unlikely)?
> 
> By the time the new code is reached we've already split the arguments
> from the compiler itself.  This is done in CMakeDetermineCCompiler.cmake
> using the "PROGRAM/PROGRAM_ARGS" option of get_filename_component()
> which already accounts for spaces in the path.  It uses an algorithm
> similar to what the Windows command prompt does.  It works backwards
> from the end and tries using everything to the left of each space
> as a file name until something is found.

Now, that's cool. Would be even better if this option was documented ;-)

> 
> What this could change is if a single argument to the compiler really
> needs a space.  However this already doesn't work in the case of the
> standard CFLAGS, CXXFLAGS, and FFLAGS variables.
> 
> -Brad

Sorry for the noise...

Michael
___
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


Re: [CMake] [PATCH] Support multiple arguments in CC,CXX,FC values

2010-03-15 Thread Brad King
Michael Wild wrote:
> Won't that fail for compiler-installations with spaces in the path
> (admittedly a bad idea, but on Windows probably not that unlikely)?

By the time the new code is reached we've already split the arguments
from the compiler itself.  This is done in CMakeDetermineCCompiler.cmake
using the "PROGRAM/PROGRAM_ARGS" option of get_filename_component()
which already accounts for spaces in the path.  It uses an algorithm
similar to what the Windows command prompt does.  It works backwards
from the end and tries using everything to the left of each space
as a file name until something is found.

What this could change is if a single argument to the compiler really
needs a space.  However this already doesn't work in the case of the
standard CFLAGS, CXXFLAGS, and FFLAGS variables.

-Brad
___
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


Re: [CMake] [PATCH] Support multiple arguments in CC,CXX,FC values

2010-03-15 Thread Michael Wild

On 15. Mar, 2010, at 14:07 , Brad King wrote:
> Anyway, this patch should fix it.  Please test.
> 
> Thanks,
> -Brad
> 
> 
> Modules/CMakeDetermineCompilerId.cmake |1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/Modules/CMakeDetermineCompilerId.cmake 
> b/Modules/CMakeDetermineCompilerId.cmake
> index bddd6a1..4a800a8 100644
> --- a/Modules/CMakeDetermineCompilerId.cmake
> +++ b/Modules/CMakeDetermineCompilerId.cmake
> @@ -19,6 +19,7 @@
> FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
>   # Make sure the compiler arguments are clean.
>   STRING(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" 
> CMAKE_${lang}_COMPILER_ID_ARG1)
> +  STRING(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 
> "${CMAKE_${lang}_COMPILER_ID_ARG1}")
> 
>   # Make sure user-specified compiler flags are used.
>   IF(CMAKE_${lang}_FLAGS)
> -- 
> 1.6.6.1

Won't that fail for compiler-installations with spaces in the path (admittedly 
a bad idea, but on Windows probably not that unlikely)?

Michael
___
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


[CMake] [PATCH] Support multiple arguments in CC,CXX,FC values

2010-03-15 Thread Brad King
Teach compiler identification to support values such as

  export CC='gcc -g -O2'

by separating the arguments on spaces.  We already do this for the
values of CFLAGS, CXXFLAGS, and FFLAGS.
---

Hi Alan,

The standard way to do the "set and forget" approach with environment
variables is

  export CC=gcc
  export CXX=g++
  export FC=gfortran
  export CFLAGS='-g -fvisibility=hidden'
  export CXXFLAGS='-g -fvisibility=hidden'
  export FFLAGS='-g -fvisibility=hidden'

An argument in the "CC" value is meant for wrappers like ccache:

  export CC="ccache gcc"
  export CXX="ccache g++"
  export FC="ccache gfortran"

which take only *one* argument.

Alan W. Irwin wrote:
> I expect the dropped -fPIC problem will occur whenever there are two flags
> of any kind.

It's not just the -fPIC that gets dropped.  The whole compiler
identification fails:

  -- The C compiler identification is unknown
  -- The CXX compiler identification is unknown
  -- The Fortran compiler identification is unknown

Once that happens then the flag lookup fails for all kinds of things
including -fPIC.  An error is reported in CMakeFiles/CMakeError.log:

  Compiling the C compiler identification source file "CMakeCCompilerId.c" 
failed.
  Compiler: /usr/bin/gcc -g -fvisibility=hidden
  ...
  cc1: error: unrecognised debug output level " -fvisibility=hidden"

I can reproduce this error message with

  $ touch foo.c
  $ gcc '-g -fvisibility=hidden' foo.c
  cc1: error: unrecognised debug output level " -fvisibility=hidden"

During compiler identification all arguments get treated as a single
argument with spaces.  AFAIK this never worked, but in earlier CMake
versions we used a different scheme to add -fPIC and other platform
flags that did not depend on the compiler identification (but which
failed in other cases).

Anyway, this patch should fix it.  Please test.

Thanks,
-Brad


 Modules/CMakeDetermineCompilerId.cmake |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Modules/CMakeDetermineCompilerId.cmake 
b/Modules/CMakeDetermineCompilerId.cmake
index bddd6a1..4a800a8 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -19,6 +19,7 @@
 FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
   # Make sure the compiler arguments are clean.
   STRING(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
+  STRING(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 
"${CMAKE_${lang}_COMPILER_ID_ARG1}")

   # Make sure user-specified compiler flags are used.
   IF(CMAKE_${lang}_FLAGS)
-- 
1.6.6.1

___
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