[CMake] Discuss Adding return values/dynamic function invokation to cmake
Hi All, I've been thinking aboutallowing return values/ function evaluation in the cmake script language. Especially if there are any downsides e.g. compatibility issues/language inconsistency. What I mean is the following syntax: ``` function(func1) return(1) endfunction() function(add lhs rhs) math(EXPR res "${lhs} + ${rhs}") return(${res}) endfunction() set(result ${func1()}) # checks to see if function is defined and if so invokes it idicated by parenthesis assert(${result} EQUAL 1) set(result ${add(${func1()} 2}) # inner function is evaluated first and result is pasted in outer function assert(${result} EQUAL 3) message(INFO "${add(1 3)}") # --> prints 4 set(function_name add) message(INFO "${function_name}(3 5)}") # --> prints 8 ``` This could replace generator expressions with a cleaner and more general alternative and also it would allow cmake to become much easier to use. I'd also like to know if someone could point me to where in the cmake codebase the "${}" evaluation expression is actually processed. If you have any critique of this idea then I would also be happy - else I'll try to fork cmake and implement this. Cheers! Tobias -- 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
[CMake] my.cdash.org problems
I want to show all the tests run in the past year. For this I use the URL Safe Numerics Dashboard <http://my.cdash.org/index.php?project=Safe+Numerics&filtercount=1&showfilters=1&field1=buildstarttime/date&compare1=83&value1=1%20year%20ago> So far so good. But I have a number of problems: a) when I run the experimental target on my Cmake setup, I get an error message: Uploaded: /Users/robertramey/WorkingProjects/safe_numerics_gcc-4.8.1/Testing/20150111-1903/Test.xml Errors occurred during submission. Errors while running CTest make[3]: *** [CMakeFiles/Experimental] Error 8 make[2]: *** [CMakeFiles/Experimental.dir/all] Error 2 make[1]: *** [CMakeFiles/Experimental.dir/rule] Error 2 make: *** [Experimental] Error 2 my CTestConfig.cmake is: set(CTEST_PROJECT_NAME "Safe Numerics") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "my.cdash.org") # set(CTEST_DROP_LOCATION "/cdash/submit.php?project=MyProject") set(CTEST_DROP_LOCATION "/index.php?project=Safe+Numerics") set(CTEST_DROP_SITE_CDASH TRUE) What do I have to do make this work and add another line to my test dashboard? b)when I log in to http://my.cdash.org I get a screen with a simple message No update data as of Sunday, January 11 2015 - 00:00 EST 211 days ago: 13 tests not run on Darwin-clang++ 211 days ago: 10 warnings introduced on Darwin-clang++ which OK. BUT I don't see how to get the display I get to above which shows all the test results for the past year. How do I get there? Robert Ramey -- View this message in context: http://cmake.3232098.n2.nabble.com/my-cdash-org-problems-tp7589444.html Sent from the CMake mailing list archive at Nabble.com. -- 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] cmake FortranCInterface test fails in a linking step due to the -rdynamic option in Linux-GNU.cmake
On 1/8/2015 1:30 PM, Brad King wrote: > The Linux-GNU module's behavior should not be getting invoked > for XL Fortran because the Fortran compiler id is "XL", not "GNU". > > I'd like to understand how the option makes it to the link line: To follow up on-list, it turns out that CMakeFortranInformation.cmake was initializing the CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS value from the C version since no platform modules set it explicitly for XL Fortran. The fix is: XL: Fix link flags for executables on Linux with XL compilers http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4729547a -Brad -- 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
[CMake] Matlab producing image files for use with LaTeX
I am familiar with UseLATEX, but would like to take the automation of my document build system a step or two further. Solutions that build on UseLATEX -- or a totally separate approach, are OK. I often use Matlab to create *.pdf figures -- which are then used in a LaTeX document. I would like my build setup to notice when a Matlab *.m file has changed - and then re-run it to re-generate the dependent *.pdf - and then LaTeX for the final document. If that works, I would like to take things a step further and specify that the *.m files may depend on some external data files of arbitrary formats. The whole system should notice and update when those data files are updated. Bonus points for a system that detects as much of the dependencies automagically (like #include ing header files). Any suggestions? Rob -- 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
[CMake] Tweak CMake project to include non-buildable files in the CodeBlocks project file
Hi, I'm using QtCreator with CMake and have several files that are included in targets depending on the platform on which I build. Files that are not enabled on the current platform will not be included by CMake in the CodeBlocks file which in turn is used by QtCreator. Since QtCreator only picks up files listed in the CodeBlocks project file for its project view I cannot easily open certain files using QtCreator. I'm wondering wether CMake has a mechanism that would make these files show up in the CodeBlocks project file without them being actually compiled by the project build (I'm using Ninja for that part)? I was thinking of something similar to what can be used to create groups etc. for VS projects. Andreas -- 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] Tweak CMake project to include non-buildable files in the CodeBlocks project file
It is very simple for each of the files you want to include in the build (I use txt example so that you know it can work for arbitrary types): --- set_source_files_properties( comment.txt PROPERTIES HEADER_FILE_ONLY true) --- then you can include that file in the build to let it shows up in the IDE file --- #example when adding a static library (works the same also for executables) add_library( ${arg1} STATIC ${sourcefiles} #files you need to REALLY BUILD comment.txt#this file would be added, but not builded ) --- 2015-01-11 22:27 GMT+01:00 Andreas Pakulat : > Hi, > > I'm using QtCreator with CMake and have several files that are included in > targets depending on the platform on which I build. > > Files that are not enabled on the current platform will not be included by > CMake in the CodeBlocks file which in turn is used by QtCreator. > > Since QtCreator only picks up files listed in the CodeBlocks project file > for its project view I cannot easily open certain files using QtCreator. > > I'm wondering wether CMake has a mechanism that would make these files > show up in the CodeBlocks project file without them being actually compiled > by the project build (I'm using Ninja for that part)? I was thinking of > something similar to what can be used to create groups etc. for VS projects. > > Andreas > > -- > > 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