Re: [CMake] CCACHE_DIR Environment Variable

2017-01-31 Thread Florent Castelli
On 31/01/2017 23:34, Craig Scott wrote: If you need to set CCACHE_DIR as an environment variable, then my previous email shows how to embed that in the launcher script, which will work for both Xcode and Linux (since the same launcher script is ultimately being invoked for both cases). All

Re: [CMake] Forcing linking compatability to old libc / libstdc++ (Linux)

2017-01-26 Thread Florent Castelli
I've had to deal with this in the past. For glibc, it's more tricky since when you compile on a newer distribution, it will automatically use the newer version of some symbols. Some functions have had breaking changes and to keep compatibility, they kept all the different version in the

Re: [CMake] Disabling INSTALL target for subdirectory

2017-02-16 Thread Florent Castelli
Use add_subdirectory(... EXCLUDE_FROM_ALL) to prevent anything in there to be installed by default. I had the issue in one project and it did fix it for us. Also, 3rdparty libraries should be tagged like that anyway to be built only when they are used by the main targets. /Florent On Feb 16,

Re: [CMake] import external library

2017-02-15 Thread Florent Castelli
You can either unpack the target at generation time (recommended). Or you could create an INTERFACE target instead. The first solution is recommended as I believe it's important to have access to all the sources (for IDEs for example) before actually starting the build process. /Florent On

Re: [CMake] CMake, VS, Nsight Tegra, NDK, mixed C/C++ - applies C++ options to C source

2016-12-14 Thread Florent Castelli
I'm pretty sure that the toolchain bundled with the NDK, made by Google, hasn't been tested with other generators than Ninja or possibly Make. Also, there are some known bugs with it, including the one related to CMAKE_CXX_STANDARD (see https://code.google.com/p/android/issues/detail?id=227915

Re: [CMake] Using a header only library that links uses Objective-C headers

2016-11-30 Thread Florent Castelli
You don't compile a header only library (unless you're talking about precompiled headers, which I think you don't). What you need is compiling the sources using it as Objective C. Which is a matter of adding target_compile_options( PRIVATE "-ObjC") on the target with the sources if I remember

Re: [CMake] Building third party libraries along with normal targets

2017-03-29 Thread Florent Castelli
On 30/03/2017 02:10, Robert Dailey wrote: Interested in hearing everyone's thoughts on this idea of mine. Right now I have several third party libraries: openssl, boost, libpng, zlib, etc. List goes on. I need to support these libraries on at least 3 different platforms: ARM android, x86 linux,

Re: [CMake] Building third party libraries along with normal targets

2017-03-29 Thread Florent Castelli
On 30/03/2017 03:54, Robert Dailey wrote: On Wed, Mar 29, 2017 at 8:18 PM, Florent Castelli <florent.caste...@gmail.com> wrote: This is known as "super build". Yes, this is exactly why I made my Boost CMake build scripts, which you use unless you changed your mind today :) You

Re: [CMake] Building third party libraries along with normal targets

2017-03-29 Thread Florent Castelli
On 30/03/2017 04:38, Robert Dailey wrote: At the end of the day, I've solved the Boost problem but I have many other libraries I still manually build: openssl, libpng, zlib, etc. It's as you said, maintaining build scripts for all of these will be challenging but I think that's the proper way to

Re: [CMake] Predownload

2017-04-17 Thread Florent Castelli
It is possible. Nothing prevents you from calling execute_process to download as extract your toolchain file when it is run. You probably want to check the destination folder for a pre existing download though. Then, you proceed on configuring Cmake to use it as usual. /Florent On Apr 17, 2017

Re: [CMake] Predownload

2017-04-17 Thread Florent Castelli
t;> toolchain(s) to use for each sub build. >> >> >> On Tue, Apr 18, 2017 at 8:03 AM, Florent Castelli < >> florent.caste...@gmail.com> wrote: >> >>> It is possible. >>> >>> Nothing prevents you from calling execute_process to download

Re: [CMake] Internal Interface Libraries and Header Dependencies

2017-07-12 Thread Florent Castelli
If they were not propagated, it wouldn't compile at all, so they're definitely there somewhere. Can you show your CMakeLists.txt files? /Florent On 12/07/2017 19:59, Christian Mazakas wrote: To give a brief overview of what I'm trying to do, right now I'm working on a project with tests. I

Re: [CMake] CMake Server Mode and USE_FOLDERS

2017-07-04 Thread Florent Castelli
From what I've read from the VS CMake team at Microsoft in various blog posts and online discussions, they plan to have actual targets someday in VS instead of the "Open folder" structure they currently have with their integration. So right now, that information wouldn't be of any use for them

Re: [CMake] Generating include files

2017-05-20 Thread Florent Castelli
On 20/05/2017 13:32, Urs Thuermann wrote: Yes, but not directly. The executable depends on the object file, and the object file depends on the (created) source file. Since "depends on" is transitive, the executable also depends on the source file. Still, I would prefer to write

Re: [CMake] [cmake-developers] How should config packages handle components?

2017-09-01 Thread Florent Castelli
On 01/09/2017 20:40, Alex Turbov wrote: Hi Robert, On Fri, Sep 1, 2017 at 9:21 PM, Robert Dailey > wrote: One problem I thought of with the former (one big target.cmake with all import targets in there) is that if you only

Re: [CMake] Using find_package() portably?

2017-11-29 Thread Florent Castelli
On 29/11/2017 12:02, Johannes Zarl-Zierl wrote: Hello Carsten, On Samstag, 25. November 2017 11:46:44 CET Carsten Fuchs wrote: Thanks for your reply, but how can I proceed from here? In order to be able to write in the parent script something that works in either case, that is,

Re: [CMake] Remove compilation flags for a given target

2019-04-09 Thread Florent Castelli
I believe that your targets should be using something like: target_compile_options(yourlib PRIVATE -Wwhatever) They will be built with said warnings, but it won't be propagated to consumers of the library. So you shouldn't have to remove anything. On Tue, Apr 9, 2019 at 8:47 AM Benjamin Orgogozo

[cmake-developers] [PATCH] Only search for install_name_tool if the toolchain has it

2014-07-01 Thread Florent Castelli
When cross compiling, toolchains won't have install_name_tool, which is provided by Xcode and command line tools on OSX. This is a Mach-O specific utility and not required on all platforms. --- Modules/CMakeFindBinUtils.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[cmake-developers] iOS support

2014-09-23 Thread Florent Castelli
Hi! My company is organizing soon a hack week where each employee is able to work on any project he wants. So, I've decided to work with Cmake and improve support for iOS to help the product team getting rid of manual project files, constant merge conflicts and bad project file documentation,

Re: [cmake-developers] iOS support

2014-09-23 Thread Florent Castelli
On 23 Sep 2014, at 16:56, Bill Hoffman bill.hoff...@kitware.com wrote: That said it would be really cool to beef up the xcode support enough to be able to create an actual ios app. I have not dug into that enough. Should be able to do most of it with CMAKE_XCODE_ATTRIBUTE. I will look

Re: [cmake-developers] iOS support

2014-10-01 Thread Florent Castelli
Thanks for the detailed information. My hackweek starts on Monday and I'll start working on these issues then. I'll work on finding a way to unify toolchain files for simulator and devices first. I don't think I'll try to work on iOS8 features since my company is shipping for iOS6 and there are so

Re: [cmake-developers] A CMAKE_EMULATOR variable

2015-03-04 Thread Florent Castelli
Sometimes, it’s not just about an emulator but a wrapper script that can run the target binary on a remote host or with the right environment (or use valgrind, helgrind, whatevergrind...). I’d be nice to have the option in ctest to use some script to run a test program and an option to set it

[cmake-developers] Custom commands with Ninja on Windows

2015-06-12 Thread Florent Castelli
Hi! I'm having some issues with Ninja on Windows with long custom commands (or actually a long succession of short commands appended to the same target). The problem is that they get concatenated in one single command using and it is pretty easy to go over the 8k command line size limit on

Re: [cmake-developers] Custom commands with Ninja on Windows

2015-06-15 Thread Florent Castelli
Alright, I'll see what I can do when I find some free time to work on this then! /Florent On Mon, Jun 15, 2015 at 3:14 PM, Brad King brad.k...@kitware.com wrote: On 06/12/2015 06:01 AM, Florent Castelli wrote: So I've been thinking that on Windows, instead of concatenating everything, we

Re: [cmake-developers] NMake Batch-Mode Rules (was: Inquiry on contribution to NMake generator)

2015-06-01 Thread Florent Castelli
At my company, we didn’t bother trying to use NMake. We used the Visual Studio solution generator and the proper compilation flags and msbuild flags to build in parallel. This proved to speedup our builds quite a lot and was very easy to integrate. The other solution you mentioned is “ninja” and

Re: [cmake-developers] FindPython.cmake alternative for FindPythonInterp.cmake and FindPythonLibs.cmake

2015-06-30 Thread Florent Castelli
I just want to add that I also saw a colleague running in the issue described in the beginning of the thread and that the version reported by the Python module and the PythonLibs one were different strings, even though the version was actually the same. It happened on latest Debian I think. How I

Re: [cmake-developers] Listing source-tree files encountered

2015-07-18 Thread Florent Castelli
I've used that once and you end up with the relative path to the sources from the CMakeLists.txt. If you're in another CMakeLists.txt, then you can't use the paths directly. I tried a few properties but I couldn't find any property to get the folder where the target was defined. How do you

Re: [cmake-developers] [PATCH] FindBoost: Add imported targets

2015-11-16 Thread Florent Castelli
It’s nice and I was thinking of doing the same! But one there’s one thing that comes to mind. Some compiled libraries have dependencies on other compiled libraries. Don’t you think it would make sense to teach FindBoost about those so we link everything properly? And also maybe add the native

Re: [cmake-developers] Toward a more deterministic ninja generator

2016-06-15 Thread Florent Castelli
To this, I would add that you could also remove duplicates. They’re rare but can happen in some conditions and trigger warnings in Ninja. /Florent > On 14 Jun 2016, at 17:18, Nicolas Desprès wrote: > > Hi, > > While working on something else I wrote this patch: >

Re: [cmake-developers] New module to verify that python libraries are available on the system

2016-05-03 Thread Florent Castelli
"exec(\"import sys\\ntry:\\n import numpy\\nexcept:\\n sys.exit(0)\\nsys.exit(1)\")" This seems to be great to check that numpy exists! You're probably missing a variable somewhere ;) /Florent On 03/05/2016 20:37, Francois Budin wrote: Hello everyone, I wrote a short macro for one

Re: [cmake-developers] [PATCH] Use full path for all source files in ninja build.

2016-08-06 Thread Florent Castelli
I'd say that you shouldn't do this unless you have tested it extensively with very long command lines, making sure that there is a response file fallback if it grows too much. There are issues in CMake already on Windows with long command lines and having even longer ones is not going to help.

Re: [cmake-developers] Need ideas/opinions on third party library management

2016-08-16 Thread Florent Castelli
At Spotify, we use CMake a lot for our large C++ library shared by all the clients. After trying to build libraries for each platform and variant, we basically gave up and we now use a super-build approach. For example, Boost is used by 5 platforms: Windows, OSX, Linux, Android and iOS. Each

Re: [cmake-developers] [Discussion] Add python support for CMakeLists

2017-01-16 Thread Florent Castelli
Well, CMake scripts can be written in a somewhat declarative form now. What prevents this now is that a lot of people use indirections everywhere. For example: add_library(foo STATIC ${SRCS}) If it was a plain list, any decent IDE would be able to parse this and add another file to the list

Re: [cmake-developers] [Discussion] Add python support for CMakeLists

2017-01-16 Thread Florent Castelli
> > It's up to users to use generator expressions instead of if(WIN32) or > whatever: > > add_library(foo > foo.cpp > $<$:foo_win.cpp> > ) > > This has been possible for years and was designed with IDEs in mind: Sure, it’s possible, but it’s not very user friendly or declarative (you

Re: [cmake-developers] Need ideas/opinions on third party library management

2016-08-16 Thread Florent Castelli
ery interesting discussion, we have the same issues here. > > Florent Castelli, how many third parties libraries do you use ? I think a > super build can be a very good solution but I'm wondering how much third > party code you have to build. Here we use OpenCV, with, boost, and poco

Re: [cmake-developers] Android Support

2016-09-26 Thread Florent Castelli
On 12/09/2016 15:09, Brad King wrote: On 09/09/2016 04:04 PM, Robert Dailey wrote: Currently nightly builds are tagged 3.6.2. Are there no nightly builds for 3.7 or am I missing something? They are 3.6.2.$date, indicating post-3.6 feature development. See the documentation of CMAKE_VERSION:

Re: [cmake-developers] Unix makefile: concurrent build configurations

