Re: [CMake] cpack and paths too long

2012-04-23 Thread Andrea Crotti
On 04/23/2012 01:32 PM, David Cole wrote: You should just get used to using shorter paths on the embarrassing OS. This is an early warning sign for you that your end users will also encounter these problems as they install your program on their systems in "non-short" root paths... You can ig

Re: [CMake] cpack and paths too long

2012-04-23 Thread Andrea Crotti
On 04/20/2012 12:36 PM, Eric Noulard wrote: Nope, it would break backward compatibility, you can dig the ML for discussion about that "issue". My opinion is that building in-source is a bad habit that ought to be discouraged but the fact is, this is not currently easy to enforce out-of-source: h

Re: [CMake] cpack and paths too long

2012-04-20 Thread Andrea Crotti
On 04/19/2012 07:00 PM, Eric Noulard wrote: Compiler, Visual Studio something? You run cpack from the command line or from within IDE/Makefile etc No compilers used for this project (it's python) and I run from command line. Anyway it might be a good idea also in general so I tried to d

Re: [CMake] cpack and paths too long

2012-04-19 Thread Andrea Crotti
On 04/19/2012 04:13 PM, Eric Noulard wrote: Could you build out-of-source in a small path? like small/path/build when your source would be in long/path/source cpack should only work with file in the build tree. this is a workaround but it may work. By the way: Which version of CMake/CPack

[CMake] cpack and paths too long

2012-04-19 Thread Andrea Crotti
We are trying to make cmake work with our projects, and all the targets work fine. The problem is that on some projects cpack -G NSIS fails because when it tries to copy files around it generates paths too long. I found that CMake is able to handle these situations in theory with a checksum

Re: [CMake] failing target

2012-03-06 Thread Andrea Crotti
On 03/06/2012 03:29 PM, David Cole wrote: On Tue, Mar 6, 2012 at 10:24 AM, Andrea Crotti The explanation is simple: if you have two targets and they run in *random* order, then it will be "correct" 50% of the time... Or perhaps 100% on one platform and 0% on another. That's

Re: [CMake] failing target

2012-03-06 Thread Andrea Crotti
On 03/06/2012 02:07 PM, Andrea Crotti wrote: I opened a thread some time ago about this, and I actually thought it was a bug in the documentation, because then why everything works otherwise? This simple example which I produced add_custom_target(a ${CMAKE_COMMAND} -E echo &q

Re: [CMake] failing target

2012-03-06 Thread Andrea Crotti
On 03/06/2012 02:01 PM, Michael Hertling wrote: Yes, the DEPENDS clause of ADD_CUSTOM_TARGET() is only for *file* dependencies, but you use it for *target* dependencies. According to the documentation of ADD_CUSTOM_TARGET(): "Dependencies listed with the DEPENDS argument may reference files and

Re: [CMake] failing target

2012-03-06 Thread Andrea Crotti
On 03/06/2012 01:45 PM, Michael Hertling wrote: Could you post the lines which define those targets psi.utility_install and install_all_eggs, or is this quite tricky, too? Do these lines stem from the same CMakeLists.txt? IIRC, the "no rule to make... needed by" error occurs when there's somethi

Re: [CMake] failing target

2012-03-06 Thread Andrea Crotti
On 03/06/2012 07:23 AM, Michael Hertling wrote: On 03/05/2012 05:59 PM, Andrea Crotti wrote: I'm having the following behaviour, and I can't quite understand the error message: .. Built target psi.utility_install .. make[3]: *** No rule to make target `psi.utility_install&#

[CMake] failing target

2012-03-05 Thread Andrea Crotti
I'm having the following behaviour, and I can't quite understand the error message: .. Built target psi.utility_install .. make[3]: *** No rule to make target `psi.utility_install', needed by `CMakeFiles/install_all_eggs'. Stop. make[2]: *** [CMakeFiles/install_all_eggs.dir/all] Error 2 make[

[CMake] NSIS template

2012-03-02 Thread Andrea Crotti
I'm working on the NSIS template and changing it to my needs, so unfortunately I also have to really understand some more NSIS.. One thing that I found from the doc is that the LogicLib.nsh makes life a lot simpler. All these strcmp would be simpler for example StrCmp $1 1 AddToPath_NT ;

Re: [CMake] cmake snippets

2012-02-29 Thread Andrea Crotti
On 02/29/2012 06:27 PM, Eric Noulard wrote: 2012/2/29 Andrea Crotti: If anyone is interested, I'm collecting cmake-mode yasnippet snippets for Emacs: https://github.com/AndreaCrotti/yasnippet-snippets/tree/master/cmake-mode Is anyone else using it and has some nice snippets to share? I&

Re: [CMake] smarter shortcuts with NSIS

2012-02-29 Thread Andrea Crotti
On 02/28/2012 05:53 PM, Eric Noulard wrote: 2012/2/28 Andrea Crotti: On 02/28/2012 03:42 PM, Eric Noulard wrote: Yes more or less beside the fact is CPack is doing more work than that: 1) CPack handles CPack-private install location for you (including the installation of the

[CMake] cmake snippets

2012-02-29 Thread Andrea Crotti
If anyone is interested, I'm collecting cmake-mode yasnippet snippets for Emacs: https://github.com/AndreaCrotti/yasnippet-snippets/tree/master/cmake-mode Is anyone else using it and has some nice snippets to share? -- Powered by www.kitware.com Visit other Kitware open-source projects at ht

Re: [CMake] smarter shortcuts with NSIS

2012-02-28 Thread Andrea Crotti
On 02/28/2012 03:42 PM, Eric Noulard wrote: At worst is there a way to just create my own .nsi file and use it directly? I need to create a page which simply asks for a directory to the user, and then use that to create a shortcut.. Any idea (also other solutions might be fine). 1) Copy the c

Re: [CMake] smarter shortcuts with NSIS

2012-02-28 Thread Andrea Crotti
Alright moving the include after did the trick, I get my code in the final nsi file, as below: set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " PageEx directory DirVar PythonDir PageExEnd CreateShortCut \\\"$DESKTOP${PROJECT_NAME}.lnk\\\" \\\"$INSTDIRbuilt_eggrun.exe\\\" \

Re: [CMake] smarter shortcuts with NSIS

2012-02-27 Thread Andrea Crotti
On 02/27/2012 05:51 PM, Eric Noulard wrote: 2012/2/27 John Drescher: Ah yes you're right, last time I checked I didn't see them.. Anyway my extra_commands don't appear anywhere in the nsi file, is that normal? No i'ts not. Did you set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS ...) BEFORE Actually I

Re: [CMake] smarter shortcuts with NSIS

2012-02-27 Thread Andrea Crotti
On 02/27/2012 04:52 PM, John Drescher wrote: By the way, how do I see the actual paths NSI configuration that generates the final exe? It seems that if NSIS works the file used get all removed.. It does not get removed for me using Visual Studio 2010. All of the NSIS stuff exists in a _CPack_Pa

Re: [CMake] smarter shortcuts with NSIS

2012-02-27 Thread Andrea Crotti
On 02/27/2012 03:34 PM, Andrea Crotti wrote: My brain is almost going to explode, so before it does maybe someone can help.. I have a cpack with NSIS working installer, which just copies a directory. In that directory there is a file run.exe, which needs to take an argument to run correctly

[CMake] smarter shortcuts with NSIS

2012-02-27 Thread Andrea Crotti
My brain is almost going to explode, so before it does maybe someone can help.. I have a cpack with NSIS working installer, which just copies a directory. In that directory there is a file run.exe, which needs to take an argument to run correctly. Now that argument is a path which is only known

Re: [CMake] mingw vs MSYS makefiles

2012-02-24 Thread Andrea Crotti
On 02/23/2012 10:55 PM, Bill Hoffman wrote: On 2/23/2012 6:20 AM, Andrea Crotti wrote: I don't think anyone really addressed your question. Your question seems to have taken on a whole new life The problem seems to be that your cmake file is creating makefiles that use a p

Re: [CMake] upper/lower case

2012-02-23 Thread Andrea Crotti
On 02/23/2012 04:52 PM, Michael Wild wrote: On 02/23/2012 04:08 PM, Andrea Crotti wrote: I really physically suffer using case-insensitive languages, Seriously? You must be an annoyingly happy person if that's your biggest problem in life! ;-) It's a quite minor problem, but I thin

Re: [CMake] simplest possible NSIS package

2012-02-23 Thread Andrea Crotti
On 02/23/2012 04:48 PM, John Drescher wrote: Just to make you laugh I found the source of the problem. Apparently if you try to run an installer from a directory which is on a shared directory (with the virtualbox sharing) it just won't run :D Copying it somewhere else works perfectly, quite ama

Re: [CMake] simplest possible NSIS package

2012-02-23 Thread Andrea Crotti
On 02/23/2012 03:56 PM, Andrea Crotti wrote: It appears it's really a problem of NSIS, even trying the a small example (directly with makensis) from the website produces an installer that doesn't work, I'll investigate in that direction then. Just to make you laugh I f

Re: [CMake] simplest possible NSIS package

2012-02-23 Thread Andrea Crotti
On 02/23/2012 02:32 PM, Andrea Crotti wrote: So I'm still struggling to get an actual installer. I copied almost the same example from the book: cmake_minimum_required(VERSION 2.6) project (Prova) add_executable(prova a.c) install( TARGETS prova RUNTIME DESTINATION bin ) include(

[CMake] upper/lower case

2012-02-23 Thread Andrea Crotti
I really physically suffer using case-insensitive languages, but is there any convention to decide at least when to use upper and when to use a lower case? For example user defined variables should be upper or lower case? Or what happens if I hide by mistake a CMake-defined variable? (are they

[CMake] intra-targets dependencies

2012-02-23 Thread Andrea Crotti
Reading the documentation in add_custom_target I see this: 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). But this actually works just fine add_custo

[CMake] descriptive make help

2012-02-23 Thread Andrea Crotti
Is there a way to get some more information from "make help"? I can already add a COMMENT to a custom target which will appear when I build that target, but it does not appear if I do make help.. Cheers, Andrea -- Powered by www.kitware.com Visit other Kitware open-source projects at http://

[CMake] simplest possible NSIS package

2012-02-23 Thread Andrea Crotti
So I'm still struggling to get an actual installer. I copied almost the same example from the book: cmake_minimum_required(VERSION 2.6) project (Prova) add_executable(prova a.c) install( TARGETS prova RUNTIME DESTINATION bin ) include(CPack) cmake does all its job, the package is created

[CMake] mingw vs MSYS makefiles

2012-02-23 Thread Andrea Crotti
I have MinGW installed in my system and today I added the bin directory to the path, so I was able to run all the commands also from a standard shell. But now CMake complains: CMake Error at c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeMinGWFindMake.cmake:20 (MESSAGE): sh.exe wa

Re: [CMake] delayed target

2012-02-23 Thread Andrea Crotti
On 02/23/2012 05:18 AM, Michael Hertling wrote: There is a possibility to dynamically reconfigure/rebuild the project without an intermediate manual step and in a way that you'll have one target per egg, but that approach is disadvantageous in other regards and possibly won't work with generator

Re: [CMake] passing arguments to the final make

2012-02-23 Thread Andrea Crotti
On 02/23/2012 06:20 AM, Michael Hertling wrote: The point is that ${SCRIPT} is substituted in the Makefile by (1) a macro specified on the command line (2) a macro specified in the Makefile (3) an environment variable in that order, or with (2) and (3) reversed if Make is invoked with the "-e"

Re: [CMake] delayed target

2012-02-22 Thread Andrea Crotti
On 02/22/2012 09:37 PM, Michael Hertling wrote: In order to define one target per egg, you'd need to know the eggs at configuration time since you cannot define targets at build time. So, gathering the eggs with a custom target/command will not work. As an alternative, you might gather the eggs

Re: [CMake] passing arguments to the final make

2012-02-22 Thread Andrea Crotti
On 02/22/2012 09:18 PM, Michael Hertling wrote: On 02/22/2012 06:56 PM, Andrea Crotti wrote: On 02/22/2012 05:32 PM, Andrea Crotti wrote: Ah that's nice thanks, I'm not sure though that I can rely on being>= 2.8 always, and that's probably a requirement, right? I tried what

[CMake] make a python script executable

2012-02-22 Thread Andrea Crotti
So now suppose I have a working installer (which is not the case yet), and that the entry point of the whole program is a python script. Is there a way to make the whole project launchable via double click on more platforms? At the moment there is a run.bat in every project for this to run on

Re: [CMake] delayed target

2012-02-22 Thread Andrea Crotti
On 02/22/2012 05:14 PM, Michael Hertling wrote: On 02/22/2012 05:02 PM, Andrea Crotti wrote: Again I'm having some troubles with the different building stages: I would like to have a target that simply unzips all the files contained in a directory, which can be found with a simple glo

Re: [CMake] passing arguments to the final make

2012-02-22 Thread Andrea Crotti
On 02/22/2012 05:32 PM, Andrea Crotti wrote: Ah that's nice thanks, I'm not sure though that I can rely on being >= 2.8 always, and that's probably a requirement, right? I tried what you suggested and with this: add_custom_target(dev_no_run COMMAND ${PYTHON_EXECUTAB

Re: [CMake] passing arguments to the final make

2012-02-22 Thread Andrea Crotti
On 02/22/2012 05:25 PM, Michael Hertling wrote: On 02/22/2012 04:43 PM, Andrea Crotti wrote: I would like to be able to pass arguments to my generated Makefile. Suppose I use an environment variable like this: add_custom_target(run_dev_script COMMAND ${PYTHON_EXECUTABLE} ${PREREQUISITE

[CMake] delayed target

2012-02-22 Thread Andrea Crotti
Again I'm having some troubles with the different building stages: I would like to have a target that simply unzips all the files contained in a directory, which can be found with a simple globbing. add_custom_target(unzip_all_eggs file(GLOB eggs RELATIVE ${EGG_BUILD_DIRECTORY}/*egg) CO

[CMake] passing arguments to the final make

2012-02-22 Thread Andrea Crotti
I would like to be able to pass arguments to my generated Makefile. Suppose I use an environment variable like this: add_custom_target(run_dev_script COMMAND ${PYTHON_EXECUTABLE} ${PREREQUISITE} COMMAND ${PYTHON_EXECUTABLE} ${SCRIPT} ) Would that actually work? In theory ${SCRIPT} is subs

[CMake] checking arguments

2012-02-22 Thread Andrea Crotti
I find not so nice that CMake doesn't complain at all if some variables are not defined. Is there a way to make it complain if a variable used is actually blank? In the meanwhile I ended up with this: set(COMPULSORY_ARGUMENTS PSI) set(OPTIONAL_ARGUMENTS WORKSPACE CONTAINER_PATHS) macro (check_

Re: [CMake] cpack issues

2012-02-22 Thread Andrea Crotti
Alright then I now actually get an installer which I can click on, and cpack doesn't give any more errors. However, when I try to run the executable I get a "executable..exe The specified path does not exist.." which is quite a weird error, because it's the same path that I'm clicking, and it

Re: [CMake] cpack issues

2012-02-21 Thread Andrea Crotti
On 02/21/2012 06:25 PM, Eric Noulard wrote: 2012/2/21 Andrea Crotti: I'm trying to finally create an installer for my project, with CPack and NSIS. The project is really really simple, I just need to copy over a directory somewhere. And I did something like: get_filename_component(userpr

[CMake] cpack issues

2012-02-21 Thread Andrea Crotti
I'm trying to finally create an installer for my project, with CPack and NSIS. The project is really really simple, I just need to copy over a directory somewhere. And I did something like: get_filename_component(userprofile $ENV{USERPROFILE} REALPATH) install( DIRECTORY ${EGG_BUILD_DIRECT

Re: [CMake] multi platform path

2012-02-21 Thread Andrea Crotti
On 02/21/2012 01:39 PM, Rolf Eike Beer wrote: get_filename_component() Eike -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_F

Re: [CMake] more targets to run in parallel

2012-02-21 Thread Andrea Crotti
Anyway just to answer myself, I managed to solve all my problems. Now I first generate at cmake file a file with some paths, and from these paths I generate all the targets that I need. I also create a list with all the targets to make it easy from other targets to depend on them. Here below t

[CMake] multi platform path

2012-02-21 Thread Andrea Crotti
I want to be able to have this simple translation between full path and filename. For example = /very/long/path/file.py -> file.py So I did this quite ugly function: function (get_filename FULLPATH) string(REPLACE "/" ";" p2list "${FULLPATH}") list(REVERSE p2list) list(GET p2list 0 la

Re: [CMake] more targets to run in parallel

2012-02-20 Thread Andrea Crotti
Going back to the original question, I realised that my approach could not work. In short the list of targets and commands that I need to generate depend on a file, which is generated from a python script. So I thought I could use execute_process before the foreach: execute_process( OUTPUT

Re: [CMake] more targets to run in parallel

2012-02-20 Thread Andrea Crotti
On 02/20/2012 03:50 PM, David Cole wrote: On Mon, Feb 20, 2012 at 10:42 AM, Eric Noulard <mailto:eric.noul...@gmail.com>> wrote: 2012/2/20 Andrea Crotti mailto:andrea.crott...@gmail.com>>: > On 02/20/2012 03:15 PM, David Cole wrote: > > > Use:

Re: [CMake] more targets to run in parallel

2012-02-20 Thread Andrea Crotti
On 02/20/2012 03:42 PM, Eric Noulard wrote: You may avoid to create a list in the first place: set(myoptions "one two three") instead of set(myoptions one two three) see cmake --help-command list or you can string(REPLACE ";" " " stringopts "${myoptions}") message(STATUS "${stringopts}") So

Re: [CMake] more targets to run in parallel

2012-02-20 Thread Andrea Crotti
On 02/20/2012 03:15 PM, David Cole wrote: Use: COMMAND ls -l Not: COMMAND "ls -l" Yes thanks, I started using the "" because I noticed that sometimes they are needed. So suppose I want to split the options and the command, this: set(myoptions one two three) set(mycmd ls -l) message

Re: [CMake] more targets to run in parallel

2012-02-20 Thread Andrea Crotti
On 02/20/2012 11:51 AM, Eric Noulard wrote: 2012/2/20 Andrea Crotti: On 02/17/2012 03:35 PM, Andrea Crotti wrote: .. I can make the question much simpler, is it possible to generate targets dynamically with CMake? As far as I know you can "generate" targets at CMake-time but not at

Re: [CMake] more targets to run in parallel

2012-02-20 Thread Andrea Crotti
On 02/17/2012 03:35 PM, Andrea Crotti wrote: .. I can make the question much simpler, is it possible to generate targets dynamically with CMake? I was trying the following (nonsense), a simple loop over a list that first generates a custom command and another loop that generates a target for

[CMake] more targets to run in parallel

2012-02-17 Thread Andrea Crotti
So suppose I have a list of Python eggs, in the form. - egg1 - egg2 - .. What I would like to do is to have be able to do. cmake . make build_eggs which would go over the list of the eggs and run in each of them python setup.py bdist_egg -d The list of eggs is actually computed at run-time,

Re: [CMake] CMake + NSIS on windows

2012-01-25 Thread Andrea Crotti
On 01/25/2012 02:48 PM, Andrea Crotti wrote: Now however CMake complains that it can't fin nmake, which from my search it's something it's this: http://superuser.com/questions/146577/where-do-i-find-nmake-for-windows-7 so cmake . generated by default the nmake files, but why c

Re: [CMake] CMake + NSIS on windows

2012-01-25 Thread Andrea Crotti
On 01/25/2012 02:49 PM, Bill Hoffman wrote: On 1/25/2012 9:28 AM, Andrea Crotti wrote: Since I still don't get CMake + NSIS running on Linux, I was trying to build my software on Windows... CMake and NSIS has never been ported to work on Linux, so no surprise there. Wait, this contra

Re: [CMake] CMake + NSIS on windows

2012-01-25 Thread Andrea Crotti
Now however CMake complains that it can't fin nmake, which from my search it's something it's this: http://superuser.com/questions/146577/where-do-i-find-nmake-for-windows-7 so cmake . generated by default the nmake files, but why cpack would need nmake for in the first place if I'm just using NS

Re: [CMake] CMake + NSIS on windows

2012-01-25 Thread Andrea Crotti
On 01/25/2012 02:28 PM, Andrea Crotti wrote: Since I still don't get CMake + NSIS running on Linux, I was trying to build my software on Windows... I installed CMake and NSIS and all my CMake actually does is to create an installer: cmake_minimum_required(VERSION 2.6) project(tr

[CMake] CMake + NSIS on windows

2012-01-25 Thread Andrea Crotti
Since I still don't get CMake + NSIS running on Linux, I was trying to build my software on Windows... I installed CMake and NSIS and all my CMake actually does is to create an installer: cmake_minimum_required(VERSION 2.6) project(try_out) install( # is this automatically the source dir??

Re: [CMake] cpack -G NSIS

2012-01-23 Thread Andrea Crotti
It's a bit tricky to follow the code, but from my first attempt with the debug symbols activated I get the following backtrace: (running cpack -G NSIS) --8<---cut here---start->8--- (gdb) bt #0 0x76e28935 in raise () from /lib/libc.so.6 #1 0x7

Re: [CMake] cpack -G NSIS

2012-01-22 Thread Andrea Crotti
So yes this was with your try-out example, actually I can try to dig a little bit myself, the problem is that with gdb I need to have the debug symbols, thus recompiling in debug mode. But nowhere in the Readme or around the code I found a way to do it (it would be very nice to add maybe some

Re: [CMake] cpack -G NSIS

2012-01-22 Thread Andrea Crotti
On 01/19/2012 07:52 PM, Eric Noulard wrote: Installing empty dir may fail. Try the attached zip and tell me if it fails for you. It works for me on Debian Wheezy 64. They were not empty dirs, and trying from another machine (arch 64 bits), with NSIS 2.46-3, and cmake 2.8.7-2 and kernel now 3.

[CMake] show cpack variables

2012-01-18 Thread Andrea Crotti
cmake --help-variable-list shows me all the global variables defined, but how do I see for example all the possible variables that are defined only when I include cpack? And how do I get the documentation for a function like cpack_add_component for example? Thanks, Andrea -- Powered by www.

Re: [CMake] cpack -G NSIS

2012-01-18 Thread Andrea Crotti
Thanks for the feedback, however I tried again with another cmake file, which should actually do something. What I would like to do is to: - get the project name and a list of packages (just directories) to install - install them somewhere (now the destination is not set correctly). Should this

Re: [CMake] cpack -G NSIS

2012-01-11 Thread Andrea Crotti
On 01/11/2012 12:37 PM, Eric Noulard wrote: 2012/1/11 Andrea Crotti: Andrea, Could you please not drop the ML address? I know the reply-to-sender mode of the list may be annoying but it is the current setup so tha tyou need to re-add ML address when answering. Sorry my mistake, actually I

[CMake] cpack -G NSIS

2012-01-10 Thread Andrea Crotti
Trying to run cpack on Linux (archlinux 64 bit) with a working makensis environment, I get the following error (and following stacktrace): [andrea@precision test_cmake]$ gdb cpack GNU gdb (GDB) 7.3.1 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later

Re: [CMake] bash-script-like project

2011-10-30 Thread Andrea Crotti
I rephrase a bit the question which was probably too long :) So suppose that I just need to do the following things (but in a portable way with CMake). cd org-mode && make cd tramp && autoreconf -fi && ./configure && make cd doxymacs && autoreconf -fi && ./configure && make ... where some of t

[CMake] bash-script-like project

2011-10-28 Thread Andrea Crotti
I'm experiment a bit with CMake and now I would like to automate the configuration of my Emacs configuration. In my configuration I have many git submodules and some of them need to be actually compiled. So I just need to do a foreach loop and run for each of them the right command, very sim

Re: [CMake] getting all the function names

2011-10-20 Thread Andrea Crotti
Thanks a lot the completion works quite nicely... Anyway something brutal like this below already would work if someone is using auto-complete. The problem is that variables and functions depend on the version, in theory is possible to get the list of completions with a shell script but - it migh

[CMake] getting all the function names

2011-10-20 Thread Andrea Crotti
I'm starting to use cmake and I will have to rely on it pretty much in the future. I'm a bit overwhelmed by the quantity of variables / functions, is there a way to get an automatic list of all of them? It would be nice to improve the cmake-mode.el (for emacs) to recognise as much as possibl