Re: [CMake] set_property imported_location_release

2018-12-21 Thread Lars
That is what I thought. Thank you.

Fra: Marc CHEVRIER 
Sendt: fredag 21. desember 2018 15.46.18
Til: cmake@cmake.org; Lars
Emne: Re: Sv: [CMake] set_property imported_location_release

Yes, the most efficient way is using conditional setting. For example:

if (CMAKE_SIZEOF_VOID_P EQUAL 4)
  set(import_path /to/lib32)
else()
  set(import_path /to/lib64)
endif()

set_property(TARGET foo PROPERTY IMPORT_LOCATION "${import_path}/lib.so")

Le 21 déc. 2018 à 15:14 +0100, Lars , a écrit :
Marc,

Appreciate the quick and helpful response.

In a config file that supports multiple platforms, do I need to create 
import_location_path variable and populate it depending on platform and 32/64 
etc? Any other options?

Thanks.

Kind regards, Lars


Fra: Marc CHEVRIER 
Sendt: fredag 21. desember 2018 13.41
Til: cmake@cmake.org; Lars
Emne: Re: [CMake] set_property imported_location_release

Properties IMPORTED_LOCATION* do not support generator expressions.

Generally speaking, if a property supports generator expression, it is 
explicitly specified in documentation.
Le 21 déc. 2018 à 13:07 +0100, Lars , a écrit :
Hello,

Trying to import an external library but having some issue with setting 
imported_location_release property.

Basically I have config file which does this;
add_library(foo STATIC IMPORTED)
set_property(target foo APPEND PROPERTY
   interface_include_directories
"$"
"$")

set_property(TARGET foo APPEND PROPERTY
  IMPORTED_LOCATION_RELEASE
$<$:${foo_root}/lib/release/foo.a>)

The imported target is used in a target_link_libraries method;
target_link_libraries(an_application foo)

Running CMake 3.6.1 does not produce any warnings. Running make I get a "target 
pattern contains no '%'" error message with a reference to a Build.make file.

The Build.make contains the string " 
$<$:/tmp/prototype/foo/lib/release/foo.a".  We did not 
expect to see the generator expression in the Build.make file.

Does set_property support generator expression in this context? What are we 
doing wrong?

Appreciate any help :-)

king regards, Lars

--

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

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


Re: [CMake] set_property imported_location_release

2018-12-21 Thread Marc CHEVRIER
Yes, the most efficient way is using conditional setting. For example:

if (CMAKE_SIZEOF_VOID_P EQUAL 4)
  set(import_path /to/lib32)
else()
  set(import_path /to/lib64)
endif()

set_property(TARGET foo PROPERTY IMPORT_LOCATION "${import_path}/lib.so")

Le 21 déc. 2018 à 15:14 +0100, Lars , a écrit :
> Marc,
>
> Appreciate the quick and helpful response.
>
> In a config file that supports multiple platforms, do I need to create 
> import_location_path variable and populate it depending on platform and 32/64 
> etc? Any other options?
>
> Thanks.
>
> Kind regards, Lars
>
> Fra: Marc CHEVRIER 
> Sendt: fredag 21. desember 2018 13.41
> Til: cmake@cmake.org; Lars
> Emne: Re: [CMake] set_property imported_location_release
>
> Properties IMPORTED_LOCATION* do not support generator expressions.
>
> Generally speaking, if a property supports generator expression, it is 
> explicitly specified in documentation.
> Le 21 déc. 2018 à 13:07 +0100, Lars , a écrit :
> > Hello,
> >
> > Trying to import an external library but having some issue with setting 
> > imported_location_release property.
> >
> > Basically I have config file which does this;
> > add_library(foo STATIC IMPORTED)
> > set_property(target foo APPEND PROPERTY
> >    interface_include_directories
> >     "$"
> >     "$")
> >
> > set_property(TARGET foo APPEND PROPERTY
> >   IMPORTED_LOCATION_RELEASE
> >     $<$:${foo_root}/lib/release/foo.a>)
> >
> > The imported target is used in a target_link_libraries method;
> > target_link_libraries(an_application foo)
> >
> > Running CMake 3.6.1 does not produce any warnings. Running make I get a 
> > "target pattern contains no '%'" error message with a reference to a 
> > Build.make file.
> >
> > The Build.make contains the string " 
> > $<$:/tmp/prototype/foo/lib/release/foo.a".  We did not 
> > expect to see the generator expression in the Build.make file.
> >
> > Does set_property support generator expression in this context? What are we 
> > doing wrong?
> >
> > Appreciate any help :-)
> >
> > king regards, Lars
> >
> > --
> >
> > 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:
> > https://cmake.org/mailman/listinfo/cmake
-- 

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


