ADD_CUSTOM_TARGET

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ADD_CUSTOM_TARGET

Brad Bell
I am trying to build a project for Red-hat 6 which uses the following
cmake version
     bradbell@gorst trash]$ cmake --version
     cmake version 2.6-patch 4

While doing so I am having trouble with the ADD_CUSTOM_TARGET. To be
specifc, after building a custom target, cmake seems to forget it has
done so.

Below is an example CMakeLists for which
     make check
works with cmake 2.8.9 and fails with 2.6-patch 4:
     CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
     #
     PROJECT(hello)
     #
     ADD_EXECUTABLE(hello_one EXCLUDE_FROM_ALL hello_one.cpp )
     ADD_EXECUTABLE(hello_two EXCLUDE_FROM_ALL hello_two.cpp )
     #
     ADD_CUSTOM_TARGET(check_one hello_one DEPENDS hello_one)
     ADD_CUSTOM_TARGET(check_two hello_two DEPENDS hello_two)
     #
     ADD_CUSTOM_TARGET(check DEPENDS check_one check_two)

I am attaching a bash script that creates the necessary files and runs
the make check command. The output I get on Red-Hat 6 is

[bradbell@gorst trash]$ ./cmake_target.sh
-- 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]$





--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

cmake_target.sh (1014 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ADD_CUSTOM_TARGET

Alexander Neundorf-3
On Tuesday 15 January 2013, Brad Bell wrote:

> I am trying to build a project for Red-hat 6 which uses the following
> cmake version
>      bradbell@gorst trash]$ cmake --version
>      cmake version 2.6-patch 4
>
> While doing so I am having trouble with the ADD_CUSTOM_TARGET. To be
> specifc, after building a custom target, cmake seems to forget it has
> done so.
>
> Below is an example CMakeLists for which
>      make check
> works with cmake 2.8.9 and fails with 2.6-patch 4:

I tested, it works since cmake 2.8.4.

And what was the exact problem ?

Alex
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: ADD_CUSTOM_TARGET

Brad Bell
The problem is that the script fails when using cmake 2.6. I want to know
if this is expected or a bug ?

I filed a bug report with Red-Hat 6, but they just decided to ignore it. See
        https://bugzilla.redhat.com/show_bug.cgi?id=896116

Perhaps someone knows a way around this problem ?


> On Tuesday 15 January 2013, Brad Bell wrote:
>> I am trying to build a project for Red-hat 6 which uses the following
>> cmake version
>>      bradbell@gorst trash]$ cmake --version
>>      cmake version 2.6-patch 4
>>
>> While doing so I am having trouble with the ADD_CUSTOM_TARGET. To be
>> specifc, after building a custom target, cmake seems to forget it has
>> done so.
>>
>> Below is an example CMakeLists for which
>>      make check
>> works with cmake 2.8.9 and fails with 2.6-patch 4:
>
> I tested, it works since cmake 2.8.4.
>
> And what was the exact problem ?
>
> Alex
>


--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: ADD_CUSTOM_TARGET

Andreas Pakulat-2
Hi,

On Wed, Jan 16, 2013 at 11:01 PM,  <[hidden email]> wrote:
> The problem is that the script fails when using cmake 2.6. I want to know
> if this is expected or a bug ?
>
> I filed a bug report with Red-Hat 6, but they just decided to ignore it. See
>         https://bugzilla.redhat.com/show_bug.cgi?id=896116
>
> Perhaps someone knows a way around this problem ?

Download and extract an up-to-date cmake tarball and use that cmake
version would be one way to workaround a possible bug in an older
cmake version and a distro unwilling/unable to upgrade cmake.

Andreas
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: ADD_CUSTOM_TARGET

Brad Bell
On 01/16/2013 02:21 PM, Andreas Pakulat wrote:

> Hi,
>
> On Wed, Jan 16, 2013 at 11:01 PM,  <[hidden email]> wrote:
>> The problem is that the script fails when using cmake 2.6. I want to know
>> if this is expected or a bug ?
>>
>> I filed a bug report with Red-Hat 6, but they just decided to ignore it. See
>>          https://bugzilla.redhat.com/show_bug.cgi?id=896116
>>
>> Perhaps someone knows a way around this problem ?
> Download and extract an up-to-date cmake tarball and use that cmake
> version would be one way to workaround a possible bug in an older
> cmake version and a distro unwilling/unable to upgrade cmake.
>
> Andreas
>
The problem is that am building an el6 package that yum will install for
the user and must use packages from their standard locations when doing so.

It seems that bug fixes are no longer being applied to CMake 2.6 and
that the version on Red-Hat 6 is no longer supported ?
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake