cmake: misc tidy-ups

- replace `add_compile_options()`,  `add_definitions()` with directory
  properties. To harmonize this across all scripts. The new commands are
  verbose, but describe better how they work. The syntax is also closer
  to setting target properties, helps grepping.

- prefer `CMAKE_INSTALL_PREFIX` over `--prefix` (in tests, CI).

- tidy up cmake invocations.

- formatting.

Closes #16238
This commit is contained in:
Viktor Szakats 2025-02-07 13:44:39 +01:00
parent ca2f49ded0
commit 45f7cb7695
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
8 changed files with 15 additions and 14 deletions

View file

@ -56,7 +56,7 @@ if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
[ "${PRJ_CFG}" = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
[[ "${PRJ_GEN}" = *'Visual Studio'* ]] && options+=' -DCMAKE_VS_GLOBALS=TrackFileAccess=false'
# shellcheck disable=SC2086
cmake -B "_bld${_chkprefill}" "-G${PRJ_GEN}" ${TARGET} \
cmake -B "_bld${_chkprefill}" -G "${PRJ_GEN}" ${TARGET} \
-DCURL_USE_OPENSSL="${OPENSSL}" \
-DCURL_USE_SCHANNEL="${SCHANNEL}" \
-DHTTP_ONLY="${HTTP_ONLY}" \