Re: [CMake] Using Clang + Ninja on Windows?

2016-04-22 Thread Mueller-Roemer, Johannes Sebastian
You are mistaken, Clang absolutely also works with MinGW. Or it did at least up 
to 3.7 (didn’t get around to trying 3.8 yet)

From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Cristian Adam
Sent: Thursday, April 21, 2016 23:30
To: Johan Holmberg 
Cc: cmake@cmake.org
Subject: Re: [CMake] Using Clang + Ninja on Windows?


On Wed, Apr 20, 2016 at 4:01 PM, Johan Holmberg 
mailto:johan...@gmail.com>> wrote:
Hi!
How should I setup CMake to build a C/C++ application on Windows using 
clang/clang++ as compilers and Ninja as build tool?
I tried specifying "-GNinja" to cmake, and setting CC/CXX to clang/clang++. But 
this didn't work. I get errors like:

  clang.exe: error: no such file or directory: '/nologo'
indicating that CMake thinks it should pass Visual C++ style options to clang.
I'm thinking about fooling CMake that clang/clang++ are cross compilers (I know 
how to get cross compiling working in other cases). But since clang/clang++ are 
the native tools for Windows, I was hoping to be able to use Clang + Ninja on 
Windows almost like I use on Linux.
If I run Clang from the command line, I can build my application, so my 
Clang-installation works.

I'm using CMake 3.5.1 and Clang 3.8.0.
/Johan Holmberg

Hi,

On Windows Clang works only with Visual C++, since they don't provide libc++. 
MinGW is not supported.
Clang provides a Visual C++'s cl.exe replacement.

You need to have the official 
windows Clang and Visual C++ 
Express or Community installed.

Then it's just a matter of:
1.   Opening a Visual C++ 2013 64 bit command prompt window
2.   Putting clang's cl.exe in the path and setting clang's INCLUDE path 
first

set PATH=c:\Program Files\LLVM\msbuild-bin\;%PATH%
set INCLUDE=c:\Program Files\LLVM\lib\clang\3.8.0\include\;%INCLUDE%
3.   cmake -G "Ninja"
4.   Ninja
CMake / Ninja will think that they compile with Visual C++, but instead will 
use clang.

Note that you have to match Visual C++ and Clang's build, 32 or 64 bit. You 
can't mix them,
or you'll have weird 
errors.

Cheers,
Cristian.

P.S. This is actually a re-post, this time adding the mailing list.
-- 

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] Using Clang + Ninja on Windows?

2016-04-22 Thread Cristian Adam
On Fri, Apr 22, 2016 at 8:59 AM, Mueller-Roemer, Johannes Sebastian <
johannes.sebastian.mueller-roe...@igd.fraunhofer.de> wrote:

> You are mistaken, Clang absolutely also works with MinGW. Or it did at
> least up to 3.7 (didn’t get around to trying 3.8 yet)
>
>
>

Clang works fine with libstdc++ on Linux and Cygwin, there should be no
reason why it shouldn't work with MinGW.

What I should have wrote was that Clang on Windows officially supports only
a Visual C++ setup / Visual Studio integration.

I don't think I have seen a package containing clang and libstdc++ from
MinGW.

Cheers,
Cristian.
-- 

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] CMake:question of the time when the command will happen in add_custom_command(...)

2016-04-22 Thread Petr Kmoch
Hi,

the reason is that the post-build command is actually a part of building
"main the target." Once you introduce custom commands into a target,
building it includes them all, and not just compiling the object files and
linking the binary. You will notice that the "Linking C exectuable main"
line came before the post-build message, so it did happen in the correct
order.

Petr

On 22 April 2016 at 06:25, Chaos Zhang  wrote:

> Hi all,
>
> I have some trouble when i use PRE_BUILD | PRE_LINK | POST_BUILD in command
> "add_custom_command(...)". When i use POST_BUILD, i found the command will
> execute before target had been built, like this:
>
> 1 [root@VM_33_35_centos build]# make
> 2 Scanning dependencies of target main
> 3 [100%] Building C object CMakeFiles/main.dir/main.c.o
> 4 Linking C executable main
> 5 This is pre build
> 6 This is post build
> 7 [100%] Built target main
>
> In my CMakeLists.txt, the content is:
>  1 cmake_minimum_required(VERSION 2.8)
>  2 add_executable(main main.c)
>  3 add_custom_command(TARGET main
>  4 PRE_BUILD
>  5 COMMAND echo "This is pre build "
>  6 )
>  7 add_custom_command(TARGET main
>  8 POST_BUILD
>  9 COMMAND echo "This is post build"
>  10 )
>
> Why the command echo "This is post build" in 8 line(CMakeLists.txt) did not
> execute after [100%] Built target main in 7 line(Linux command)?
>
>
>
>
> --
> View this message in context:
> http://cmake.3232098.n2.nabble.com/CMake-question-of-the-time-when-the-command-will-happen-in-add-custom-command-tp7593314.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
>
-- 

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] Using Clang + Ninja on Windows?

2016-04-22 Thread Mueller-Roemer, Johannes Sebastian
It is true that there is no official bundled installer with both, but the 
official installer works just fine with mingw as long as you pass in the 
correct target to clang(++)

For example
clang++ --target=x86_64-w64-mingw32 test.cpp

However, it assumes that mingw64 is installed under C:/mingw64 (the default 
location, it’ll work with a junction point though).


From: Cristian Adam [mailto:cristian.a...@gmail.com]
Sent: Friday, April 22, 2016 09:15
To: Mueller-Roemer, Johannes Sebastian 

Cc: cmake@cmake.org
Subject: Re: [CMake] Using Clang + Ninja on Windows?

On Fri, Apr 22, 2016 at 8:59 AM, Mueller-Roemer, Johannes Sebastian 
mailto:johannes.sebastian.mueller-roe...@igd.fraunhofer.de>>
 wrote:
You are mistaken, Clang absolutely also works with MinGW. Or it did at least up 
to 3.7 (didn’t get around to trying 3.8 yet)


Clang works fine with libstdc++ on Linux and Cygwin, there should be no reason 
why it shouldn't work with MinGW.

What I should have wrote was that Clang on Windows officially supports only a 
Visual C++ setup / Visual Studio integration.

I don't think I have seen a package containing clang and libstdc++ from MinGW.

Cheers,
Cristian.
-- 

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] CMake:question of the time when the command will happen in add_custom_command(...)

2016-04-22 Thread Petr Kmoch
No, it is indeed compiled and linked just fine. What I meant is:

Without any custom commands, the build process conceptually looks like this:

buildMain() {
  compile_object_files();
  link_main_binary();

  message("Built target main");
}

With a post-build custom command:

buildMain() {
  compile_object_files();
  link_main_binary();
  post_build_command();

  message("Built target main");
}

The custom command becomes a part of the entire process of "Building
target," that's why the "Built target" message appears after the command
runs.

BTW, please keep the mailing list in copy when replying.

Petr

On 22 April 2016 at 10:02, Chaos Zhang  wrote:

> So what you mean is the target have not been complied and linked after i 
> introduce
> custom commands into this target right? Do i understand right?
>
> Thanks a lot for your generous help. :-)
>
> 2016-04-22 16:38 GMT+08:00 Petr Kmoch :
>
>> Hi,
>>
>> the reason is that the post-build command is actually a part of building
>> "main the target." Once you introduce custom commands into a target,
>> building it includes them all, and not just compiling the object files and
>> linking the binary. You will notice that the "Linking C exectuable main"
>> line came before the post-build message, so it did happen in the correct
>> order.
>>
>> Petr
>>
>> On 22 April 2016 at 06:25, Chaos Zhang  wrote:
>>
>>> Hi all,
>>>
>>> I have some trouble when i use PRE_BUILD | PRE_LINK | POST_BUILD in
>>> command
>>> "add_custom_command(...)". When i use POST_BUILD, i found the command
>>> will
>>> execute before target had been built, like this:
>>>
>>> 1 [root@VM_33_35_centos build]# make
>>> 2 Scanning dependencies of target main
>>> 3 [100%] Building C object CMakeFiles/main.dir/main.c.o
>>> 4 Linking C executable main
>>> 5 This is pre build
>>> 6 This is post build
>>> 7 [100%] Built target main
>>>
>>> In my CMakeLists.txt, the content is:
>>>  1 cmake_minimum_required(VERSION 2.8)
>>>  2 add_executable(main main.c)
>>>  3 add_custom_command(TARGET main
>>>  4 PRE_BUILD
>>>  5 COMMAND echo "This is pre build "
>>>  6 )
>>>  7 add_custom_command(TARGET main
>>>  8 POST_BUILD
>>>  9 COMMAND echo "This is post build"
>>>  10 )
>>>
>>> Why the command echo "This is post build" in 8 line(CMakeLists.txt) did
>>> not
>>> execute after [100%] Built target main in 7 line(Linux command)?
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://cmake.3232098.n2.nabble.com/CMake-question-of-the-time-when-the-command-will-happen-in-add-custom-command-tp7593314.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
>>>
>>
>>
>
-- 

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] CMake:question of the time when the command will happen in add_custom_command(...)

