[CMake] Custom Configurations and CMAKE__FLAGS__INIT

2018-03-21 Thread Marek Vojtko (Firaxis)
Hi, Do CMAKE__FLAGS__INIT variables not automatically populate CMAKE__FLAGS_ variables for *custom* configurations? When I use the _INIT variables for one of the default configuration names, e.g. CMAKE_C_FLAGS_DEBUG_INIT or CMAKE_C_FLAGS_RELEASE_INIT, they correctly populate their "usage" cou

[CMake] Cygwin DS-5 Arm Cross-compiling and how to get past Compiler Check error w/ Absolute path

2018-03-21 Thread Jimi Damon
Hi, I have an issue running the 16.1 DS-5 Arm compiler tool suite that is based around the GNU arm embedded toolchain. The problem is that these compilers cannot process the Cygwin path structure ( Ie /cygdrive/c/path/to/file ). I have a build that works perfectly under Linux using CMake a

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 f

[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: https://github.com/VcD

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

2018-03-21 Thread Miroslav Keš
Hi! I have question concerning the file(TO_NATIVE_PATH ...) behavior. The documentation says: "The TO_NATIVE_PATH mode converts a cmake-style into a native path with platform-specific slashes (\ on Windows and / elsewhere)."  ... but it doesn't say if the decision is made based on the CMAKE_SYS

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: https://gist.github.com/svenevs/f00ed3898d2af6248921b63254aa8cc1#enable-libreals

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

2018-03-21 Thread Mario Emmenlauer
Dear All, I use find_package(ZLIB) to detect zlib on Ubuntu 16.04 Linux. I have a newer zlib in /data/thirdparty that I'd like to use. To prefer my newer version I add -DCMAKE_PREFIX_PATH="/data/thirdparty". In my understanding, the documentation says CMAKE_PREFIX_PATH is searched first (1). But

[CMake] find_package() for static only / shared only

2018-03-21 Thread Mario Emmenlauer
I've googled this issue for a while now but found only few references (1,2) and no solution. I'd like to enforce that find_package() will only accept static or shared libraries. I would then set this option based on BUILD_SHARED_LIBS=(ON|OFF). I.e. I'd love to have something like: if(BUILD_SH