Re: [CMake] GLOB_RECURSE

2018-07-25 Thread Dan Liew
On 25 July 2018 at 23:47, Michael Hennebry wrote: > Emphasis on curse. > > from CMakeLists.txt: > > file (GLOB_RECURSE ards ./ArduinoCore/src *.cpp *.c) > file (GLOB_RECURSE apps ./SensorUnit *.cpp *.c) Your syntax is wrong. `./ArduinoCore/src`, ` ./SensorUnit`, `*.cpp`, `*.c` are all being

Re: [CMake] Cannot find source file:

2017-06-24 Thread Dan Liew
On 24 June 2017 at 05:06, Sean Wayland wrote: > Hi all, > I am having trouble getting an application to build. > I keep getting this error "cannot find source file" > > > /Users/seanwayland/Desktop/CATSMAT-masterfri/catsmat/catsmat/Analysis/src/*.cpp > > This is the first

Re: [CMake] Release flags on one target in debug build type

2017-05-05 Thread Dan Liew
On 5 May 2017 at 19:45, Konstantin Tokarev wrote: > Hello, > > Is there any clear way to build specific target in "Debug" mode with flags > that it would have in "Release"? > > In particular, build this specific target without effect of > CMAKE_CXX_FLAGS_DEBUG and

[CMake] When Ninja byproduct is a directory causes `clean` target to fail.

2017-05-04 Thread Dan Liew
Hi, I recently added support to a project to build its API documentation [1]. The documentation is generated by doxygen. I used `add_custom_command()` to run doxygen and I use `BYPRODUCTS` to specify the output directory that will be generated by doxygen in the hope that this would tell ninja to

Re: [CMake] Saving clang output to file when cmake is used with CLion

2017-04-13 Thread Dan Liew
Hi, On 13 April 2017 at 01:35, mike lojkovic wrote: > I have a script I'm using to figure out which headers should be in my > precompiled header. It requires the clang -H flag passed to work. I'm > able to get the output on the console without issue, but can't figure >

Re: [CMake] Cmake for fftw library

2017-04-07 Thread Dan Liew
> Where Am I going wrong ? > Can anyone please help me out ? You don't link against fftw which is why you get linking errors. The `${fftw}` variable is empty. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware

Re: [CMake] libsndfile in winodws

2017-03-02 Thread Dan Liew
On 2 March 2017 at 12:07, aishwarya selvaraj wrote: > Hi all , > I was trying to build my .cpp file in windows in Windows platform (windows > 10) using cmake . > My .cpp file makes use of two external libraries 1)armadillo 2)libsnd file. > I have written a

Re: [CMake] Default CMAKE_C_FLAGS value by OS

2017-02-16 Thread Dan Liew
Hi, On 16 February 2017 at 09:06, wrote: > Hello, > > My question is related to CMAKE_*_FLAGS. > I've got a project under linux fedora 24 and, in release mode, this project > compiles with the -O2 flag. > But when I switched to other platform (ubuntu, fedora 16 - I

Re: [CMake] CMake 3.7.2 and parallel builds

2017-01-29 Thread Dan Liew
> What's weirder (and I forgot to mention) is that if I just build the project > normally outside of my regression testing script (ie. "make -j5"), I don't > get the jobserver warning. The reason for this error message from make is given at [1]. I've seen something like this before when my build

Re: [CMake] Comaptibility with older gcc

2017-01-28 Thread Dan Liew
> I was also doubting about libstdc++ versions, is there maybe a way of asking > Cmake to statistically include it in the built library? I assume you mean statically. If so then you could try invoking cmake like this on the command line. ``` mkdir new_build_dir cd new_build_dir

Re: [CMake] cmake vs. Python 3.4

2016-12-23 Thread Dan Liew
On 23 Dec 2016 7:58 pm, "Lev" wrote: Hi list, I have this: FIND_PACKAGE(PythonInterp) and cmake finds this: -- Found PythonInterp: /usr/bin/python (found version "2.7.9") However, 3.4 is also installed. How can I specify to find 3.4? If I say:

Re: [CMake] Cmake

2016-12-21 Thread Dan Liew
Hi Aishwarya, On 21 December 2016 at 11:51, aishwarya selvaraj wrote: > Hi Everyone, > Myself Aishwarya .I wanted to make use of Cmake , but I'm really new to this > and doesn't have a clear idea about it. > > 1) My Goal : > I'm using Praat a speech Processing

Re: [CMake] Adding dependencies to the `clean` target in 2016?

2016-12-09 Thread Dan Liew
On 5 December 2016 at 14:05, Brad King <brad.k...@kitware.com> wrote: > On 12/03/2016 06:52 AM, Dan Liew wrote: >> There was a post about this 10 years ago [1], has anything changed since >> then? > > No. From my response back then: > >>> The "clean&q

[CMake] Adding dependencies to the `clean` target in 2016?

2016-12-03 Thread Dan Liew
Hi, As part of a project I work on we use CMake's `ExternalProject()` to build a set of runtime libraries that the project needs via a second build system (Makefile based) that knows how to build the runtime libraries. The code (which is full of hacks... sorry) is at [1]. What I want to do is

Re: [CMake] Calling find_package(self) for in-project builds

2016-06-02 Thread Dan Liew
> What would be the suggested way to handle this? Couldn't you build the examples using CMake's ``ExternalProject`` module [1] and have that build after the main project has finished building? [1] https://cmake.org/cmake/help/v3.5/module/ExternalProject.html -- Powered by www.kitware.com

Re: [cmake-developers] RFC: LLVM community CMake documentation

2016-04-28 Thread Dan Liew
Hi Chris, Thanks for doing this. I've had a quick scan and I have a few minor comments. # Scripting overview This is personal preference but I don't like ``add_definitions()`` due to its global behaviour so I think its use should be discouraged. I much prefer ``target_compile_definitions()``

Re: [cmake-developers] [CMake] add_custom_command() OUTPUT does not accept generator expressions, why?

2016-03-31 Thread Dan Liew
Hi, On 28 March 2016 at 15:05, Brad King <brad.k...@kitware.com> wrote: > On 03/27/2016 06:11 AM, Dan Liew wrote: >> OUTPUT does not accept generator expressions, why? > > It hasn't been implemented. At least at one time it would have been > very hard to implement.

Re: [CMake] add_custom_command() OUTPUT does not accept generator expressions, why?

2016-03-31 Thread Dan Liew
Hi, On 28 March 2016 at 15:05, Brad King <brad.k...@kitware.com> wrote: > On 03/27/2016 06:11 AM, Dan Liew wrote: >> OUTPUT does not accept generator expressions, why? > > It hasn't been implemented. At least at one time it would have been > very hard to implement.

[CMake] add_custom_command() OUTPUT does not accept generator expressions, why?

2016-03-27 Thread Dan Liew
Hi, I tried writing a add_custom_command statement that will output the generated file into the same directory as another target ``` set(OUTPUT_NAME "$/MyThing.dll") add_custom_command(OUTPUT "${OUTPUT_NAME}" COMMAND "csc.exe" "/output:$" "MySource.cs" ) ``` This

Re: [CMake] Support for colored makefile output with tmux

2016-03-26 Thread Dan Liew
On 26 March 2016 at 09:30, Dan Liew <d...@su-root.co.uk> wrote: > On 26 March 2016 at 01:15, Mike Lui <md...@drexel.edu> wrote: >> When I use tmux and set my TERM to either 'tmux' or 'tmux-256color', I don't >> get colorized output of from cmake generated Makefiles. &

Re: [CMake] Support for colored makefile output with tmux

2016-03-26 Thread Dan Liew
On 26 March 2016 at 01:15, Mike Lui wrote: > When I use tmux and set my TERM to either 'tmux' or 'tmux-256color', I don't > get colorized output of from cmake generated Makefiles. My TERM is set to "xterm-256color" and with that coloured output when running ``make`` in Tmux

Re: [CMake] Problem using VS-compiled Clang as a C/C++ compiler.

2016-03-09 Thread Dan Liew
> -- check which cl.exe is used: > $which cl > D:\CL\cl.EXE > > -- trying to build: > $cmake -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang .. If your goal is use your renamed clang-cl (cl.exe) then why are you telling CMake to use to use clang.exe ? You can clearly see

Re: [cmake-developers] Appending to LINK_FLAGS property of a target doesn't seem to work correctly

2016-03-04 Thread Dan Liew
On 3 March 2016 at 22:02, Nils Gladitz <nilsglad...@gmail.com> wrote: > On 03.03.2016 22:57, Dan Liew wrote: >> >> Hi, >> >> I noticed recently is you do something like this >> >> add_executable(foo a.cpp b.cpp) >> set_property(TARGET shell APP

Re: [CMake] [cmake-developers] Appending to LINK_FLAGS property of a target doesn't seem to work correctly

2016-03-04 Thread Dan Liew
On 3 March 2016 at 22:02, Nils Gladitz <nilsglad...@gmail.com> wrote: > On 03.03.2016 22:57, Dan Liew wrote: >> >> Hi, >> >> I noticed recently is you do something like this >> >> add_executable(foo a.cpp b.cpp) >> set_property(TARGET shell APP

Re: [CMake] Problem using VS-compiled Clang as a C/C++ compiler.

2016-03-04 Thread Dan Liew
Hi, On 4 March 2016 at 11:16, Anton Yartsev wrote: > Hi Cristian, > > thanks for the replay. I have clang-cl first in PATH, the problem persists. Just to check. Did you run cmake in a new (i.e. empty) build directory when you fixed that? IIRC once a compiler has been

[CMake] Appending to LINK_FLAGS property of a target doesn't seem to work correctly

2016-03-03 Thread Dan Liew
Hi, I noticed recently is you do something like this add_executable(foo a.cpp b.cpp) set_property(TARGET shell APPEND PROPERTY LINK_FLAGS "-fopenmp") set_property(TARGET shell APPEND PROPERTY LINK_FLAGS "-static") then the flags that end up being passed to the compiler during linking are like

[cmake-developers] Appending to LINK_FLAGS property of a target doesn't seem to work correctly

2016-03-03 Thread Dan Liew
Hi, I noticed recently is you do something like this add_executable(foo a.cpp b.cpp) set_property(TARGET shell APPEND PROPERTY LINK_FLAGS "-fopenmp") set_property(TARGET shell APPEND PROPERTY LINK_FLAGS "-static") then the flags that end up being passed to the compiler during linking are like

Re: [cmake-developers] [CMake] Obtaining header file dependencies of a source file manually

2015-12-01 Thread Dan Liew
>> There is an alternative which I suggested in the post. Have CMake >> determine the dependencies of the files passed to ``IMPLICIT_DEPENDS`` >> at configure time and spit that into the build files of the generator >> (that would work for any generator). Then have any changes made to the >> files

Re: [CMake] [cmake-developers] Obtaining header file dependencies of a source file manually

2015-12-01 Thread Dan Liew
>> There is an alternative which I suggested in the post. Have CMake >> determine the dependencies of the files passed to ``IMPLICIT_DEPENDS`` >> at configure time and spit that into the build files of the generator >> (that would work for any generator). Then have any changes made to the >> files

Re: [CMake] [cmake-developers] Obtaining header file dependencies of a source file manually

2015-12-01 Thread Dan Liew
> I fail to see why that should not work. Producing LLVM bitcode from > C++ with Clang is just adding -emit-llvm flag, right? So, why can't > the SuperBuild configure the child build to use Clang and this flag? > And Bob's your uncle... Hmm, to be honest I hadn't tried. It works better than

Re: [cmake-developers] Obtaining header file dependencies of a source file manually

2015-12-01 Thread Dan Liew
> I fail to see why that should not work. Producing LLVM bitcode from > C++ with Clang is just adding -emit-llvm flag, right? So, why can't > the SuperBuild configure the child build to use Clang and this flag? > And Bob's your uncle... Hmm, to be honest I hadn't tried. It works better than

Re: [cmake-developers] [CMake] Obtaining header file dependencies of a source file manually

2015-11-30 Thread Dan Liew
On 30 November 2015 at 18:35, Brad King <brad.k...@kitware.com> wrote: > On 11/30/2015 01:32 PM, Dan Liew wrote: >> It works but only for makefile generators... That's an annoying >> limitation. I'll file a feature request to get this implemented for >> other generat

Re: [CMake] [cmake-developers] Obtaining header file dependencies of a source file manually

2015-11-30 Thread Dan Liew
On 30 November 2015 at 18:35, Brad King <brad.k...@kitware.com> wrote: > On 11/30/2015 01:32 PM, Dan Liew wrote: >> It works but only for makefile generators... That's an annoying >> limitation. I'll file a feature request to get this implemented for >> other generat

Re: [CMake] [cmake-developers] Obtaining header file dependencies of a source file manually

2015-11-30 Thread Dan Liew
> For other generators that are Makefile or Ninja based I guess that > approach wouldn't work. Sorry that should read For other generators that **aren't** Makefile or Ninja based I guess that approach wouldn't work. -- Powered by www.kitware.com Please keep messages on-topic and check the

Re: [CMake] [cmake-developers] Obtaining header file dependencies of a source file manually

2015-11-30 Thread Dan Liew
Hi Michael, > Not going into detail as I'm typing on the phone, but this really sounds > like a case where a "SuperBuild" > (http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html) > can help you to simplify things a lot. Thanks for the suggestion but this certainly is not a

Re: [cmake-developers] Obtaining header file dependencies of a source file manually

2015-11-30 Thread Dan Liew
Hi Michael, > Not going into detail as I'm typing on the phone, but this really sounds > like a case where a "SuperBuild" > (http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html) > can help you to simplify things a lot. Thanks for the suggestion but this certainly is not a

Re: [cmake-developers] Obtaining header file dependencies of a source file manually

2015-11-30 Thread Dan Liew
Hi, On 30 November 2015 at 18:03, Dan Liew <d...@su-root.co.uk> wrote: > Hi, > > On 30 November 2015 at 08:09, Petr Kmoch <petr.km...@gmail.com> wrote: >> Hi Dan, >> >> you could look into the IMPLICIT_DEPENDS argument of add_custom_command: >>

Re: [CMake] [cmake-developers] Obtaining header file dependencies of a source file manually

2015-11-30 Thread Dan Liew
Hi, On 30 November 2015 at 08:09, Petr Kmoch wrote: > Hi Dan, > > you could look into the IMPLICIT_DEPENDS argument of add_custom_command: > https://cmake.org/cmake/help/latest/command/add_custom_command.html > > I don't have direct experience with it, but it looks like it

Re: [cmake-developers] Obtaining header file dependencies of a source file manually

2015-11-30 Thread Dan Liew
Hi, On 30 November 2015 at 08:09, Petr Kmoch wrote: > Hi Dan, > > you could look into the IMPLICIT_DEPENDS argument of add_custom_command: > https://cmake.org/cmake/help/latest/command/add_custom_command.html > > I don't have direct experience with it, but it looks like it

[CMake] Obtaining header file dependencies of a source file manually

2015-11-29 Thread Dan Liew
Hi, # TL;DR I need a way of determining the header file dependencies of a source file and inform CMake about them. CMake doesn't do this automatically because I'm using custom commands for the compilation step so CMake doesn't do it's usual magic of automatically inferring source file header

Re: [CMake] CMAKE_BUILD_TYPE and exact control of compiler options

2015-10-13 Thread Dan Liew
Hi, > - If not, what is the best/official way to get exact control over the compiler > and linker options used? I had to do something similar recently where I didn't want ``-DNDEBUG`` to be in any of the configurations. I used ``CMAKE_USER_MAKE_RULES_OVERRIDE `` to set the path to file

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
On 4 August 2015 at 14:32, Iosif Neitzke iosif.neitzke+cm...@gmail.com wrote: And: A target created in the same directory (CMakeLists.txt file) that specifies any output of the custom command as a source file is given a rule to generate the file using the command at build time.

Re: [cmake-developers] [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
foolib is defined in this CMakeLists.txt: https://github.com/delcypher/cmake_add_custom_command_bug/blob/master/lib/CMakeLists.txt That is the (only) context in which you can extend the definition of the target with custom commands. Since when? I haven't seen that documented anywhere. IMHO

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
foolib is defined in this CMakeLists.txt: https://github.com/delcypher/cmake_add_custom_command_bug/blob/master/lib/CMakeLists.txt That is the (only) context in which you can extend the definition of the target with custom commands. Since when? I haven't seen that documented anywhere. IMHO

[CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
properties of the target. Seems like there's some sort of weird scope issue going on here. Thoughts? [1] https://github.com/delcypher/cmake_add_custom_command_bug [2] https://github.com/delcypher/cmake_add_custom_command_bug/blob/master/test/CMakeLists.txt Thanks, Dan Liew -- Powered

[cmake-developers] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
properties of the target. Seems like there's some sort of weird scope issue going on here. Thoughts? [1] https://github.com/delcypher/cmake_add_custom_command_bug [2] https://github.com/delcypher/cmake_add_custom_command_bug/blob/master/test/CMakeLists.txt Thanks, Dan Liew -- Powered

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
On 4 August 2015 at 14:20, Iosif Neitzke iosif.neitzke+cm...@gmail.com wrote: Dependencies listed with the DEPENDS argument may reference files and outputs of custom commands created with add_custom_command() in the same directory (CMakeLists.txt file).

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
I haven't seen that documented anywhere. IMHO this behavior is counter-intuitive, in general I expect the scope of a target to not depend on the cmake command I am trying to use. I think it is sensible that the definition of a target is scoped to one single directory. Where the

Re: [cmake-developers] [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
I haven't seen that documented anywhere. IMHO this behavior is counter-intuitive, in general I expect the scope of a target to not depend on the cmake command I am trying to use. I think it is sensible that the definition of a target is scoped to one single directory. Where the

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
For reference I've opened up a bug report http://www.cmake.org/Bug/view.php?id=15681 -- 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

Re: [cmake-developers] [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
For reference I've opened up a bug report http://www.cmake.org/Bug/view.php?id=15681 -- 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

[cmake-developers] Incorrect path handling in generation of export files

2015-06-22 Thread Dan Liew
Hi, There is a bug in CMake's export file generator where it does not correctly escape Windows paths when generating export files . This was originally reported on the LLVM mailing list [1]. I'm using CMake 3.2.3. In a generated export file I see ``` # Create imported target LLVMDebugInfoPDB

Re: [CMake] Recursively include target include directories only

2015-06-18 Thread Dan Liew
Can you explain what you mean by strong and weak symbols? Google is your friend https://en.wikipedia.org/wiki/Weak_symbol http://stackoverflow.com/questions/2290587/gcc-style-weak-linking-in-visual-studio -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ

Re: [CMake] Recursively include target include directories only

2015-06-18 Thread Dan Liew
Hi, On 18 June 2015 at 12:16, Robert Dailey rcdailey.li...@gmail.com wrote: On Thu, Jun 18, 2015 at 12:02 PM, Dan Liew d...@su-root.co.uk wrote: Can you explain what you mean by strong and weak symbols? Google is your friend https://en.wikipedia.org/wiki/Weak_symbol http

Re: [CMake] Recursively include target include directories only

2015-06-18 Thread Dan Liew
This is the approach that the LLVM project uses which is very simple and very clean (take a look at the sources). This also works very well for installing your header files, the contents of ${CMAKE_SOURCE_DIR} just need to be copied into /usr/include . Oops I meant to say the contents of

Re: [CMake] Recursively include target include directories only

2015-06-18 Thread Dan Liew
The reason I'm asking this question is because of how I handle unit tests in CMake right now. Instead of just defining an executable target for the test and then adding a link dependency on the library containing the class or set of classes to be tested, I am manually pulling in the CPP and H

Re: [CMake] Recursively include target include directories only

2015-06-17 Thread Dan Liew
On 17 June 2015 at 12:28, Robert Dailey rcdailey.li...@gmail.com wrote: Is there a way to only take (recursively) the include directiories from a target or set of targets? I know that include directories propagate when passing targets to target_link_libraries(), but I do not want to link the

Re: [CMake] (no subject)

2015-05-22 Thread Dan Liew
Hi, On 21 May 2015 at 23:00, lucas.pet...@engilitycorp.com wrote: Hello, I am trying to compile a code written in C, but using an external library that contains C++ functions. I am on a Cray system and everything works if I manually link with the cray CC wrapper. When I change the linker

[CMake] OBJECT libraries and target visibility properties seem broken

2015-05-19 Thread Dan Liew
Hi, I'm not sure if this is actually a bug but I've been relying on the OBJECT library[1] feature as a convenient way of having source code in multiple directories be put into a shared library. I now have a need to hide the symbols in my libraries but I've found that using OBJECT libraries means