Re: [CMake] execute short program during cmake configuration ?

2016-06-03 Thread Petr Kmoch
Hi Miro,

looks like you want to use the try_run() command (
https://cmake.org/cmake/help/latest/command/try_run.html ).

Petr

On 2 June 2016 at 22:10, Ilias Miroslav  wrote:

>
> Greetings, dear experts,
>
>
> we have (two) short Fortran programs (detection of integer*4/8 for math
> libraries) which we would like to build and execute during project's
> configuration phase.
>
>
> There is the " CheckFortranSourceCompiles" command to compile a Fortran
> source code during project's  configure time.  However, we would be glad
> also to execute the resulting a.out binary and check if it passes or
> crashes.
>
>
> Any help, please ? Is there a way to compile/execute short program in the
> configuration  stage of the (big) project ?
>
>
> Yours, Miro
>
> ( CMake co-builder for http://www.diracprogram.org  )
>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] execute short program during cmake configuration ?

2016-06-02 Thread Guy Harris
On Jun 2, 2016, at 2:56 PM, Alan W. Irwin  wrote:

> It appears you want the Fortran equivalent of the CHECK_C_SOURCE_RUNS
> macro. So I suggest you copy that macro (found in
> Modules/CheckCSourceRuns.cmake) to your own source code where your
> other home-grown CMake macros are located, rename that macro to
> CHECK_FORTRAN_SOURCE_RUNS, and make the minor modifications to that
> macro that are appropriate for the Fortran case.

...and contribute it back to the CMake maintainers to encourage its appearance 
in future releases?
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake