-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake cleanup #133
Comments
Hi, I usually do something like
to wrap find that does not create directly targets point 8. In BZ_Config.h.in file
and in the cmake file the value are defined:
and the file is generated by cmake though the configure command
Point12. Modern cmake now consider only version greater than 3.5. if you want to find package through Pkgconfig it is also possible to support cmake starting from 2.8. previous version should be consider obsolete. |
I will put comment incrementally one by one... |
|
3 & 4: There are advantages and drawbacks in doing that. I usually prefer to have options and find where they are used because its more modular... If you remove/change the directory (or directory content), you directly also remove/see-what-to-change and do not have to remember visit various different files... and I like this principle of locality. I agree that finding options easily would be nice and currently requires a grep or launching cmake gui. Overall, I'd prefer to have options (and actually options we want user to use as there might be options for developpers) directly in the README.md Find find_() stuff, the same locality argument works... But I tend to "uplevel" find_ that are common to several subdirs to show that this is some common stuff (I'm not even sure this is the right thing to do as I do not believe there is a significant coherence or efficiency advantage, but at least it factorizes the find_*** code). |
|
|
7 & 9 & 10. A big yes... But I think that the goal was not only for CMake but for autotools too (making your comment stating that people using the old compiler should be using the autotools build). Globally, I think it is better to keep the same overall scheme between autotools and cmake. We do not want to have too many differences. In this view (removing old compiler support for both autotools and cmake): |
|
But again, my preferred goal is to suppress it (and from autotools too). |
@papadop, @citibeth - please comment on which of the things mentioned below are still TODO:
Remove anything having to do with Pkgconfig. That is Autotools-related stuff, and it only works if everyone uses it --- which everyone never did.
Building the
doc/
directory should be optional. Doc building requires a lot of extra build dependencies, and people should be able to build without first installing all that stuff. Most people will just use pre-built docs online. (This is true for almost any package that comes with docs).Put all options in the top-level CMakeLists.txt file. That way it's easy to see what options this build has. (eg: FORTRAN_BENCHMARKS in in benchmarks/CMakeLists.txt)
Similarly, put all find_***() stuff in the top-level, so we can easily see what the dependencies are.
Remove commented-out Autotools code.
Remove
bin/CMakeLists.txt
, and the line that includes it.The original Autotools build checked a zillion C++ features and configured accordingly. I would like to consider whether some of those checks are no longer required, for (reasonably) modern compilers. It is now 15+ years since Blitz++ originally was released, and plenty has changed. I don't care to support ancient compilers going forward; and people who DO use those compilers can always use the existing Autotools build. If we can remove checks, then that is super. (Later, we can remove the corresponding #ifdefs) For example... we can probably get rid of BZ_HAVE_STRINGS_H and BZ_HAVE_STRING_H. And a lot more...
Can we have a way to put the Blitz version number into the config.h file, coming from the top-level CMakeLists.txt file?
Is it possible to remove compiler-specific configuration (
BlitzconfigFileName.cmake
)? Configurations for specific compilers or OS's have fallen out of favor; instead, feature-based configuration options (like those discussed above) are preferred. In any case, can we remove support for compilers that no longer exist?CheckCXXFeature
: Again, let's get rid of checks for things that are now standardized. For example, HAVE_EXCEPTIONS, HAVE_NAMESPACES, HAVE_RTTI, HAVE_MEMBER_CONSTANTS, HAVE_OLD_FOR_SCOPING, HAVE_EXPLICIT, HAVE_BOOL,... Most of these (90%?) we can get rid of because they are now standard in C++. I would say, we should require C++11 (even though the current Blitz API is not C++11 compliant; I'm still not interested in having this CMake build work on any pre-C++11 compilers).Let's try to put things in the file in which they are used. For example,
CHECK_ALL_CXX_FEATURES
is only used once, and that's inblitz/CMakeLists.txt
. The macro should therefore be defined in that file, rather than incmake/CheckCXXFeature.cmake
. In general, any macro that's used in only one file should be inlined into that file.cmake/Win32Compat.cmake
: I'm happy not supporting CMake 2.6 any more. I'd be fine with requiring at least CMake 3.0. So we can get rid of extra code in the build required to support old CMake versions.cmake/XXXConfig.cmake.in
: Is there any way to avoid the situation in which the CMake build auto-generates part of itself? If we are to keep this kind of complexity, I would want a good reason.Remove commented-out Autotools code from
manual/CMakeLists/txt
.Originally posted by @citibeth in #97 (comment)
The text was updated successfully, but these errors were encountered: