On Mon, Dec 28, 2009 at 9:26 PM, Koen Deforche <[email protected]> wrote:
> Hey Pau,
>
> 2009/12/28 Pau Garcia i Quiles <[email protected]>:
>> While looking into the static linkage issues (I'll send my reply to
>> that later today), I've noticed two more issues:
>>
>> * First one is target 'doc' is being created as many times as you call
>> the ASCIIDOC_FILE macro:
>>
>> IF (ASCIIDOC_FOUND)
>>  MACRO (ASCIIDOC_FILE target infile outfile)
>>    ADD_CUSTOM_TARGET(${target}
>>       ${ASCIIDOC_EXECUTABLE} -a toc -a numbered -o ${outfile} ${infile}
>>       COMMENT "Asciidoc ${infile}")
>>    ADD_CUSTOM_TARGET(doc)
>>    ADD_DEPENDENCIES(doc ${target})
>>  ENDMACRO (ASCIIDOC_FILE)
>> ENDIF (ASCIIDOC_FOUND)
>>
>> An easy way to avoid that is moving that ADD_CUSTOM_TARGET(doc) out of the 
>> MACRO
>
> That was the way we had it going first, but that seems not to work
> with CMake 2.4

It's been a long time since CMake 2.4. I can't remember any reason
(other than a bug) why my proposed solution would not work with CMake
2.4. What patch release was it? 2.4.8? Earlier?

> Does having the multiple ADD_CUSTOM_TARGET(...) have
> any bad consequences ?

It's not obvious from the CMake docs (see below) but it might happen
that the latest target overwrites the older one, i. e. only the latest
add_custom_target( duplicatedname ) would take effect.

$ cmake --help-policy CMP0002
cmake version 2.8.0
  CMP0002
       Logical target names must be globally unique.

       Targets names created with add_executable, add_library, or
       add_custom_target are logical build target names.  Logical target
       names must be globally unique because:

         - Unique names may be referenced unambiguously both in CMake
           code and on make tool command lines.
         - Logical names are used by Xcode and VS IDE generators
           to produce meaningful project names for the targets.

       The logical name of executable and library targets does not have to
       correspond to the physical file names built.  Consider using the
       OUTPUT_NAME target property to create two targets with the same
       physical name while keeping logical names distinct.  Custom targets
       must simply have globally unique names (unless one uses the global
       property ALLOW_DUPLICATE_CUSTOM_TARGETS with a Makefiles generator).

       This policy was introduced in CMake version 2.6.0.  CMake version
       2.8.0 warns when the policy is not set and uses OLD behavior.  Use the
       cmake_policy command to set it to OLD or NEW explicitly.


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

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to