[CMake]: Bug in ADD_LIBRARY

Ken Martin ken.martin at kitware.com
Thu Jan 4 16:00:37 EST 2007


Yup, I'l check in a fix for it. add_executable does it correctly.

Thanks
Ken

Ken Martin PhD 
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971 

-----Original Message-----
From: cmake-bounces+ken.martin=kitware.com at cmake.org
[mailto:cmake-bounces+ken.martin=kitware.com at cmake.org] On Behalf Of
wedekind
Sent: Thursday, January 04, 2007 12:39 PM
To: cmake at cmake.org
Subject: [CMake]: Bug in ADD_LIBRARY

Hello all,

I guess, I've found a bug in ADD_LIBRARY. As you know, its syntax is:

ADD_LIBRARY(libname [SHARED | STATIC | MODULE] [EXCLUDE_FROM_ALL]
            source1 source2 ... sourceN)

If you specify both EXCLUDE_FROM_ALL _and_ [SHARED | STATIC | MODULE],
EXCLUDE_FROM_ALL is not considered, e.g.:

ADD_LIBRARY(someLib SHARED EXCLUDE_FROM_ALL someCode.cpp)

The ADD_LIBRARY command is not checking for a third argument to ADD_LIBRARY
in "bool cmAddLibraryCommand::InitialPass(...)".

Adding this:

  if(s != args.end())
  {
      if(*s == "EXCLUDE_FROM_ALL")
      {
         ++s;
         in_all = false;
      }
  }

after checking the second argument to ADD_LIBRARY should fix it.

Maybe other commands using EXCLUDE_FROM_ALL are also affected?

I am using a 1-month old check-out of CMake from cvs. I cannot update at the
moment... Did you already fix this?

Cheers

Marco


_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list