2016-04-22 Thread Chaos Zhang
Sorry for i just know reply by email and thinks for your help again. :-)


Petr Kmoch wrote
> No, it is indeed compiled and linked just fine. What I meant is:
> 
> Without any custom commands, the build process conceptually looks like
> this:
> 
> buildMain() {
>   compile_object_files();
>   link_main_binary();
> 
>   message("Built target main");
> }
> 
> With a post-build custom command:
> 
> buildMain() {
>   compile_object_files();
>   link_main_binary();
>   post_build_command();
> 
>   message("Built target main");
> }
> 
> The custom command becomes a part of the entire process of "Building
> target," that's why the "Built target" message appears after the command
> runs.
> 
> BTW, please keep the mailing list in copy when replying.
> 
> Petr
> 
> On 22 April 2016 at 10:02, Chaos Zhang <

> zcsd2012@

> > wrote:
> 
>> So what you mean is the target have not been complied and linked after i
>> introduce
>> custom commands into this target right? Do i understand right?
>>
>> Thanks a lot for your generous help. :-)
>>
>> 2016-04-22 16:38 GMT+08:00 Petr Kmoch <

> petr.kmoch@

> >:
>>
>>> Hi,
>>>
>>> the reason is that the post-build command is actually a part of building
>>> "main the target." Once you introduce custom commands into a target,
>>> building it includes them all, and not just compiling the object files
>>> and
>>> linking the binary. You will notice that the "Linking C exectuable main"
>>> line came before the post-build message, so it did happen in the correct
>>> order.
>>>
>>> Petr
>>>
>>> On 22 April 2016 at 06:25, Chaos Zhang <

> zcsd2012@

> > wrote:
>>>
 Hi all,

 I have some trouble when i use PRE_BUILD | PRE_LINK | POST_BUILD in
 command
 "add_custom_command(...)". When i use POST_BUILD, i found the command
 will
 execute before target had been built, like this:

 1 [root@VM_33_35_centos build]# make
 2 Scanning dependencies of target main
 3 [100%] Building C object CMakeFiles/main.dir/main.c.o
 4 Linking C executable main
 5 This is pre build
 6 This is post build
 7 [100%] Built target main

 In my CMakeLists.txt, the content is:
  1 cmake_minimum_required(VERSION 2.8)
  2 add_executable(main main.c)
  3 add_custom_command(TARGET main
  4 PRE_BUILD
  5 COMMAND echo "This is pre build "
  6 )
  7 add_custom_command(TARGET main
  8 POST_BUILD
  9 COMMAND echo "This is post build"
  10 )

 Why the command echo "This is post build" in 8 line(CMakeLists.txt) did
 not
 execute after [100%] Built target main in 7 line(Linux command)?




 --
 View this message in context:
 http://cmake.3232098.n2.nabble.com/CMake-question-of-the-time-when-the-command-will-happen-in-add-custom-command-tp7593314.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

>>>
>>>
>>
> 
> -- 
> 
> 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





--
View this message in context: 
http://cmake.3232098.n2.nabble.com/CMake-question-of-the-time-when-the-command-will-happen-in-add-custom-command-tp7593314p7593320.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://cmak

Re: [CMake] How to check if Eclipse CDT4 generated project is set up correctly?

2016-04-22 Thread Nils Rathmann

Hi Alex,
thanks for the details. I managed to add the header files as intended 
and do have the targets you described, but the virtual directories 
"CMake Rules", "Object Files" and "Ressources" of each Target 
subdirectory are still empty. What is the intention of these virtual 
directories?


Thank you,
Nils


Am 20.04.2016 um 22:14 schrieb Alexander Neundorf:

On Monday, April 18, 2016 16:57:52 Nils Rathmann wrote:

Hi,
when I setup with the Eclipse CDT4 generator, as described here:
https://cmake.org/Wiki/Eclipse_CDT4_Generator4

my [Targets] folder contains virtual folders for CMakeRules, Header
Files, Object Files, Resources and Source Files,

Yes, those are the standard groups created by cmake.


but only the source files folder is filled.

If you list also the header files in the sources for a target, they will
appear in the [Header Files] group.


The other folders are always empty, even if I
build the target or the whole project. Is there a documentation where I
can see how a generated Eclipse project should look like? When I compare
my project with the sample screenshot in the wiki linked above, it looks
totally different (mine has a lot of virtual folders like Subprojects,
Targets, ...)

you should have a [Source directory] virtual folder pointing to
${CMAKE_SOURCE_DIR}.
You should have a virtual folder [Subprojects], with one subdir for every
project()-call in your project.

The "Make targets" tab should have some global targets to  build (like all,
clean, rebuild_cache) and a "Build" and "Clean" make target for every target.

Is this so ?

Alex



--

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] CMake:question of the time when the command will happen in add_custom_command(...)

2016-04-22 Thread Chuck Atkins
Hi Chao,

You can see this more clearly if you do a "make VERBOSE=1" :

[chuck.atkins@hal9000 build]$ make VERBOSE=1
...
[ 50%] Building C object CMakeFiles/main.dir/main.c.o
/usr/bin/cc -o CMakeFiles/main.dir/main.c.o   -c
/home/chuck.atkins/Code/tmp/source/main.c
[100%] Linking C executable main

*echo This\ is\ pre\ build\ This is pre build *
/usr/bin/cmake -E cmake_link_script CMakeFiles/main.dir/link.txt --verbose=1
*/usr/bin/cc CMakeFiles/main.dir/main.c.o  -o main -rdynamic *

*echo This\ is\ post\ buildThis is post build*
make[2]: Leaving directory '/home/chuck.atkins/Code/tmp/build'
[100%] Built target main
make[1]: Leaving directory '/home/chuck.atkins/Code/tmp/build'
/usr/bin/cmake -E cmake_progress_start
/home/chuck.atkins/Code/tmp/build/CMakeFiles 0
[chuck.atkins@hal9000 build]$

Here you can see the order of command execution is PRE_BUILD -> Link ->
POST_BUILD

- Chuck

On Fri, Apr 22, 2016 at 5:53 AM, Chaos Zhang  wrote:

> Sorry for i just know reply by email and thinks for your help again. :-)
>
>
> Petr Kmoch wrote
> > No, it is indeed compiled and linked just fine. What I meant is:
> >
> > Without any custom commands, the build process conceptually looks like
> > this:
> >
> > buildMain() {
> >   compile_object_files();
> >   link_main_binary();
> >
> >   message("Built target main");
> > }
> >
> > With a post-build custom command:
> >
> > buildMain() {
> >   compile_object_files();
> >   link_main_binary();
> >   post_build_command();
> >
> >   message("Built target main");
> > }
> >
> > The custom command becomes a part of the entire process of "Building
> > target," that's why the "Built target" message appears after the command
> > runs.
> >
> > BTW, please keep the mailing list in copy when replying.
> >
> > Petr
> >
> > On 22 April 2016 at 10:02, Chaos Zhang <
>
> > zcsd2012@
>
> > > wrote:
> >
> >> So what you mean is the target have not been complied and linked after i
> >> introduce
> >> custom commands into this target right? Do i understand right?
> >>
> >> Thanks a lot for your generous help. :-)
> >>
> >> 2016-04-22 16:38 GMT+08:00 Petr Kmoch <
>
> > petr.kmoch@
>
> > >:
> >>
> >>> Hi,
> >>>
> >>> the reason is that the post-build command is actually a part of
> building
> >>> "main the target." Once you introduce custom commands into a target,
> >>> building it includes them all, and not just compiling the object files
> >>> and
> >>> linking the binary. You will notice that the "Linking C exectuable
> main"
> >>> line came before the post-build message, so it did happen in the
> correct
> >>> order.
> >>>
> >>> Petr
> >>>
> >>> On 22 April 2016 at 06:25, Chaos Zhang <
>
> > zcsd2012@
>
> > > wrote:
> >>>
>  Hi all,
> 
>  I have some trouble when i use PRE_BUILD | PRE_LINK | POST_BUILD in
>  command
>  "add_custom_command(...)". When i use POST_BUILD, i found the command
>  will
>  execute before target had been built, like this:
> 
>  1 [root@VM_33_35_centos build]# make
>  2 Scanning dependencies of target main
>  3 [100%] Building C object CMakeFiles/main.dir/main.c.o
>  4 Linking C executable main
>  5 This is pre build
>  6 This is post build
>  7 [100%] Built target main
> 
>  In my CMakeLists.txt, the content is:
>   1 cmake_minimum_required(VERSION 2.8)
>   2 add_executable(main main.c)
>   3 add_custom_command(TARGET main
>   4 PRE_BUILD
>   5 COMMAND echo "This is pre build "
>   6 )
>   7 add_custom_command(TARGET main
>   8 POST_BUILD
>   9 COMMAND echo "This is post build"
>   10 )
> 
>  Why the command echo "This is post build" in 8 line(CMakeLists.txt)
> did
>  not
>  execute after [100%] Built target main in 7 line(Linux command)?
> 
> 
> 
> 
>  --
>  View this message in context:
> 
> http://cmake.3232098.n2.nabble.com/CMake-question-of-the-time-when-the-command-will-happen-in-add-custom-command-tp7593314.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
> 
> >>>
> >>>
> >>
> >
> > --
> >
> > Powered by www.kitware.com
> >
> > Please keep messages 

