[CMake] Help Accommodating Ninja when including CMAKE_CURRENT_BINARY_DIR

2018-04-27 Thread Stephen McDowell
Hello, I have looked around and seen a few issues discussing this, but have not seen any solutions. It seems related to this: https://gitlab.kitware.com/cmake/cmake/issues/17450 In the sense that absolute paths are desired. 1. Previously,

Re: [CMake] Help Accommodating Ninja when including CMAKE_CURRENT_BINARY_DIR

2018-04-27 Thread Stephen McDowell
Upon further inspection, it seems more related to PRE_BUILD. The step to generating the files is through a add_custom_command call, which from the docs apparently may end up being PRE_LINK. I tried generating into the ${CMAKE_CURRENT_SOURCE}/include/nanogui, which will work for Makefiles but

Re: [CMake] Help Accommodating Ninja when including CMAKE_CURRENT_BINARY_DIR

2018-04-28 Thread Stephen McDowell
​After much deliberation, I was never successful in getting a synthetic target to work as expected. The dilemma is that `add_custom_command` cannot specify both `TARGET` and `OUTPUT`, the work flow was something like add_custom_target(resource-dependency) add_custom_command(TARGET

Re: [CMake] Spaces in conditional output of generator expressions

2018-06-02 Thread Stephen McDowell
It should be a CMake list, which is delineated by semicolons. add_compile_options($<$-Wall;-Wextra>) I am writing this from a phone so untested, but that has worked for me in the past. -Stephen On Sat, Jun 2, 2018, 3:47 PM Neil Carlson wrote: > I'm attempting to use a generator expression

Re: [CMake] advice for resolving errors with CMake 3.8

2018-05-03 Thread Stephen McDowell
If you don't want to have to keep switching to Windows and back to test, the most reliable way to know with absolute certainty is to install CMake 3.8 on OSX and use that. Fortunately building cmake is actually quite easy, you can even use the newer cmake from brew to configure the older one (use

Re: [CMake] libc++ usage in CMake with Clang?

2018-08-20 Thread Stephen McDowell
Good question. The only official thing I could find that is _somewhat_ related is this: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_STL_TYPE.html#variable:CMAKE_ANDROID_STL_TYPE Doesn't really help if you aren't targeting Android though On Mon, Aug 20, 2018, 10:48 AM Robert

Re: [CMake] CMAKE doesn't pass NVCC flags?

2018-07-24 Thread Stephen McDowell
I think you are mixing old and new approaches. Since you have enabled the CUDA language (via your project(...) call), you should be using either CUDAFLAGS or CMAKE_CUDA_FLAGS. I think CUDA_NVCC_FLAGS is only used for the old cuda_add_library or executable functions. Note that finding the cuda

Re: [CMake] Packaging dylibs into app bundles

2018-07-19 Thread Stephen McDowell
Hi Harry, I don't know how useful this will be, but the Instant Meshes application creates an app bundle that has always worked reliably for me. Looking at the code, it doesn't appear like there's much custom stuff going on either. It starts here

Re: [CMake] specifying path for license file for commercial compiler?

2018-07-07 Thread Stephen McDowell
I agree that a toolchain file is more appropriate, noting that typically modifying the environment variables is much more common for there's compilers (particularly using environment modules). However, since you've started clearly you would rather not set the environment variables, there may be

[CMake] Modern CMake + CUDA + Clang

2018-03-11 Thread Stephen McDowell
Hello! I stumbled across the new 3.8+ CUDA as a language capabilities, and am very excited about this! 1. Does anybody know when CMAKE_CUDA_COMPILER_ID and CMAKE_CUDA_COMPILER_VERSION were fixed? With cmake 3.9.4 some of the cuda compiler variables were unset: message("CXX compiler

Re: [CMake] Modern CMake + CUDA + Clang

2018-03-11 Thread Stephen McDowell
I found the GitLab tracker: https://gitlab.kitware.com/cmake/cmake/issues/16586 -- 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

Re: [CMake] Modern CMake + CUDA + Clang

2018-03-13 Thread Stephen McDowell
Excellent, this is very useful — thanks Robert! I think I have some answers to some of these, but as I make progress will probably reach out to the LLVM mailing lists for help / suggestions (particularly with separable compilation and device linking). I’m still ramping up to speed on

Re: [CMake] Modern CMake + CUDA + Clang

2018-03-13 Thread Stephen McDowell
Whoops… sorry I replied to the mail server, please ignore this thread and let it die, see issue tracker linked in second post. -- 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

[CMake] Advice on how to remove duplicated code for object and interface library setup

2018-03-15 Thread Stephen McDowell
I am trying to obey modern CMake target-based practices, with a twist that everything is available as an OBJECT library if desired. I have this working and can explain why if desired, but I feel it is extraneous for this question. What I create: - mylib <- the main library - mylib_obj <-

Re: [CMake] How to build CMake so it works on an older Linux?

2018-04-05 Thread Stephen McDowell
Hi Suzuki, (Note: to other CMake mailing list readers, this pertains very little to CMake itself. I’m sending it to the mailing list so that future users with this issue may also have a possible solution). Getting a newer version of GCC is quite challenging by yourself indeed, but you may be

[CMake] CMake Version Specific Code and Testing

2018-04-03 Thread Stephen McDowell
Hello, Suppose I have a cmake_minimum_required(VERSION 2.8.12) project I would like to contribute to. So when I am testing code for a v2.8.12 project, but my installed CMake version is say 3.10, if I (accidentally, or through ignorance) write code that would only work in CMake 3.x but not in

Re: [CMake] CMake Version Specific Code and Testing

2018-04-03 Thread Stephen McDowell
Ok cool thank you for explaining! Somewhat related, I really enjoy that I can build CMake 2.8.12 with CMake 3.10 :) -- 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

Re: [CMake] Generator for Visual Studio Code (Ubuntu)

2018-03-19 Thread Stephen McDowell
You may also find this article useful, it seems to explain how to configure the JSON files you need to for more complicated build systems: https://medium.com/audelabs/c-development-using-visual-studio-code-cmake-and-lldb-d0f13d38c563

Re: [CMake] file(TO_NATIVE_PATH ... ) and cross-compiling

2018-03-21 Thread Stephen McDowell
Disclaimer: I cannot speak to intent, and have never used these before. So since you’re cross compiling, when looking at the docs ( https://cmake.org/cmake/help/v3.0/command/file.html ), I think you can get away with using TO_CMAKE_PATH. I

Re: [CMake] Advice on how to remove duplicated code for object and interface library setup

2018-03-21 Thread Stephen McDowell
Hi Deniz, Thanks for the response! I tested it out and it seems to work exactly as you describe :) I don’t want to depend on an un-released version of CMake though. The original desire is because I kept making mistakes / adding definitions for one and not the other (code duplication at its

Re: [CMake] should zlib be searched in CMAKE_PREFIX_PATH or am I confused?

2018-03-22 Thread Stephen McDowell
Hi Mario, Very sorry, I should have looked more closely! CMAKE_MODULE_PATH is for libraries that install their own CMake scripts. You are correct, Zlib only installs a pkg-config script. However, FindZLIB.cmake doesn’t appear to use that at all (aka I don’t believe you need to be setting

Re: [CMake] should zlib be searched in CMAKE_PREFIX_PATH or am I confused?

2018-03-22 Thread Stephen McDowell
That’s progress though? :) Hmmm. I understand your problem now, but I don’t know how to fix it. You can do things like find_package(ZLIB NO_DEFAULT_PATH) That makes it so the system Zlib won’t be found, but I couldn’t then get `cmake .. -DZLIB_ROOT=xxx` to work :/ There are other NO_*

Re: [CMake] should zlib be searched in CMAKE_PREFIX_PATH or am I confused?

2018-03-21 Thread Stephen McDowell
Hi Mario, Do you get different results if you set CMAKE_MODULE_PATH rather than CMAKE_PREFIX_PATH? I wrote a tutorial for how to install a library called librealsense, at the very bottom is what will interest you:

[CMake] Choosing SSE / AVX Flag Advice

2018-03-21 Thread Stephen McDowell
Hello, I was originally using -march=native for non-windows, but in my attempts to support embedded architectures learned that this flag is broken and/or does nothing for many compilers (fixed for ARM in gcc 8 I think though). Enter the glorious work of the folks at Vc:

[CMake] Relation Between CMP0074 and Installed Config Files

2018-09-12 Thread Stephen McDowell
Hello, I am on the task force for modernizing the CMake build system of a large project, the Point Cloud Library (PCL). Satisfying policy CMP0074 [1] has us somewhat confused about what we should be doing. At *build time*, we understand. Our numerous FindStuff.cmake modules (some of which we

Re: [CMake] [cmake-developers] libc++ usage in CMake with Clang?

2018-09-13 Thread Stephen McDowell
Hello, I wanted to revisit this topic. Craig gave a great answer for using add_{compile,link}_options which mostly answers the question -- this is the most modern way at this time. However, I believe that CMake would really benefit from standardizing this. For example, CMAKE_CXX_STL_TYPE. I