Re: [CMake] set_property imported_location_release

2018-12-21 Thread Lars
Marc,

Appreciate the quick and helpful response.

In a config file that supports multiple platforms, do I need to create 
import_location_path variable and populate it depending on platform and 32/64 
etc? Any other options?

Thanks.

Kind regards, Lars


Fra: Marc CHEVRIER 
Sendt: fredag 21. desember 2018 13.41
Til: cmake@cmake.org; Lars
Emne: Re: [CMake] set_property imported_location_release

Properties IMPORTED_LOCATION* do not support generator expressions.

Generally speaking, if a property supports generator expression, it is 
explicitly specified in documentation.
Le 21 déc. 2018 à 13:07 +0100, Lars , a écrit :
Hello,

Trying to import an external library but having some issue with setting 
imported_location_release property.

Basically I have config file which does this;
add_library(foo STATIC IMPORTED)
set_property(target foo APPEND PROPERTY
   interface_include_directories
"$"
"$")

set_property(TARGET foo APPEND PROPERTY
  IMPORTED_LOCATION_RELEASE
$<$:${foo_root}/lib/release/foo.a>)

The imported target is used in a target_link_libraries method;
target_link_libraries(an_application foo)

Running CMake 3.6.1 does not produce any warnings. Running make I get a "target 
pattern contains no '%'" error message with a reference to a Build.make file.

The Build.make contains the string " 
$<$:/tmp/prototype/foo/lib/release/foo.a".  We did not 
expect to see the generator expression in the Build.make file.

Does set_property support generator expression in this context? What are we 
doing wrong?

Appreciate any help :-)

king regards, Lars

--

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

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


Re: [CMake] set_property imported_location_release

2018-12-21 Thread Marc CHEVRIER
Properties IMPORTED_LOCATION* do not support generator expressions.

Generally speaking, if a property supports generator expression, it is 
explicitly specified in documentation.
Le 21 déc. 2018 à 13:07 +0100, Lars , a écrit :
> Hello,
>
> Trying to import an external library but having some issue with setting 
> imported_location_release property.
>
> Basically I have config file which does this;
> add_library(foo STATIC IMPORTED)
> set_property(target foo APPEND PROPERTY
>    interface_include_directories
>     "$"
>     "$")
>
> set_property(TARGET foo APPEND PROPERTY
>   IMPORTED_LOCATION_RELEASE
>     $<$:${foo_root}/lib/release/foo.a>)
>
> The imported target is used in a target_link_libraries method;
> target_link_libraries(an_application foo)
>
> Running CMake 3.6.1 does not produce any warnings. Running make I get a 
> "target pattern contains no '%'" error message with a reference to a 
> Build.make file.
>
> The Build.make contains the string " 
> $<$:/tmp/prototype/foo/lib/release/foo.a".  We did not 
> expect to see the generator expression in the Build.make file.
>
> Does set_property support generator expression in this context? What are we 
> doing wrong?
>
> Appreciate any help :-)
>
> king regards, Lars
>
> --
>
> 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:
> https://cmake.org/mailman/listinfo/cmake
-- 

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


[CMake] set_property imported_location_release

2018-12-21 Thread Lars
Hello,

Trying to import an external library but having some issue with setting 
imported_location_release property.

Basically I have config file which does this;
add_library(foo STATIC IMPORTED)
set_property(target foo APPEND PROPERTY
   interface_include_directories
"$"
"$")

set_property(TARGET foo APPEND PROPERTY
  IMPORTED_LOCATION_RELEASE
$<$:${foo_root}/lib/release/foo.a>)

The imported target is used in a target_link_libraries method;
target_link_libraries(an_application foo)

Running CMake 3.6.1 does not produce any warnings. Running make I get a "target 
pattern contains no '%'" error message with a reference to a Build.make file.

The Build.make contains the string " 
$<$:/tmp/prototype/foo/lib/release/foo.a".  We did not 
expect to see the generator expression in the Build.make file.

Does set_property support generator expression in this context? What are we 
doing wrong?

Appreciate any help :-)

king regards, Lars

-- 

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