On 08/07/2013 03:51 PM, Loretta London wrote:
> get_target_property(cdp-exe cdp LOCATION)
> 
> This call is supposed to get the location of my executable file. This line of 
> code works correctly on Macs, but it does not work correctly on Windows. 
> Here's what happens when I attempt to get the location of my executable file 
> on Windows:
> 
> "C:/Users/Admin/Perforce/10.160.0.30_1667/llondon_multi_tenant_workspace/projects/MultiTenant_1/DMServices/build/$(Configuration)/cdp.exe"
> 
> The variable "$(Configuration)" is not set and I am not sure why and I am 
> unable to get the correct location to my executable. Are different 
> properties/calls are needed for Windows vs. Mac? Any help or advice on this 
> would be much appreciated.

In multi-configuration generators like VS and Xcode the actual build
configuration is not known at CMake time, only at build time.  The
$(Configuration) is a VS project file placeholder for the location.

See the documentation of the LOCATION property:

 http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:LOCATION

The paragraph starting with

 "For a non-imported target, this property is provided for compatibility
  with CMake 2.4 and below..."

explains what you can do instead depending on the use case.

FYI, this list is for developer discussion.  A better place to ask
usage questions is on the user list:

 http://www.cmake.org/mailman/listinfo/cmake

Thanks,
-Brad
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to