[CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hello, I've been using several install (CODE EXECUTE_PROCESS ...) constructs in my top-level CMakeLists.txt file. However, I've been unable to capture/operate on any exit status of the embedded command. Unfortunately, documentation/searches haven't turned up any useful pointers. The closest

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread Kornel Benko
Am Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck dav...@netacquire.com Hello, I've been using several install (CODE EXECUTE_PROCESS ...) constructs in my top-level CMakeLists.txt file. However, I've been unable to capture/operate on any exit status of the embedded command.

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hi Kornel, On Wednesday, November 13, 2013 10:26 AM, cmake-boun...@cmake.org wrote: Am Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck dav...@netacquire.com Hello, I've been using several install (CODE EXECUTE_PROCESS ...) constructs in my top-level CMakeLists.txt file.

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread Jean-Christophe Fillion-Robin
Hi David, You could look at the generated file named cmake_install.cmake to have a better idea of what could be wrong ... As a side note, there is also an issue with command like install(CODE|SCRIPT ... there are always executed first in a given directory. See [1] (Note that I couldn't find a

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread Kornel Benko
Am Mittwoch, 13. November 2013 um 18:41:03, schrieb David Hauck dav...@netacquire.com Hi Kornel, On Wednesday, November 13, 2013 10:26 AM, cmake-boun...@cmake.org wrote: Am Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck dav...@netacquire.com Hello, I've been using

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hi Jean-christophe, On chris.filli...@kitware.com], Jean-Christophe Fillion-Robin wrote: Hi David, You could look at the generated file named cmake_install.cmake to have a better idea of what could be wrong ... Well, this just has the following: IF(NOT CMAKE_INSTALL_COMPONENT OR

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hi Kornel, On Wednesday, November 13, 2013 11:08 AM, cmake-boun...@cmake.org wrote: Am Mittwoch, 13. November 2013 um 18:41:03, schrieb David Hauck dav...@netacquire.com Hi Kornel, On Wednesday, November 13, 2013 10:26 AM, cmake- boun...@cmake.org wrote: Am Mittwoch, 13. November 2013 um

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread Jean-Christophe Fillion-Robin
Hi David, You need to escape the $ sign otherwise the _err, _out and _res variables are resolved to an empty string. Here is an example of what you could do: -8---8-- cmake_minimum_required(VERSION 2.8.9) install(CODE execute_process ( COMMAND ${CMAKE_COMMAND}

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hi Jean-christophe, On chris.filli...@kitware.com], Jean-Christophe Fillion-Robin wrote: Hi David, You need to escape the $ sign otherwise the _err, _out and _res variables are resolved to an empty string. Here is an example of what you could do: -8---8--

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
On Wednesday, November 13, 2013 11:42 AM, David Hauck wrote: Hi Jean-christophe, On chris.filli...@kitware.com], Jean-Christophe Fillion-Robin wrote: Hi David, You need to escape the $ sign otherwise the _err, _out and _res variables are resolved to an empty string. Here is an example

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread Jean-Christophe Fillion-Robin
Hi, You also need to add the if statement into the CODE parameter, for example something like this ... install(CODE If (NOT \${_res} EQUAL 0) message( FATAL_ERROR \out: \${_out}, err: \${_err}, res: \${_res}\) endif() ) To keep things simpler, you could also look at INSTALL(SCRIPT ...) it

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hi Jean-christophe, On chris.filli...@kitware.com], Jean-Christophe Fillion-Robin wrote: Hi, You also need to add the if statement into the CODE parameter, for example something like this ... install(CODE If (NOT \${_res} EQUAL 0) message( FATAL_ERROR \out: \${_out}, err: \${_err},