Re: [CMake] How to check if Eclipse CDT4 generated project is set up correctly?

2016-04-22 Thread Martin Weber
Am Freitag, 22. April 2016, 13:28:33 schrieb Nils Rathmann:
> Hi Alex,
> thanks for the details. I managed to add the header files as intended
> and do have the targets you described, but the virtual directories
> "CMake Rules", "Object Files" and "Ressources" of each Target
> subdirectory are still empty. What is the intention of these virtual
> directories?

Hi Nils,

the Eclipse Marketplace has some plugins that help you to work with cmake in 
Eclipse.
Just search for 'cmake'...

Martin

-- 

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] Finding 32bit libs on 64bit Ubuntu install

2016-04-22 Thread Nick Deubert
Hey everyone, I am trying to build and link some 32bit binaries on
Ubuntu 15.10 64bit, but no matter what combination of arguments I give
FIND_LIBRARY I cannot get it to use the 32bit libs. I have been
scouring the mailing lists and came up with all these things to try
but nothing has worked so far. I am using cmake 3.0.2. Please let me
know what I am missing. Thanks in advance for your help.
Nick

The relevant part of my cmake file:

 Set(CFLAGS "-m32")
 Set(CXXFLAGS "-m32")
 Set(CMAKE_C_FLAGS "-m32")
 Set(CMAKE_CXX_FLAGS "-m32")
 Set(CMAKE_SHARED_LINKER_FLAGS "-m32")
 Set(FIND_LIBRARY_USE_LIB64_PATHS OFF)

 MESSAGE( STATUS "CMAKE_LIBRARY_PATH: " ${CMAKE_LIBRARY_PATH} )
 MESSAGE( STATUS "CFLAGS: " ${CFLAGS} )
 MESSAGE( STATUS "CXXFLAGS: " ${CXXFLAGS} )
 MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
 MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
 MESSAGE( STATUS "CMAKE_SHARED_LINKER_FLAGS: " ${CMAKE_SHARED_LINKER_FLAGS} )
 MESSAGE( STATUS "FIND_LIBRARY_USE_LIB64_PATHS: "
${FIND_LIBRARY_USE_LIB64_PATHS} )

 FIND_LIBRARY(DL_LIBRARY NAMES dl  PATHS  ${LIB_PATH}
NO_DEFAULT_PATH)
 FIND_LIBRARY(NL_LIBRARY NAMES nl  PATHS  ${LIB_PATH}
NO_DEFAULT_PATH)
 FIND_LIBRARY(PTHREAD_LIBRARYNAMES pthread PATHS  ${LIB_PATH}
NO_DEFAULT_PATH)

MESSAGE(STATUS "DL_LIBRARY is ${DL_LIBRARY}")
MESSAGE(STATUS "NL_LIBRARY is ${NL_LIBRARY}")
MESSAGE(STATUS "PTHREAD_LIBRARY is ${PTHREAD_LIBRARY}")

