Re: [CMake] CCACHE_DIR Environment Variable

2017-02-01 Thread Craig Scott
For those following along, David's problem was related to the blog article not routing the ccache calls through the launch scripts for Ninja and Makefiles and instead invoking ccache directly. The Xcode arrangement was the only thing using the launch scripts. While this was okay, it wasn't

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] CCACHE_DIR Environment Variable

2017-01-31 Thread Craig Scott
On Wed, Feb 1, 2017 at 8:57 AM, David Lind wrote: > The example shown on https://crascit.com/2016/ > 04/09/using-ccache-with-cmake/ is for Xcode. Hence setting the > CMAKE_XCODE_ATTRIBUTE… variables. On Linux, what are these variables? Are > they CMAKE_ATTRIBUTE… without

Re: [CMake] CCACHE_DIR Environment Variable

2017-01-31 Thread David Lind
The example shown on https://crascit.com/2016/04/09/using-ccache-with-cmake/ is for Xcode. Hence setting the CMAKE_XCODE_ATTRIBUTE… variables. On Linux, what are these variables? Are they CMAKE_ATTRIBUTE… without XCODE? > On Jan 19,

Re: [CMake] CCACHE_DIR Environment Variable

2017-01-19 Thread Craig Scott
Ah, sorry, I misunderstood what CCACHE_DIR was for. Nevertheless, the method in that linked article could be easily modified to do what you want. Simply add the setting of the environment variable to the launch scripts. Since those launch scripts are copied across to the build dir at configure

Re: [CMake] CCACHE_DIR Environment Variable

2017-01-19 Thread Dave Flogeras
On Thu, Jan 19, 2017 at 4:44 PM, David Lind wrote: > That’s not the issue. The issue is telling ccache where to place it’s > cache files. If I compiles for toolchain X, Y and X, I need to set > CCACHE_DIR accordingly. Otherwise the cache will be useless. > >

Re: [CMake] CCACHE_DIR Environment Variable

2017-01-19 Thread David Lind
Scott, I have find_program implemented to find ccache, as shown below. find_program(CCACHE ccache) if(CCACHE) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE}) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE}) endif() That’s not the issue. The issue

Re: [CMake] CCACHE_DIR Environment Variable

2017-01-19 Thread Craig Scott
Rather than relying on environment variables, you can use CMake's find_program() command to find ccache on your path and then tell CMake to use that as a launcher. You can find an article with a detailed explanation of how to set this up here:

[CMake] CCACHE_DIR Environment Variable

2017-01-19 Thread David Lind
I am porting existing makefiles to cmake. One of the key features of these makefiles is setting the CCACHE_DIR environment variable based upon the tool chain selected. I have TC_.cmake files created. Ideally, I would add a line to these files to set the CCACHE_DIR. But, CMake doesn’t have the