개발이야기
osx - openssl 개발환경 세팅
준호씨
2017. 12. 13. 00:00
반응형
openssl 설치
brew install openssl
openssl-dev 이런건 없음
설치 하면 다음과 같은 안내가 나온다.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
openssl 커맨드를 시스템 커맨드 말고 설치한 커맨드로 변경
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
버전 확인
$ openssl version
OpenSSL 1.0.2m 2 Nov 2017
cmake 에서 OPENSSL_ROOT_DIR 못찾는 경우
cmake 할 때 OPENSSL_ROOT_DIR 을 못찾는다는 메시지가 나올 수 있는데 openssl library 를 못찾는 경우 발생한다.
$ cmake .
CMake Error at /usr/local/Cellar/cmake/3.10.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
해결방법은 OPENSSL_ROOT_DIR 를 선언해 주던지 /usr/local/include 에 openssl 디렉토리를 심볼릭 링크로 연결 해 준다.
$ cd /usr/local/include
$ ln -s ../opt/openssl/include/openssl .
참고
반응형