Re: [CMake] Help with Policy CMP0026 (disallow LOCATION target property)

2014-12-24 Thread Paul Smith
On Tue, 2014-12-23 at 16:59 -0500, David Cole wrote:
> Are you sure there's a problem using TARGET_FILE in your original
> context?

> You should be able to use that in a custom command in your custom
> stage_tgt target...
> 
> You have to give the name of the target for the TARGET_FILE generator
> expression, so it should work for any target that cmake knows about.
> 
> Can you point to a simplified reproducible case where this does not
> work?
> 
> Maybe there's some other complication in your real project that is
> making it seem like it's not working but I think it should. Can
> you send us any code?

Thanks for the reply David.

The complication is that the rule I'm trying to create that copies files
uses the destination file as the target, so I'm using the target name in
the OUTPUT section of add_custom_command.  Basically, my current
implementation is like this:

  function(stageobj target dir)
  get_property(targetpath TARGET ${target} PROPERTY LOCATION)
  get_filename_component(targetname ${targetpath} NAME)
  add_custom_command(OUTPUT "${DESTDIR}/${dir}/${targetname}"
  COMMAND "${CMAKE_COMMAND}" -E make_directory "${DESTDIR}/${dir}"
  COMMAND "${CMAKE_COMMAND}" -E copy "${targetpath}" "${DESTDIR}/${dir}"
  DEPENDS ${target}
  COMMENT "Staging ${target} to ${DESTDIR}/${dir}"
  VERBATIM)

  add_custom_target("stage_${target}" ALL DEPENDS 
"${DESTDIR}/${dir}/${target}")
  endfunction()

This has the very nice feature that it's a real rule, and it only fires
if needed (that is, ${target} has been updated since the last time we
copied it).

But, I can't replace "${targetname}" in the OUTPUT section with a
generator expression, because they don't seem to be allowed there:

  CMake Error at CMake/Stage.cmake:93 (add_custom_command):
add_custom_command called with OUTPUT containing a "<".  This character is
not allowed.

Thoughts or alternatives are welcome...

-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Help with Policy CMP0026 (disallow LOCATION target property)

2014-12-24 Thread Paul Smith
On Tue, 2014-12-23 at 21:32 +, Parag Chandra wrote:
> Have you tried the CMake variables LIBRARY_OUTPUT_PATH and
> EXECUTABLE_OUTPUT_PATH? I¹ve been using them to accomplish much the
> same thing.

Well, I don't want ALL my executables and libraries to go into these
locations.  Only specific ones.  However, I see that there's a target
property RUNTIME_OUTPUT_DIRECTORY, etc. so maybe setting that property
would be an option.

When I first started messing with this cmake environment we had a batch
of scripts, etc. that were using the original location so I really
needed things to live in both locations, for backward compatibility.
But at this point I'm pretty sure no one uses the original locations
anymore so this could work.  I'll look into it.

-- 

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://public.kitware.com/mailman/listinfo/cmake

[CMake] PHP Composer

2014-12-24 Thread Chris Johnson
Has anyone out there used CMake to build a PHP Phar file, and more
interestingly, used CMake to install a PHP project which uses Composer for
dependency management?

If so, could you share some information about what your custom commands and
custom targets must look like to get this to work?

Thanks,
..chris
-- 

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://public.kitware.com/mailman/listinfo/cmake

[CMake] Simultaneous makes?

2014-12-24 Thread Chris Johnson
One of my co-workers likes to start multiple makes in various parts of his
project source tree.  Under our old Makefile-based, build-in-source system,
this worked fine. Under our new CMake-based, out-of-source build system,
this causes problems, since any make might cause CMake to rebuild its
internal files.

Is this a "don't do that" problem, or can CMake be used in a manner where
it is smart enough not to step on its own toes?

Thanks,
..chris
-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Simultaneous makes?

2014-12-24 Thread Rolf Eike Beer
Am Mittwoch, 24. Dezember 2014, 10:17:07 schrieb Chris Johnson:
> One of my co-workers likes to start multiple makes in various parts of his
> project source tree.  Under our old Makefile-based, build-in-source system,
> this worked fine. Under our new CMake-based, out-of-source build system,
> this causes problems, since any make might cause CMake to rebuild its
> internal files.
> 
> Is this a "don't do that" problem, or can CMake be used in a manner where
> it is smart enough not to step on its own toes?

He should just use "make -j something".

Eike

signature.asc
Description: This is a digitally signed message part.
-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Simultaneous makes?

2014-12-24 Thread Chris Johnson
Perhaps I need to clarify.

It's a very large project with many directories and interdependent
libraries.  So he is starting a make in one library, and then working on a
program in another subtree of the same project, and running a make there.

Since the entire project shares just one large build tree out-of-source,
both compiles share the same CMakeCache.txt and CMakeFiles/*.

This is not a case of "parallel" makes (-j N) started from one directory.

Thanks,
..chris

On Wed, Dec 24, 2014 at 10:22 AM, Rolf Eike Beer  wrote:

> Am Mittwoch, 24. Dezember 2014, 10:17:07 schrieb Chris Johnson:
> > One of my co-workers likes to start multiple makes in various parts of
> his
> > project source tree.  Under our old Makefile-based, build-in-source
> system,
> > this worked fine. Under our new CMake-based, out-of-source build system,
> > this causes problems, since any make might cause CMake to rebuild its
> > internal files.
> >
> > Is this a "don't do that" problem, or can CMake be used in a manner where
> > it is smart enough not to step on its own toes?
>
> He should just use "make -j something".
>
> Eike
> --
>
> 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://public.kitware.com/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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Simultaneous makes?

2014-12-24 Thread Alan W. Irwin

On 2014-12-24 11:07-0600 Chris Johnson wrote:


Perhaps I need to clarify.

It's a very large project with many directories and interdependent
libraries.  So he is starting a make in one library, and then working on a
program in another subtree of the same project, and running a make there.

Since the entire project shares just one large build tree out-of-source,
both compiles share the same CMakeCache.txt and CMakeFiles/*.

This is not a case of "parallel" makes (-j N) started from one directory.


Hi Chris:

I haven't used it myself that way, but my understanding is CMake deals
well with the issue of building extremely large sets of interdependent
software libraries. I therefore suggest you take a look at some large
software projects (e.g., KDE and/or VTK, but perhaps others here have
additional examples) to see how those software projects organize their
builds with CMake.  That may give you some ideas on how to avoid the
build issue you have discovered for the current way you organize the
build of your interdependent set of libraries.

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); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); 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

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://public.kitware.com/mailman/listinfo/cmake