Re: [CMake] issue with target_link_libraries and MSVC

2016-04-13 Thread Benjamin Ballet via CMake
I'v found a way to enable openmp for a few target only with
target_link_libraries :
I created an imported interface OpenMP and setted the property
INTERFACE_COMPILE_OPTIONS

2016-04-13 12:16 GMT+02:00 Matějů Miroslav, Ing. <mateju.miros...@azd.cz>:

> The page I linked says /openmp is a compiler flag (not linker flag), so
> adding it to CMAKE_CXX_FLAGS instead of LINK_FLAGS makes perfect sense.
>
>
>
> Miroslav
>
>
>
> *From:* Benjamin Ballet [mailto:bbal...@ivsweb.com]
> *Sent:* Wednesday, April 13, 2016 11:28 AM
> *To:* Matějů Miroslav, Ing.
> *Cc:* cmake@cmake.org
> *Subject:* Re: [CMake] issue with target_link_libraries and MSVC
>
>
>
> Ho yes, my bad, however there is still the same issue with forward slashes
>
>
>
> I receive the flag with FindOpenMP module. It's sad we can't do :
>
> target_link_libraries(... ${OpenMP_CXX_FLAGS}) for a few target
>
>
>
> In the end I add the flags for the whole project :
>
> set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
>
>
>
> 2016-04-13 7:54 GMT+02:00 Matějů Miroslav, Ing. <mateju.miros...@azd.cz>:
>
> Hi Benjamin,
>
>
>
> MSVC flags start with “forward” slashes: / (However, MSVC also accepts
> hyphens (-) in my experience.)
>
> Documentation for /openmp flag:
> https://msdn.microsoft.com/library/fw509c3b.aspx
>
>
>
> Best regards,
>
> Miroslav
>
>
>
> *From:* CMake [mailto:cmake-boun...@cmake.org] *On Behalf Of *Benjamin
> Ballet via CMake
> *Sent:* Tuesday, April 12, 2016 5:30 PM
> *To:* cmake@cmake.org
> *Subject:* [CMake] issue with target_link_libraries and MSVC
>
>
>
> I'm trying to add the openmp flag to a target with target_link_libraries.
>
> \openmp is interpreted as a file name and visual try to link to \openmp.obj
>
>
>
> The documentation state that target_link_libraries see an item as a flag
> if it start with - but MSVC flags start with \
>
>
>
> Is there a way to add a link flags to a target with target_link_libraries
> and MSVC ?
>
>
>
> Thank you all
>
>
>
> --
>
> *Benjamin BALLET*
> Ingénieur R
>
>
> *ACTIVISU*
>
> 19, rue Klock - 92110 Clichy
>
> *> Standard Tél* :  01 44 69 37 37
>
> *>* www.activisu.com
>
>
>
>
>
> --
>
> *Benjamin BALLET*
> Ingénieur R
>
>
> *ACTIVISU*
>
> 19, rue Klock - 92110 Clichy
>
> *> Standard Tél* :  01 44 69 37 37
>
> *>* www.activisu.com
>



-- 
*Benjamin BALLET*
Ingénieur R

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.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] issue with target_link_libraries and MSVC

2016-04-13 Thread Matějů Miroslav , Ing .
The page I linked says /openmp is a compiler flag (not linker flag), so adding 
it to CMAKE_CXX_FLAGS instead of LINK_FLAGS makes perfect sense.

Miroslav

From: Benjamin Ballet [mailto:bbal...@ivsweb.com]
Sent: Wednesday, April 13, 2016 11:28 AM
To: Matějů Miroslav, Ing.
Cc: cmake@cmake.org
Subject: Re: [CMake] issue with target_link_libraries and MSVC

Ho yes, my bad, however there is still the same issue with forward slashes

I receive the flag with FindOpenMP module. It's sad we can't do :
target_link_libraries(... ${OpenMP_CXX_FLAGS}) for a few target

In the end I add the flags for the whole project :
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")

2016-04-13 7:54 GMT+02:00 Matějů Miroslav, Ing. 
<mateju.miros...@azd.cz<mailto:mateju.miros...@azd.cz>>:
Hi Benjamin,

MSVC flags start with “forward” slashes: / (However, MSVC also accepts hyphens 
(-) in my experience.)
Documentation for /openmp flag: https://msdn.microsoft.com/library/fw509c3b.aspx

Best regards,
Miroslav

From: CMake [mailto:cmake-boun...@cmake.org<mailto:cmake-boun...@cmake.org>] On 
Behalf Of Benjamin Ballet via CMake
Sent: Tuesday, April 12, 2016 5:30 PM
To: cmake@cmake.org<mailto:cmake@cmake.org>
Subject: [CMake] issue with target_link_libraries and MSVC

I'm trying to add the openmp flag to a target with target_link_libraries.
\openmp is interpreted as a file name and visual try to link to \openmp.obj

The documentation state that target_link_libraries see an item as a flag if it 
start with - but MSVC flags start with \

Is there a way to add a link flags to a target with target_link_libraries and 
MSVC ?

Thank you all

--
Benjamin BALLET
Ingénieur R

ACTIVISU
19, rue Klock - 92110 Clichy
> Standard Tél :  01 44 69 37 37
> www.activisu.com<http://www.activisu.com/>


--
Benjamin BALLET
Ingénieur R

ACTIVISU
19, rue Klock - 92110 Clichy
> Standard Tél :  01 44 69 37 37
> www.activisu.com<http://www.activisu.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] issue with target_link_libraries and MSVC

2016-04-13 Thread Benjamin Ballet via CMake
Ho yes, my bad, however there is still the same issue with forward slashes

I receive the flag with FindOpenMP module. It's sad we can't do :
target_link_libraries(... ${OpenMP_CXX_FLAGS}) for a few target

In the end I add the flags for the whole project :
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")

2016-04-13 7:54 GMT+02:00 Matějů Miroslav, Ing. :

> Hi Benjamin,
>
>
>
> MSVC flags start with “forward” slashes: / (However, MSVC also accepts
> hyphens (-) in my experience.)
>
> Documentation for /openmp flag:
> https://msdn.microsoft.com/library/fw509c3b.aspx
>
>
>
> Best regards,
>
> Miroslav
>
>
>
> *From:* CMake [mailto:cmake-boun...@cmake.org] *On Behalf Of *Benjamin
> Ballet via CMake
> *Sent:* Tuesday, April 12, 2016 5:30 PM
> *To:* cmake@cmake.org
> *Subject:* [CMake] issue with target_link_libraries and MSVC
>
>
>
> I'm trying to add the openmp flag to a target with target_link_libraries.
>
> \openmp is interpreted as a file name and visual try to link to \openmp.obj
>
>
>
> The documentation state that target_link_libraries see an item as a flag
> if it start with - but MSVC flags start with \
>
>
>
> Is there a way to add a link flags to a target with target_link_libraries
> and MSVC ?
>
>
>
> Thank you all
>
>
>
> --
>
> *Benjamin BALLET*
> Ingénieur R
>
>
> *ACTIVISU*
>
> 19, rue Klock - 92110 Clichy
>
> *> Standard Tél* :  01 44 69 37 37
>
> *>* www.activisu.com
>



-- 
*Benjamin BALLET*
Ingénieur R

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.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] issue with target_link_libraries and MSVC

2016-04-12 Thread Matějů Miroslav , Ing .
Hi Benjamin,

MSVC flags start with “forward” slashes: / (However, MSVC also accepts hyphens 
(-) in my experience.)
Documentation for /openmp flag: https://msdn.microsoft.com/library/fw509c3b.aspx

Best regards,
Miroslav

From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Benjamin Ballet via 
CMake
Sent: Tuesday, April 12, 2016 5:30 PM
To: cmake@cmake.org
Subject: [CMake] issue with target_link_libraries and MSVC

I'm trying to add the openmp flag to a target with target_link_libraries.
\openmp is interpreted as a file name and visual try to link to \openmp.obj

The documentation state that target_link_libraries see an item as a flag if it 
start with - but MSVC flags start with \

Is there a way to add a link flags to a target with target_link_libraries and 
MSVC ?

Thank you all

--
Benjamin BALLET
Ingénieur R

ACTIVISU
19, rue Klock - 92110 Clichy
> Standard Tél :  01 44 69 37 37
> www.activisu.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] issue with target_link_libraries and MSVC

2016-04-12 Thread Kristian
I'm not sure, but I think, you should consider 'set_target_properties'
(https://cmake.org/cmake/help/v3.0/command/set_target_properties.html).

E.g.

target_link_libraries(my_target source1.cpp source2.cpp)
set_target_properties(my_target PROPERTIES LINK_FLAGS "\openmp")



2016-04-12 17:29 GMT+02:00 Benjamin Ballet via CMake :
> I'm trying to add the openmp flag to a target with target_link_libraries.
> \openmp is interpreted as a file name and visual try to link to \openmp.obj
>
> The documentation state that target_link_libraries see an item as a flag if
> it start with - but MSVC flags start with \
>
> Is there a way to add a link flags to a target with target_link_libraries
> and MSVC ?
>
> Thank you all
>
> --
> Benjamin BALLET
> Ingénieur R
>
> ACTIVISU
> 19, rue Klock - 92110 Clichy
>> Standard Tél :  01 44 69 37 37
>> www.activisu.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
-- 

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