The output I get:

-- CMAKE_LIBRARY_PATH: /lib/i386-linux-gnu
-- CFLAGS: -m32
-- CXXFLAGS: -m32
-- CMAKE_C_FLAGS: -m32
-- CMAKE_CXX_FLAGS: -m32
-- CMAKE_SHARED_LINKER_FLAGS: -m32
-- FIND_LIBRARY_USE_LIB64_PATHS: OFF
-- DL_LIBRARY is DL_LIBRARY-NOTFOUND
-- NL_LIBRARY is NL_LIBRARY-NOTFOUND
-- PTHREAD_LIBRARY is PTHREAD_LIBRARY-NOTFOUND

Without NO_DEFAULT_PATH:

-- DL_LIBRARY is /usr/lib/x86_64-linux-gnu/libdl.so
-- NL_LIBRARY is /lib/x86_64-linux-gnu/libnl.so
-- PTHREAD_LIBRARY is /usr/lib/x86_64-linux-gnu/libpthread.so

Proof that I have the 32bit libs installed:

$ ls -l /lib/i386-linux-gnu/*pthread*
-rwxr-xr-x 1 root root 137044 Feb 16 14:06
/lib/i386-linux-gnu/libpthread-2.21.so*
lrwxrwxrwx 1 root root 18 Feb 16 14:06
/lib/i386-linux-gnu/libpthread.so.0 -> libpthread-2.21.so*
$ ls -l /lib/i386-linux-gnu/*libnl*
-rw-r--r-- 1 root root 165936 Jul 15  2015 /lib/i386-linux-gnu/libnl-3.a
lrwxrwxrwx 1 root root 19 Jul 15  2015
/lib/i386-linux-gnu/libnl-3.so -> libnl-3.so.200.21.0
lrwxrwxrwx 1 root root 19 Jul 15  2015
/lib/i386-linux-gnu/libnl-3.so.200 -> libnl-3.so.200.21.0
-rw-r--r-- 1 root root 132852 Jul 15  2015
/lib/i386-linux-gnu/libnl-3.so.200.21.0
$ ls -l /lib/i386-linux-gnu/*libdl*
-rw-r--r-- 1 root root 13808 Feb 16 14:06 /lib/i386-linux-gnu/libdl-2.21.so
lrwxrwxrwx 1 root root13 Feb 16 14:06
/lib/i386-linux-gnu/libdl.so.2 -> libdl-2.21.so
-- 

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] Finding 32bit libs on 64bit Ubuntu install

2016-04-22 Thread Alan W. Irwin

On 2016-04-22 14:59-0400 Nick Deubert wrote:


Hey everyone, I am trying to build and link some 32bit binaries on
Ubuntu 15.10 64bit, but no matter what combination of arguments I give
FIND_LIBRARY I cannot get it to use the 32bit libs. I have been
scouring the mailing lists and came up with all these things to try
but nothing has worked so far. I am using cmake 3.0.2. Please let me
know what I am missing. Thanks in advance for your help.


CMake 3.0.2 is pretty old, and there were some find and other issues
for early CMake-3 versions.  I don't know whether any of those issues
are relevant to the issue you are discussing. Nevertheless, as an
experiment (and to make sure your eventual solution works for the
latest CMake) I would suggest you try building and using the latest
released version of CMake, 3.5.2, to see if that makes any difference.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__
--

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] Using Clang + Ninja on Windows?

2016-04-22 Thread Edward Diener

On 4/22/2016 4:51 AM, Mueller-Roemer, Johannes Sebastian wrote:

It is true that there is no official bundled installer with both, but
the official installer works just fine with mingw as long as you pass in
the correct target to clang(++)

For example

clang++ --target=x86_64-w64-mingw32 test.cpp

However, it assumes that mingw64 is installed under C:/mingw64 (the
default location, it’ll work with a junction point though).


As of clang 3.7 there is no need to have a hardcoded mingw directory. 
You just need to have an appropriate mingw(-64)/gcc in your PATH. Also 
all distributed versions of clang 3.4 through 3.7 for Windows default to 
targeting mingw(-64)/gcc and not VC++. Only with 3.8 is the Windows 
release defaulting to targeting VC++.



--

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