[CMake] LINK_FLAGS directory property

2016-04-27 Thread Matthew Keeler
Is there an equivalent directory property for the target level LINK_FLAGS 
property. I can’t see anything according to the documentation but was hoping 
there was an oversight and something actually existed.

What I am trying to do is pass extra flags to the linker for every target in my 
project and I didn’t want to have to set it per target. I tried using the 
link_libraries command but the flags I am adding are msvc specific and start 
with ‘/‘ and cmake seems to be turning these into ‘\’ when its passed to the 
linker. Then the linker thinks its trying to link in another file and 
everything blows up.

Also a secondary question is what does the INTERPROCEDURAL_OPTIMIZATIONS 
property at the directory level do. I assume on Windows it passes /GL to the 
compiler but will this also add /LCTG to the linker flags and prevent 
incremental linking. If I turn this property on will it also do it for debug 
configurations or just optimized configurations?

-- 
Matt Keeler

-- 

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

Re: [CMake] project command not working, when used via macro (from an included file)

2016-04-27 Thread Chuck Atkins
Perhaps I spoke to hastily.  It seems the unsupported configuration is if
project(...) is actually called from an include file, which makes sense
given various scoping issues.  Give that, what you have should work fine.
What doesn't work as expected?  It seems to work just fine when I try it
from a macro defined in an include file.  Also, what version of CMake are
you using so I can try to reproduce your configuration more closely?

- Chuck

On Wed, Apr 27, 2016 at 10:09 AM, aj neu  wrote:

