[CMake] CMake:question of the time when the command will happen in add_custom_command(...)

2016-04-21 Thread Chaos Zhang
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%] Buil

Re: [CMake] How to add dependency relations between libs and executable

2016-04-21 Thread vakano
Hi, Chuck, J, Thanks for you all great help! It is clear for me now ^.^ vakano -- View this message in context: http://cmake.3232098.n2.nabble.com/How-to-add-dependency-relations-between-libs-and-executable-tp7593264p7593313.html Sent from the CMake mailing list archive at Nabble.com. -- Po

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

2016-04-21 Thread Gonzalo
El 21/04/16 a las 18:30, Cristian Adam escribió:} > 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 . I wonder. Are the C and C++ ABIs of both compilers compa

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

2016-04-21 Thread Cristian Adam
On Wed, Apr 20, 2016 at 4:01 PM, Johan Holmberg 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 g

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

2016-04-21 Thread Brad King
On 04/21/2016 10:15 AM, Johan Holmberg wrote: > I chose the binaries behaving like "gcc" > > I realize that Cristian Adams recommended using the "cl.exe" wrapper in > his response, but I wanted at least to try using the "gcc-like" binaries > first, hoping that they should work with CMake. I think

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

2016-04-21 Thread Johan Holmberg
On Wed, Apr 20, 2016 at 5:54 PM, Brad King wrote: > On 04/20/2016 10:01 AM, Johan Holmberg wrote: > > I tried specifying "-GNinja" to cmake, and setting CC/CXX to > > clang/clang++. > > Good. > > > But this didn't work. I get errors like: > > > > clang.exe: error: no such file or directory: '/n

Re: [CMake] How to add dependency relations between libs and executable

2016-04-21 Thread Chuck Atkins
> in your proj_a example, when target_link_librairies invoke Lib B directly > which generated in another project b, how does proj_a recognize it > I think the reason is proj_a, b, c are all the sub directories of > project root, if no root layer, B can not be invoked in proj_a, right? > That's

[CMake] How to set link option

2016-04-21 Thread vakano
Hi, I have some link option as below: -Wl, -rpath, ${PROJECT_TOP}/dist ../proj_a/lib_a.a -lb -Wl, --whole-archive ../proj_c/lib_c.a Thanks, Le -- View this message in context: http://cmake.3232098.n2.nabble.com/How-to-set-link-option-tp7593307.html Sent from the CMake mailing list archiv