diff --git a/CMakeLists.txt b/CMakeLists.txt index 1077a33..296e4b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,9 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_AUTOUIC_SEARCH_PATHS src/ui) set(CMAKE_AUTOUIC ON) -set(LIBFOXOGRAM_INSTALL OFF) -set(IXWEBSOCKET_INSTALL OFF) +if(APPLE) + set(OpenSSL_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/foxogram.app/Contents/Frameworks/") +endif () if(NOT DEFINED CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) @@ -81,22 +82,8 @@ install(TARGETS foxogram ) install(SCRIPT ${deploy_script}) -if (WIN32) - find_package(OpenSSL COMPONENTS SSL Crypto REQUIRED) - if(OPENSSL_VERSION VERSION_GREATER_EQUAL "3.0.0") - set(openssldlls "${OPENSSL_INCLUDE_DIR}/../libssl-3-x64.dll;${OPENSSL_INCLUDE_DIR}/../libcrypto-3-x64.dll") - else () - set(openssldlls "${OPENSSL_INCLUDE_DIR}/../libssl-1_1-x64.dll;${OPENSSL_INCLUDE_DIR}/../libcrypto-1_1-x64.dll") - endif () - install(FILES ${openssldlls} - DESTINATION ${CMAKE_INSTALL_BINDIR}) -elseif (UNIX) - install(FILES ${OPENSSL_LIBRARIES} - DESTINATION ${CMAKE_INSTALL_BINDIR}) -elseif (APPLE) +if (APPLE) install(CODE "execute_process(COMMAND cp \"${OPENSSL_SSL_LIBRARY}\" \"${CMAKE_INSTALL_PREFIX}/foxogram.app/Contents/Frameworks/libssl.3.dylib\") -execute_process(COMMAND cp \"${OPENSSL_CRYPTO_LIBRARY}\" \"${CMAKE_INSTALL_PREFIX}/foxogram.app/Contents/Frameworks/libcrypto.3.dylib\") -message(cp \"${OPENSSL_SSL_LIBRARY}\" \"${CMAKE_INSTALL_PREFIX}/foxogram.app/Contents/Frameworks/libssl.3.dylib\") execute_process(COMMAND cp \"${OPENSSL_CRYPTO_LIBRARY}\" \"${CMAKE_INSTALL_PREFIX}/foxogram.app/Contents/Frameworks/libcrypto.3.dylib\")") endif() set(CPACK_BUNDLE_STARTUP_COMMAND ${PROJECT_BINARY_DIR}/startup.sh) \ No newline at end of file