[CMake] Get configuration-dependant LOCATION property

Michael Wild themiwi at gmail.com
Mon Oct 4 00:40:14 EDT 2010


On 3. Oct, 2010, at 23:53 , Mateusz Loskot wrote:

> On 03/10/10 22:27, J Decker wrote:
>> On Sun, Oct 3, 2010 at 10:28 AM, Mateusz Loskot <mateusz at loskot.net> wrote:
>>> Hi,
>>> 
>>> I understand what the manual [1] says about LOCATION property that it is
>>> more or less deprecated. Is that right?
>>> 
>>> I'm building software (shared libraries and executables) on both, Linux
>>> and Windows (using VS 2005, 2008, 2010) and I'm trying to find out what
>>> would be portable way to get target output location. It is location of
>>> output directory where toolset genreates .so or .dll files.
>>> 
>>> I tried LOCATION property but it is empty (on Windows at least)
>>> 
>>> get_target_property(MY_TARGET_LOCATION ${MY_TARGET} LOCATION)
>> 
>> get_target_property(MY_TARGET_LOCATION ${MY_TARGET}
>> LOCATION_${CMAKE_BUILD_TYPE)) ?
> 
> It does not help.
> 
> As I mentioned in my original post, ${CMAKE_BUILD_TYPE} is empty
> when you generate Visual Studio projects.
> 
> Best regards,
> -- 
> Mateusz Loskot, http://mateusz.loskot.net
> Charter Member of OSGeo, http://osgeo.org
> Member of ACCU, http://accu.org

I didn't look into the specifics of your problem, but would it be a solution to configure _all_ locations into a CMake script which performs your required action at build/test time? You could pass the configuration type as a -D parameter.

Michael

--
There is always a well-known solution to every human problem -- neat, plausible, and wrong.
H. L. Mencken

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101004/2a2a0585/attachment.pgp>


More information about the CMake mailing list