> Ok thanks.
> But it is unfortunate, since it means that really great macros, such as
> project_guarded
> (see http://stackoverflow.com/a/33100078)
> cannot be used everywhere, as a substitute for project.
>
>
>
> On Tue, Apr 26, 2016 at 8:04 PM, Chuck Atkins 
> wrote:
>
>> ajneu,
>>
>> The call to project(...) needs to be explicit.  See
>> https://cmake.org/cmake/help/v3.5/command/project.html:
>>
>> The top-level CMakeLists.txt file for a project must contain a literal,
>> direct call to the project()
>> 
>> command; loading one through the include()
>> 
>> command is not sufficient.
>>
>> - Chuck
>>
>> On Tue, Apr 26, 2016 at 1:57 PM, aj neu  wrote:
>>
>>> Hi,
>>>
>>> when calling `project`
>>> ...as seen here
>>> ...
>>> https://github.com/ajneu/cmake_project_via_macro/blob/5972c7362e11fdbaa09d9defe8cca2dcea79e606/CMakeLists.txt#L33
>>> everything is ok.
>>>
>>>
>>> BUT when calling `project` via a macro (that was included)
>>> ... as seen here
>>> ...
>>> https://github.com/ajneu/cmake_project_via_macro/blob/master/CMakeLists.txt#L33
>>> the behaviour is not as expected.
>>>
>>> Why?
>>>
>>> (Details are here: https://github.com/ajneu/cmake_project_via_macro)
>>>
>>>
>>> Is this a bug?
>>>
>>> Thanks
>>> ajneu
>>>
>>>
>>>
>
-- 

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

Re: [CMake] project command not working, when used via macro (from an included file)

2016-04-27 Thread aj neu
Ok thanks.
But it is unfortunate, since it means that really great macros, such as
project_guarded
(see http://stackoverflow.com/a/33100078)
cannot be used everywhere, as a substitute for project.



On Tue, Apr 26, 2016 at 8:04 PM, Chuck Atkins 
wrote:

> ajneu,
>
> The call to project(...) needs to be explicit.  See
> https://cmake.org/cmake/help/v3.5/command/project.html:
>
> The top-level CMakeLists.txt file for a project must contain a literal,
> direct call to the project()
> 
> command; loading one through the include()
> 
> command is not sufficient.
>
> - Chuck
>
> On Tue, Apr 26, 2016 at 1:57 PM, aj neu  wrote:
>
>> Hi,
>>
>> when calling `project`
>> ...as seen here
>> ...
>> https://github.com/ajneu/cmake_project_via_macro/blob/5972c7362e11fdbaa09d9defe8cca2dcea79e606/CMakeLists.txt#L33
>> everything is ok.
>>
>>
>> BUT when calling `project` via a macro (that was included)
>> ... as seen here
>> ...
>> https://github.com/ajneu/cmake_project_via_macro/blob/master/CMakeLists.txt#L33
>> the behaviour is not as expected.
>>
>> Why?
>>
>> (Details are here: https://github.com/ajneu/cmake_project_via_macro)
>>
>>
>> Is this a bug?
>>
>> Thanks
>> ajneu
>>
>>
>>
-- 

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

Re: [CMake] Install with full absolute path on OS X

2016-04-27 Thread Michael Jackson

Thanks. That was the solution.

--
Mike Jackson  [mike.jack...@bluequartz.net]

clin...@elemtech.com 
April 26, 2016 at 2:57 PM

To set the install name to an absolute path, it would probably be 
something like
set_property(TARGET EMsoft PROPERTY INSTALL_NAME_DIR 
${CMAKE_INSTALL_PREFIX}/lib)


Clint

- On Apr 26, 2016, at 12:24 PM, Michael Jackson 
 wrote:

Michael Jackson 
April 26, 2016 at 2:24 PM
I am building a library and installing onto the local system. After 
installation otool reports that the path is "@rpath/lib/libEMsoft.dylib"


How can I have the installed path be the full absolute path to the 
library. For this use case @rpath is not going to work.


I have tried https://cmake.org/Wiki/CMake_RPATH_handling and 
variations of that information but none of it seems to work.


THanks


-- 

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

Re: [CMake] How to set link option

2016-04-27 Thread vakano
I think the variable CMAKE_EXE_LINKER_FLAGS or LINK_FLAGS may work,

but since my project have some other issues, I have not reached to link
steps.

Thanks,
Le


Magnus Therning wrote
> vakano <

> zhongle@

> > writes:
> 
>> Hi, 
>>
>> I have some link option as below:
>>
>> -Wl, -rpath, ${PROJECT_TOP}/dist  ../proj_a/lib_a.a -lb -Wl,
>> --whole-archive
>> ../proj_c/lib_c.a
> 
> What have you tried?
> 
> /M
> 
> -- 
> Magnus Therning  OpenPGP: 0x927912051716CE39
> email: 

> magnus@

>jabber: 

> magnus@

> twitter: magthe   http://therning.org/magnus
> 
> McBryan's Law: You can't make it better until you make it work.
> 
> -- 
> 
> 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://public.kitware.com/mailman/listinfo/cmake
> 
> signature.asc (815 bytes)
> ;





--
View this message in context: 
http://cmake.3232098.n2.nabble.com/How-to-set-link-option-tp7593307p7593370.html
Sent from the CMake mailing list archive at Nabble.com.
-- 

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


Re: [CMake] project command not working, when used via macro (from an included file)

2016-04-27 Thread CHEVRIER, Marc
May be using keyword NO_POLICY_SCOPE in include command will solve your problem…

From: CMake mailto:cmake-boun...@cmake.org>> on behalf 
of Chuck Atkins mailto:chuck.atk...@kitware.com>>
Date: Tuesday 26 April 2016 at 20:04
To: aj neu mailto:ajn...@gmail.com>>
Cc: "cmake@cmake.org" 
mailto:cmake@cmake.org>>
Subject: Re: [CMake] project command not working, when used via macro (from an 
included file)

ajneu,

The call to project(...) needs to be explicit.  See 
https://cmake.org/cmake/help/v3.5/command/project.html:

The top-level CMakeLists.txt file for a project must contain a literal, direct 
call to the 
project()
 command; loading one through the 
include()
 command is not sufficient.

- Chuck

On Tue, Apr 26, 2016 at 1:57 PM, aj neu 
mailto:ajn...@gmail.com>> wrote:
Hi,

when calling `project`
...as seen here
... 
https://github.com/ajneu/cmake_project_via_macro/blob/5972c7362e11fdbaa09d9defe8cca2dcea79e606/CMakeLists.txt#L33
everything is ok.


BUT when calling `project` via a macro (that was included)
... as seen here
... 
https://github.com/ajneu/cmake_project_via_macro/blob/master/CMakeLists.txt#L33
the behaviour is not as expected.

Why?

(Details are here: https://github.com/ajneu/cmake_project_via_macro)


Is this a bug?

Thanks
ajneu


--

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

[CMake] install/fast Makerule failing in buildroot

2016-04-27 Thread Dushara Jayasinghe

Hi all,

I'm trying to include a package to buildroot (2016.02) with cmake as the 
build generator however, I've hit a bit of a snag. This particular 
version of buildroot is using CMake version 3.4.3. The package builds as 
expected, however during the install step, the following error is generated:


make[2]: *** No rule to make target `install/fast'.  Stop.

I had a look at the generated Makefile and found it lacks any install 
rules (there are preinstall rules only). The toolchain I'm using is a 
cross compiler targeting an arm platform. Buildroot compiles the tool 
chain as well as CMake as part of the build process.


Is anyone able to point me in the area of CMake sources that I need to 
look at to fix this particular issue?


Thanks,
DJ

--

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