Bug 896116

Summary: cmake add_custom_target not working
Product: Red Hat Enterprise Linux 6 Reporter: Brad Bell <bradbell>
Component: cmakeAssignee: Patsy Griffin <pfrankli>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3CC: bgollahe, law, lsmid, mcermak, mnewsome, nobody+abrt-devel-list, orion, tlavigne
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 07:11:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 606892    
Bug Blocks:    
Attachments:
Description Flags
Bash script that demonstrates the bug none

Description Brad Bell 2013-01-16 16:33:47 UTC
Created attachment 679703 [details]
Bash script that demonstrates the bug

Description of problem:
After building a custom target, cmake seems to forget it has done so. 

How reproducible:
Always.

Steps to Reproduce:
Run the attached bash script. Note that the created the sub-directory build (of the current working directory) where files are created and cmake is run.

------------------------------------
Actual results: (run on Redhat 6.3):
------------------------------------
[bradbell@gorst trash]$ ./cmake_target.sh
Linux gorst.ihme.washington.edu 2.6.32-279.9.1.el6.x86_64 #1 SMP Fri Aug 31 09:04:24 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
cmake version 2.6-patch 4
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /homes/bradbell/trash/build
Scanning dependencies of target hello_two
[ 50%] Building CXX object CMakeFiles/hello_two.dir/hello_two.cpp.o
Linking CXX executable hello_two
[ 50%] Built target hello_two
Scanning dependencies of target check_two
hello_two

[ 50%] Built target check_two
Scanning dependencies of target hello_one
[100%] Building CXX object CMakeFiles/hello_one.dir/hello_one.cpp.o
Linking CXX executable hello_one
[100%] Built target hello_one
Scanning dependencies of target check_one
hello_one

[100%] Built target check_one
Scanning dependencies of target check
make[3]: *** No rule to make target `check_one', needed by `CMakeFiles/check'.  Stop.
make[2]: *** [CMakeFiles/check.dir/all] Error 2
make[1]: *** [CMakeFiles/check.dir/rule] Error 2
make: *** [check] Error 2
[bradbell@gorst trash]$ 


------------------------------------
Expected results: (run on Fedora 17)
------------------------------------
[bradbell@brad bug]$ ./cmake_target.sh
Linux brad.home 3.6.10-2.fc17.x86_64 #1 SMP Tue Dec 11 18:07:34 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
cmake version 2.8.9
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bradbell/cppad/trunk/bug/build
Scanning dependencies of target hello_one
[ 50%] Building CXX object CMakeFiles/hello_one.dir/hello_one.cpp.o
Linking CXX executable hello_one
[ 50%] Built target hello_one
Scanning dependencies of target check_one
hello_one

[ 50%] Built target check_one
Scanning dependencies of target hello_two
[100%] Building CXX object CMakeFiles/hello_two.dir/hello_two.cpp.o
Linking CXX executable hello_two
[100%] Built target hello_two
Scanning dependencies of target check_two
hello_two

[100%] Built target check_two
Scanning dependencies of target check
[100%] Built target check
[bradbell@brad bug]$ 

-----------------
Additional info:
-----------------
I have posted this on the cmake mailing list and, as yet, have not gotten a reply; see
    http://www.cmake.org/pipermail/cmake/2013-January/053213.html

Perhaps upgrading to cmake 2.8 as suggested by
    https://bugzilla.redhat.com/show_bug.cgi?id=606892
would solve this problem (since that is what is running on Fedora 17)

This is causing the el6 cppad build to fail. A copy of the attached script can be found at
    https://projects.coin-or.org/CppAD/browser/trunk/bug/cmake_target.sh

Comment 2 RHEL Program Management 2013-01-16 18:10:23 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 3 Orion Poplawski 2014-03-05 17:13:33 UTC
FYI - cmake28 is available from Fedora EPEL.

Comment 8 errata-xmlrpc 2014-10-14 07:11:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1506.html