diff --git a/avogadro/lastinstall/CMakeLists.txt b/avogadro/lastinstall/CMakeLists.txt index 2bf87a6b..527f26e2 100644 --- a/avogadro/lastinstall/CMakeLists.txt +++ b/avogadro/lastinstall/CMakeLists.txt @@ -35,14 +35,10 @@ if((APPLE OR WIN32) AND NOT ${CMAKE_VERSION} VERSION_LESS 2.8.8) # grab OpenSSL for Windows if(WIN32) - if(EXISTS "${Qt5_Dir}/../../Tools/OpenSSLv3/Win_x64/") - set(OPENSSL_ROOT_DIR "${Qt5_Dir}/../../Tools/OpenSSLv3/Win_x64/") + find_package(OpenSSL REQUIRED) + if (DEFINED OPENSSL_FOUND) + set(OPENSSL_ROOT_DIR "${OPENSSL_INCLUDE_DIR}/.." CACHE PATH "OpenSSL root directory") message(STATUS "Using OpenSSL from ${OPENSSL_ROOT_DIR}") - elseif(DEFINED $ENV{OPENSSL_ROOT_DIR}) - set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT_DIR}) - message(STATUS "Using OpenSSL from ${OPENSSL_ROOT_DIR}") - endif() - if (DEFINED OPENSSL_ROOT_DIR) file(GLOB OPENSSL_DLL ${OPENSSL_ROOT_DIR}/bin/*.dll) install(FILES ${OPENSSL_DLL} DESTINATION ${INSTALL_RUNTIME_DIR}) endif() diff --git a/cmake/AvogadroCPack.cmake b/cmake/AvogadroCPack.cmake index 6827385d..3b84d087 100644 --- a/cmake/AvogadroCPack.cmake +++ b/cmake/AvogadroCPack.cmake @@ -53,16 +53,9 @@ if(INSTALL_BUNDLE_FILES) # grab OpenSSL for Windows if(WIN32) - if(EXISTS "${Qt5_Dir}/../../Tools/OpenSSLv3/Win_x64/") - set(OPENSSL_ROOT_DIR "${Qt5_Dir}/../../Tools/OpenSSLv3/Win_x64/") - elseif(DEFINED $ENV{OPENSSL_ROOT_DIR}) - set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT_DIR}) - elseif(EXISTS "D:/a/avogadroapp/Qt/Tools/OpenSSLv3/Win_x64/") - set(OPENSSL_ROOT_DIR "D:/a/avogadroapp/Qt/Tools/OpenSSLv3/Win_x64") - elseif(EXISTS "D:/a/avogadrolibs/Qt/Tools/OpenSSLv3/Win_x64/") - set(OPENSSL_ROOT_DIR "D:/a/avogadrolibs/Qt/Tools/OpenSSLv3/Win_x64") - endif() - if (DEFINED OPENSSL_ROOT_DIR) + find_package(OpenSSL REQUIRED) + if (DEFINED OPENSSL_FOUND) + set(OPENSSL_ROOT_DIR "${OPENSSL_INCLUDE_DIR}/.." CACHE PATH "OpenSSL root directory") message(STATUS "Using OpenSSL from ${OPENSSL_ROOT_DIR}") file(GLOB OPENSSL_DLL ${OPENSSL_ROOT_DIR}/bin/*.dll) install(FILES ${OPENSSL_DLL} DESTINATION ${INSTALL_RUNTIME_DIR})