<div>CMake performs deduplication of per-target flags for sure.</div>
<div><br></div>
<div>However I'm not sure if CMAKE_CXX_FLAGS is deduplicated. But I consider this variable as global flags for the whole project which is defined at topmost CMakeLists.txt. If you need to specify some flags specifically for a target use target_compile_options.</div>
<div class="mailbox_signature">
<br>—<br>Sent from <a href="https://www.dropbox.com/mailbox">Mailbox</a>
</div>
<br><br><div class="gmail_quote"><p>On Mon, Oct 5, 2015 at 4:23 PM, Attila Krasznahorkay <span dir="ltr"><<a href="mailto:attila.krasznahorkay@gmail.com" target="_blank">attila.krasznahorkay@gmail.com</a>></span> wrote:<br></p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><p>Dear All,
<br><br>Let me try a simpler question this time. (I'm a bit disappointed that nobody had any comments on my question about sub-projects.)
<br><br>I'm trying to clean up my project's build a bit. As it collects compilation flags from a few separate places, by the time it finishes collecting everything, the compilation commands are usually very long. As they have many duplications. Like:
<br><br>-m64 -pipe -W
<br> -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -Wno-deprecated-declaration
<br>s -stdlib=libc++ -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++
<br>11 -Wno-deprecated-declarations -stdlib=libc++ -Wno-unused-local-typedefs -Wno-tautological-undefined-compare -Wno-incon
<br>sistent-missing-override -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread
<br>-std=c++11 -Wno-deprecated-declarations -stdlib=libc++ -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-commo
<br>n -Qunused-arguments -pthread -std=c++11 -Wno-deprecated-declarations -stdlib=libc++ -m64 -pipe -W -Wall -Woverloaded-vi
<br>rtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -Wno-deprecated-declarations -stdlib=libc++ -m64
<br>-pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -Wno-deprecated-dec
<br>larations -stdlib=libc++ -m64 -pipe -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -stdlib=libc++
<br><br>Naturally it would help the build log reading tremendously if I could remove the duplications from these lines. But I can't find a good way of doing it. How could I weed out all the duplications in the CXXFLAGS associated to a given target?
<br><br>Cheers,
<br>            Attila
<br>-- 
<br><br>Powered by www.kitware.com
<br><br>Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
<br><br>Kitware offers various services to support the CMake community. For more information on each offering, please visit:
<br><br>CMake Support: http://cmake.org/cmake/help/support.html
<br>CMake Consulting: http://cmake.org/cmake/help/consulting.html
<br>CMake Training Courses: http://cmake.org/cmake/help/training.html
<br><br>Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
<br><br>Follow this link to subscribe/unsubscribe:
<br>http://public.kitware.com/mailman/listinfo/cmake
<br></p></blockquote></div><br>