The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15465 
====================================================================== 
Reported By:                Stephen Kelly
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15465
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-03-21 10:03 CET
Last Modified:              2015-03-21 10:03 CET
====================================================================== 
Summary:                    Provide a way to build individual files through
cmake
Description: 

CMake has the `--build` command line option providing an abstraction of 'run the
build in the specified directory' action. Particular configurations and targets
to build can be specified with other options.

A new abstraction could be added for 'build the object for sourcefile f'. 

The Makefiles generator already generates targets for each object in each
directory. Those targets are not available from the 'top level' of the build
dir.

 grantlee/make_build$ cmake .. -G "Unix Makefiles"
 grantlee/make_build$ make -C templates/lib engine.cpp.o

Ninja has native support for 'building the output of a source file' using '^'.

 grantlee/ninja_build$ cmake .. -G Ninja
 grantlee/ninja_build$ ninja ../templates/lib/engine.cpp^
 grantlee/ninja_build$ cmake --build . --target ../templates/lib/engine.cpp^

Ninja seems to build more dependencies of the object file though too (it runs
moc via automoc for example, but make seems not to).

It is unknown whether the IDE generators have a way to build an individual file.

As the syntax is different for different tools, it could be useful for cmake to
provide a unified abstraction.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-03-21 10:03 Stephen Kelly  New Issue                                    
======================================================================

-- 

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-developers

Reply via email to