[CMake] Creating one Visual Studio solution for many configurations and platforms

James Bigler jamesbigler at gmail.com
Mon Jun 8 12:13:55 EDT 2009


On Mon, Jun 8, 2009 at 9:59 AM, Tyler Roscoe <tyler at cryptio.net> wrote:

> On Mon, Jun 08, 2009 at 09:55:13AM -0600, James Bigler wrote:
> > I shudder to think of having to multiply all of my find_library calls
> with
> > architecture dependent versions:
>
> It sounds like you already do this?


Well, it's done a per configuration basis.  I only have to find one library,
either 32 or 64 bit.  If I have to find both, I now need to call
find_library twice for each architecture.  This also means, I need to keep
track of two library variables (one for 32 and one for 64) since the same
variable can't be used twice.


>
> > There are many places in my code where I have switches based on 32 or 64
> bit
> > architectures.
>
> Anyway, perhaps a CombinedWin32AndX64InOneGenerator should be Yet
> Another Generator so that developers already happy with the separate
> generators for 32 vs 64 can simply continue to do what they're already
> doing?
>
> I realize that the purpose of this exercise is to prevent the
> proliferation of generators, but maybe "one more" for this particular
> case is worthwhile?


I'm still not convinced that a new generator would solve all of your
problems.  In fact, I think this would make it worse, because now I have to
have a switch to accommodate the new generator.

if(CMAKE_GENERATOR MATCHES "CombinedWin32AndX64InOneGenerator")
  find_library(project_library32 ...)
  find_library(project_library64 ...)
  set(project_library ARCH32 ${project_library32} ARCH64
${project_library64})
else()
  find_library(project_library ...)
endif()


James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090608/cd6ba3ac/attachment.htm>


More information about the CMake mailing list