Re: [cmake-developers] Specifying sources without file extensions
On Thu, Dec 08, 2016 at 08:01:03 -0500, Brad King wrote: > On 12/08/2016 01:41 AM, Craig Scott wrote: > > file names without extensions is a feature which is simply missing > > documentation or is it an undocumented feature that projects are not > > supposed to use? Since there are error messages like the above, it > > would seem that the latter would be a harder position to justify. > > It is an ancient legacy behavior from CMake's earliest days when it > was only used for C++ projects with lists of "classes" where each > was expected to have a source and header file. The behavior should > be removed with a new policy, but no one has actually done that yet. See https://gitlab.kitware.com/cmake/cmake/issues/15208 for the actual issue for adding the policy. --Ben -- 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-developers
Re: [cmake-developers] Specifying sources without file extensions
On 12/08/2016 01:41 AM, Craig Scott wrote: > file names without extensions is a feature which is simply missing > documentation or is it an undocumented feature that projects are not > supposed to use? Since there are error messages like the above, it > would seem that the latter would be a harder position to justify. It is an ancient legacy behavior from CMake's earliest days when it was only used for C++ projects with lists of "classes" where each was expected to have a source and header file. The behavior should be removed with a new policy, but no one has actually done that yet. -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-developers
[cmake-developers] Specifying sources without file extensions
I've come across some projects where the source files listed in their add_executable() and add_library() commands do not have file extensions. It seems that CMake still finds the sources by trying some set of file suffixes. This is not documented behaviour, but it does show up in error messages if you give those commands a file name for a non-existent source. For example, if I specify a full filename which doesn't exist, I see an error message similar to the following: CMake Error at /somepath/CMakeLists.txt:10 (add_library): Cannot find source file: ../somethingThatDoesNotExist.h Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx So my question is whether specifying source file names without extensions is a feature which is simply missing documentation or is it an undocumented feature that projects are not supposed to use? Since there are error messages like the above, it would seem that the latter would be a harder position to justify. -- Craig Scott Melbourne, Australia https://crascit.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-developers