[cmake-developers] [CMake 0015995]: GHS Multi Generator: add_custom_command / add_custom_target does not work

Mantis Bug Tracker mantis at public.kitware.com
Tue Mar 1 07:42:04 EST 2016


The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=15995 
====================================================================== 
Reported By:                stw_sesa
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15995
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-03-01 07:42 EST
Last Modified:              2016-03-01 07:42 EST
====================================================================== 
Summary:                    GHS Multi Generator: add_custom_command /
add_custom_target does not work
Description: 
The GHS Multi Generator does not handle custom commands added via 
add_custom_command() correctly / at all. The custom commands are not used in the
generated project files and never executed.
Instead the default compiler seems to be called, which obviously fails.

Steps to Reproduce: 
Create a simple CMakeLists.txt like this:

# CMakeLists.txt
cmake_minimum_required (VERSION 2.8)
add_custom_target (a_txt ALL DEPENDS a.txt)
add_custom_command (OUTPUT a.txt COMMAND type b.txt > a.txt DEPENDS b.txt)
add_custom_command (OUTPUT b.txt COMMAND type c.txt > b.txt DEPENDS c.txt)
file(WRITE ${CMAKE_BINARY_DIR}/c.txt "hello world" )

-----------------------------------

Generate the GHC Project using CMake and try to build it.
Output from the build:

Building D:\cmake-ghc\build\custom_target_test_ghc\default.gpj
Output from Linking a_txt.gpj:

ccintarm: Error: output file 'a_txt' is a directory.

Error: build failed
Build failed (Tue Mar 01 13:32:50 2016)
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-03-01 07:42 stw_sesa       New Issue                                    
======================================================================



More information about the cmake-developers mailing list