srt icon indicating copy to clipboard operation
srt copied to clipboard

Clean up and fix build rules for providing user overrides for libraries

Open ethouris opened this issue 5 years ago • 2 comments

The expected rules preserved for the build system is that:

  1. The configure-data.tcl file contains the list of options that represent variables used in CMakeLists.txt, and this list is allowed to be incomplete. It should not, however, contain options other than handled internally by this script and those that map to variables in CMakeLists.txt.

  2. The details of the build from cmake is expected to be fully user-configurable, which embraces mainly the encryption library dependency. This should expose the variables used normally by cmake, such as OPENSSL_LIBRARIES and OPENSSL_INCLUDE_DIR. This should be also dependent on the encryption library being used, as specified in --use-enclib option.

For example, this should be possible to do:

./configure --use-enclib=mbedtls --ssl-libraries="mbedtls mbedcrypto" --ssl-library-dirs=/opt/mbedtls/lib64 --ssl-include-dirs=/opt/mbedtls/include 

Currently finding the library is mostly automated and manual definition of the required library seems not to be handled. Also configure-data.tcl contains options that do not map to any variables in CMakeLists.txt.

It would be also desired if there's found some way to have a common list of options mapped to variables in CMakeLists.txt, out of which both the list for configure-data.tcl and for CMakeLists.txt will be generated.

ethouris avatar Aug 08 '19 15:08 ethouris

But why still needs configure since cmake already present? Is there anything that cmake currently can not provide?

wangyoucao577 avatar Jun 11 '22 02:06 wangyoucao577

The reasoning of this script has changed in time (look at the date of this issue), it was earlier containing more autodetection things and several specific tricks. Today it's rather to remain something familiar for people accustomed with autotools-style scripts. It also allows to provide some options specifically for developers or unusual targets - like --with-compiler-prefix.

ethouris avatar Jun 11 '22 20:06 ethouris