[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Tweak CMake project to include non-buildable files in the CodeBlocks project file
From:       Dario Oliveri <oliveridario89 () gmail ! com>
Date:       2015-01-11 21:55:40
Message-ID: CAK6PMeHT0Jsmf=-=LjqPzUNqQTNxmSec+RdH53JBiaa1tsvtWA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


It is very simple for each of the files you want to include in the build (I
use txt example so that you know it can work for arbitrary types):

---
set_source_files_properties( comment.txt PROPERTIES HEADER_FILE_ONLY true)
---
then you can include that file in the build to let it shows up in the IDE
file

---
#example when adding a static library (works the same also for executables)
add_library( ${arg1} STATIC
    ${sourcefiles}   #files you need to REALLY BUILD
    comment.txt    #this file would be added, but not builded
  )
---

2015-01-11 22:27 GMT+01:00 Andreas Pakulat <apaku@gmx.de>:

> Hi,
>
> I'm using QtCreator with CMake and have several files that are included in
> targets depending on the platform on which I build.
>
> Files that are not enabled on the current platform will not be included by
> CMake in the CodeBlocks file which in turn is used by QtCreator.
>
> Since QtCreator only picks up files listed in the CodeBlocks project file
> for its project view I cannot easily open certain files using QtCreator.
>
> I'm wondering wether CMake has a mechanism that would make these files
> show up in the CodeBlocks project file without them being actually compiled
> by the project build (I'm using Ninja for that part)? I was thinking of
> something similar to what can be used to create groups etc. for VS projects.
>
> Andreas
>
> --
>
> 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
>

[Attachment #5 (text/html)]

<div dir="ltr"><div><div>It is very simple for each of the files you want to include \
in the build (I use txt example so that you know it can work for arbitrary \
types):<br><br>---<br>set_source_files_properties( comment.txt PROPERTIES \
HEADER_FILE_ONLY true)<br>---<br></div>then you can include that file in the build to \
let it shows up in the IDE file<br><br>---<br></div><div>#example when adding a \
static library (works the same also for executables)<br></div><div>add_library( \
${arg1} STATIC <br>       ${sourcefiles}     #files you need to REALLY \
BUILD<br></div>       comment.txt       #this file would be added, but not \
builded<br><div>   )<br>---</div></div><div class="gmail_extra"><br><div \
class="gmail_quote">2015-01-11 22:27 GMT+01:00 Andreas Pakulat <span dir="ltr">&lt;<a \
href="mailto:apaku@gmx.de" \
target="_blank">apaku@gmx.de</a>&gt;</span>:<br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div \
dir="ltr">Hi,<div><br></div><div>I&#39;m using QtCreator with CMake and have several \
files that are included in targets depending on the platform on which I \
build.</div><div><br></div><div>Files that are not enabled on the current platform \
will not be included by CMake in the CodeBlocks file which in turn is used by \
QtCreator.</div><div><br></div><div>Since QtCreator only picks up files listed in the \
CodeBlocks project file for its project view I cannot easily open certain files using \
QtCreator.</div><div><br></div><div>I&#39;m wondering wether CMake has a mechanism \
that would make these files show up in the CodeBlocks project file without them being \
actually compiled by the project build (I&#39;m using Ninja for that part)? I was \
thinking of something similar to what can be used to create groups etc. for VS \
projects.</div><span class="HOEnZb"><font \
color="#888888"><div><br></div><div>Andreas</div></font></span></div> <br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a \
href="http://www.cmake.org/Wiki/CMake_FAQ" \
target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br> <br>
Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:<br> <br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" \
target="_blank">http://cmake.org/cmake/help/support.html</a><br> CMake Consulting: <a \
href="http://cmake.org/cmake/help/consulting.html" \
target="_blank">http://cmake.org/cmake/help/consulting.html</a><br> CMake Training \
Courses: <a href="http://cmake.org/cmake/help/training.html" \
target="_blank">http://cmake.org/cmake/help/training.html</a><br> <br>
Visit other Kitware open-source projects at <a \
href="http://www.kitware.com/opensource/opensource.html" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> <br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" \
target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>




-- 

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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic