cellml / libcellml

Repository for libCellML development.
https://libcellml.org
Apache License 2.0
16 stars 21 forks source link

CMake: support CMAKE_BUILD_TYPE #972

Closed agarny closed 2 years ago

agarny commented 2 years ago

CMake comes with some options (CMAKE_BUILD_TYPE and CMAKE_INSTALL_PREFIX) for which we have our own version (BUILD_TYPE and INSTALL_PREFIX). INSTALL_PREFIX knows about CMAKE_INSTALL_PREFIX, but BUILD_TYPE doesn't. This means that if I pass -DCMAKE_BUILD_TYPE=XXX to CMake then libCellML will completely ignore it and will always build a debug version of libCellML.

hsorby commented 2 years ago

I don't agree that INSTALL_PREFIX knows about CMAKE_INSTALL_PREFIX. Can you demonstrate how this is the case? The configuration of libCellML is setup to ignore CMAKE_BUILD_TYPE because it does not exhibit consistent behaviour. This is why it has been internalised and only manipulated through LIBCELLML_INSTALL_PREFIX or the command line shortened form INSTALL_PREFIX.

agarny commented 2 years ago

Sorry, it's not INSTALL_PREFIX that knows about CMAKE_INSTALL_PREFIX, but LIBCELLML_INSTALL_PREFIX. So, by extension, it would be nice if LIBCELLML_BUILD_TYPE was to known about CMAKE_BUILD_TYPE.