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 open
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
ag:
> 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
> *
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
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
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