Re: [CMake] TARGET property LOCATION

2013-11-27 Thread Andreas Mohr
Hi,

On Tue, Nov 26, 2013 at 12:00:10PM -0500, cmake-requ...@cmake.org wrote:
> Date: Tue, 26 Nov 2013 12:13:16 +0100
> From: Marcel Loose 
> Subject: [CMake] TARGET property LOCATION

> Hi all,
> 
> According to the CMake documentation, the TARGET property LOCATION for a
> non-imported target is provided for compatibility with CMake 2.4 and
> below. My question is: are there any plans to deprecate this property? I
> want to know, because AFAIK, the only way to determine the full path to
> a built target is to use this property.

Yeah, a very good question. Especially since for somewhat older
(I assume that these already were a bit newer than the LOCATION deprecation 
event though!)
CMake versions I have a need for the following conditional code
(or similar to it - not 100% sure whether LOCATION is the only way to handle 
it):


# CMake add_test() has a plain signature and additionally a NAME/COMMAND 
signature
# in newer versions.
# Since I somehow managed to completely miss this,
# I filed a CMake bug report (#12589).
# Let's thus use the newer signature whenever it's supported.
set(cmake_add_test_command_signature_supported_ false)
set(cmake_version_add_test_command_signature_not_supported_last "2.7.0") # 
FIXME which version?
set(cmake_version_add_test_supports_command_signature_check 
"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
if("${cmake_version_add_test_supports_command_signature_check}" VERSION_GREATER 
"${cmake_version_add_test_command_signature_not_supported_last}")
  set(cmake_add_test_command_signature_supported_ true)
endif("${cmake_version_add_test_supports_command_signature_check}" 
VERSION_GREATER 
"${cmake_version_add_test_command_signature_not_supported_last}")

if(cmake_add_test_command_signature_supported_)
  function(_ctest_add_test_sanitized _target)
set(testname_ "${_target}")
set(testexe_ "${_target}")
add_test(NAME "${testname_}" COMMAND "${testexe_}")
  endfunction(_ctest_add_test_sanitized _target)
else(cmake_add_test_command_signature_supported_)
  function(_ctest_add_test_sanitized _target)
set(testname_ "${_target}")
# Work around incapable add_test(), by using a property which
# is said to be ""deprecated""... (*** SIGH ***).
get_property(test_location_ TARGET "${_target}" PROPERTY LOCATION)
set(testexe_ "${test_location_}")
add_test("${testname_}" "${testexe_}")
  endfunction(_ctest_add_test_sanitized _target)
endif(cmake_add_test_command_signature_supported_)


> Best regards,
> Marcel Loose.

Andreas Mohr
--

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://www.cmake.org/mailman/listinfo/cmake


[CMake] TARGET property LOCATION

2013-11-26 Thread Marcel Loose
Hi all,

According to the CMake documentation, the TARGET property LOCATION for a
non-imported target is provided for compatibility with CMake 2.4 and
below. My question is: are there any plans to deprecate this property? I
want to know, because AFAIK, the only way to determine the full path to
a built target is to use this property.

Best regards,
Marcel Loose.

<>--

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://www.cmake.org/mailman/listinfo/cmake

[CMake] Target property LOCATION doesn't handle DEBUG_POSTFIX

2009-04-30 Thread Stephan Diederich
Hi,

subject says all, here's the CMakeLists.txt:
--
cmake_minimum_required(VERSION 2.6)
project(locate_test)

add_executable(location_test main.cpp)
set_target_properties(location_test PROPERTIES DEBUG_POSTFIX "d")

get_target_property(output location_test LOCATION)
message(${output})
--
running cmake with "cmake ../ -DCMAKE_BUILD_TYPE=Debug" gives:
[...]
-- Detecting CXX compiler ABI info - done
/home/diederich/projects/tests/cmake/build/location_test
-- Configuring done
-- Generating done
-- Build files have been written to: /home/diederich/projects/tests/cmake/build

Is this the expected behaviour?

After digging through Mantis I've found this (somehow) related bug-report:
http://public.kitware.com/Bug/view.php?id=7868
and if I get it right, it states LOCATION can't be used for that.

Problem is, I want to pass a plugin I generate to an executable in
ADD_TEST like this:
ADD_TEST(check_LIBA_for_unresolved_symbols myBinary ${BUILT_PLUGIN}

Any hints how to do this?

Thanks in advance,
Stephan
___
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