cmake error if no openssl

Issue #225 resolved
dd1 created an issue

if openssl is not installed (default on docker images), cmake explodes with an error. expected: build midas mhttpd without https support.

Configuring incomplete, errors occurred!
See also "/opt/atlassian/pipelines/agent/build/build/CMakeFiles/CMakeOutput.log".
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
/opt/atlassian/pipelines/agent/build/progs/OPENSSL_INCLUDE_DIR
   used as include directory in directory /opt/atlassian/pipelines/agent/build/progs
OPENSSL_CRYPTO_LIBRARY (ADVANCED)
    linked by target "mhttpd6" in directory /opt/atlassian/pipelines/agent/build/progs
OPENSSL_SSL_LIBRARY (ADVANCED)
    linked by target "mhttpd6" in directory /opt/atlassian/pipelines/agent/build/progs

Comments (4)

  1. Stefan Ritt

    I changed that and link now only against OPENSSL libraries if OpenSLL has been found (see line #4):

    # mongoose flags
    target_compile_options(mhttpd6 PRIVATE -DHAVE_MONGOOSE6 -DMG_ENABLE_THREADS -DMG_DISABLE_CGI -DMG_ENABLE_EXTRA_ERRORS_DESC)
    if (OPENSSL_FOUND)
       target_compile_options(mhttpd6 PRIVATE -DMG_ENABLE_SSL)
       target_link_libraries(mhttpd6 ${OPENSSL_LIBRARIES})
    endif(OPENSSL_FOUND)
    
    target_link_libraries(mhttpd6 midas ${LIBS} ${DB_LIBS})
    

    Hope that helps.

  2. dd1 reporter

    branch feature/mbedtls removes openssl from default build. autodetected openssl is replaced by built-if-asked-for mbedtls. K.O.

  3. dd1 reporter

    feature/mbedtls merged. openssl is no longer part of the default midas build, https support default is “off” in mhttpd. K.O.

  4. Log in to comment