2016-08-23 Thread Florent Castelli
Well, I imagine we could have a shim that will automatically create sub-build directories when you specify a CONFIGURATION=... argument or just starts the build in there. And if a build folder is missing but the configuration is declared, it would run CMake with similar startup arguments. In

Re: [cmake-developers] Android Support

2016-09-27 Thread Florent Castelli
That’s great to know, thanks! Is there any plan on having their toolchain in CMake directly at some point? I’m afraid that even if they update their options to use the upstream support, they may not allow using those options directly and we’ll still have to support 2 toolchains. That’s

Re: [cmake-developers] Android variables

2016-11-12 Thread Florent Castelli
On 12/11/2016 13:35, Ruslan Baratov wrote: On 12-Nov-16 19:09, Florent Castelli wrote: On 12/11/2016 06:53, Ruslan Baratov wrote: On 12-Nov-16 08:21, Florent Castelli wrote: On 10/11/2016 16:05, Ruslan Baratov via cmake-developers wrote: Hi, I wonder if it's possible to introduce next

Re: [cmake-developers] Android variables

2016-11-11 Thread Florent Castelli
On 10/11/2016 16:05, Ruslan Baratov via cmake-developers wrote: Hi, I wonder if it's possible to introduce next variables describing Android tools: * C preprocessor. Similar to CMAKE_CXX_COMPILER the variable that will contain the path to preprocessor. Example: * CMAKE_CXX_COMPILER =

Re: [cmake-developers] Android variables

2016-11-12 Thread Florent Castelli
On 12/11/2016 06:53, Ruslan Baratov wrote: On 12-Nov-16 08:21, Florent Castelli wrote: On 10/11/2016 16:05, Ruslan Baratov via cmake-developers wrote: Hi, I wonder if it's possible to introduce next variables describing Android tools: * C preprocessor. Similar to CMAKE_CXX_COMPILER

Re: [cmake-developers] CMake integration in Gradle (Android Studio)

2016-10-31 Thread Florent Castelli
I tried the Gradle + CMake integration and I'm not really impressed. I would recommend not using it right now until they fix the rough edges. The prime concern is that it is REALLY hard to get the CMake output and compilation output, even within Android Studio. If you compile from command line,

Re: [cmake-developers] Add property to get all linked libraries including transitive ones

2016-11-02 Thread Florent Castelli
One usage I would have had for this feature would have been to generate a pre-linked library. Basically, merging a static library and its dependencies together (check ld -r) and output an object file for static linking (not a shared library). This is required as merging static libraries may

Re: [cmake-developers] Unknown Imported & Global libraries

2017-01-09 Thread Florent Castelli
> On 9 Jan 2017, at 20:55, Brad King <brad.k...@kitware.com> wrote: > > On 12/21/2016 07:12 AM, Florent Castelli wrote: >> find_package(foo) >> if(NOT FOO_FOUND) >> add_library(foo STATIC foo.cpp) >> endif() > > Instead do > > find_pack

[cmake-developers] Unknown Imported & Global libraries

2016-12-21 Thread Florent Castelli
Hi, In my project, I have to deal with 3rd party libraries. Either the library is available on the system and then I will try to use that, or I will use sources bundled in my repository. This is in order to make Linux maintainers happy who want to have a system-wide shared library, but to also

Re: [cmake-developers] Support for unified headers in Android NDK

2017-04-20 Thread Florent Castelli
I just came back from some holidays now, I'll try to update the MR with the latest changes soon next week! /Florent On Apr 20, 2017 10:10 PM, "Robert Dailey" wrote: > I may pick this up, because right now it's impossible to use libc++ > (LLVM) with an API less than 21

Re: [cmake-developers] Compile targets affected by changeset

2017-05-22 Thread Florent Castelli
> On 22 May 2017, at 20:07, Robert Patterson via cmake-developers > wrote: > > We understand that CMake and make already can rebuild targets which depend on > changed files, and this behavior works exactly as expected for us. Our issue > is not that make is

Re: [cmake-developers] Compile targets affected by changeset

2017-05-22 Thread Florent Castelli
On Tue, May 23, 2017 at 4:54 AM, Florent Castelli <florent.caste...@gmail.com <mailto:florent.caste...@gmail.com>> wrote: On 22 May 2017, at 20:07, Robert Patterson via cmake-developers <cmake-developers@cmake.org <mailto:cmake-developers@cmake.org>> wrote: