{"id":21801401,"url":"https://github.com/jimmy-park/openssl-cmake","last_synced_at":"2025-10-14T08:33:17.764Z","repository":{"id":62793322,"uuid":"562088089","full_name":"jimmy-park/openssl-cmake","owner":"jimmy-park","description":"Build OpenSSL in parallel within CMake","archived":false,"fork":false,"pushed_at":"2025-09-30T14:34:16.000Z","size":193,"stargazers_count":57,"open_issues_count":1,"forks_count":18,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-30T16:27:18.495Z","etag":null,"topics":["ccache","cmake","cross-platform","openssl","parallel-build"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimmy-park.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-05T09:18:05.000Z","updated_at":"2025-09-30T14:34:06.000Z","dependencies_parsed_at":"2023-02-16T01:01:28.081Z","dependency_job_id":"98c3fddb-ed41-4931-ab10-bf828c461f3f","html_url":"https://github.com/jimmy-park/openssl-cmake","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/jimmy-park/openssl-cmake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmy-park%2Fopenssl-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmy-park%2Fopenssl-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmy-park%2Fopenssl-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmy-park%2Fopenssl-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimmy-park","download_url":"https://codeload.github.com/jimmy-park/openssl-cmake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmy-park%2Fopenssl-cmake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018310,"owners_count":26086342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ccache","cmake","cross-platform","openssl","parallel-build"],"created_at":"2024-11-27T11:17:45.445Z","updated_at":"2025-10-14T08:33:17.758Z","avatar_url":"https://github.com/jimmy-park.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openssl-cmake\n\n[![CI](https://github.com/jimmy-park/openssl-cmake/actions/workflows/ci.yaml/badge.svg)](https://github.com/jimmy-park/openssl-cmake/actions/workflows/ci.yaml)\n\nBuild OpenSSL in parallel within CMake\n\n## Features\n\n- Support OpenSSL versions from `1.1.1` to the latest `3.6.x`\n- Detect the target platform (`Linux`, `macOS`, `Windows`, `Android`, `iOS`, and more)\n- Download the source code only once (thanks [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake)!)\n- Don't reconfigure if same options are used\n- Automatically use the maximum number of processors\n- Reduce rebuild time using [ccache](https://github.com/ccache/ccache)\n- Override the [`FindOpenSSL`](https://cmake.org/cmake/help/latest/module/FindOpenSSL.html) CMake module (no need to change existing CMake code)\n\n## CMake Options\n\n| Option                      | Type   | Default       | Description                                          |\n| --------------------------- | ------ | ------------- | ---------------------------------------------------- |\n| `OPENSSL_BUILD_OPTIONS`     | list   | `(undefined)` | `make`-compatible options                            |\n| `OPENSSL_BUILD_TARGET`      | string | `build_libs`  | Makefile target for build                            |\n| `OPENSSL_BUILD_VERBOSE`     | bool   | `OFF`         | Enable verbose output from build                     |\n| `OPENSSL_CONFIGURE_OPTIONS` | list   | `(undefined)` | Use OpenSSL's Configure options                      |\n| `OPENSSL_CONFIGURE_VERBOSE` | bool   | `OFF`         | Enable verbose output from configuration             |\n| `OPENSSL_ENABLE_PARALLEL`   | bool   | `ON`          | Build and test in parallel if possible               |\n| `OPENSSL_INSTALL`           | bool   | `OFF`         | Install OpenSSL components                           |\n| `OPENSSL_INSTALL_CERT`      | bool   | `OFF`         | Install `cert.pem` to the `openssldir` directory     |\n| `OPENSSL_INSTALL_TARGET`    | string | `install_dev` | Makefile target for install                          |\n| `OPENSSL_PATCH`             | list   | `(undefined)` | Apply patches to OpenSSL source                      |\n| `OPENSSL_SOURCE`            | path   | `(undefined)` | Specify the location of OpenSSL source (URL or path) |\n| `OPENSSL_TARGET_PLATFORM`   | string | `(undefined)` | Use OpenSSL's Configure target (see below)           |\n| `OPENSSL_TARGET_VERSION`    | string | `3.6.x`       | Use the latest OpenSSL version by default            |\n| `OPENSSL_TEST`              | bool   | `OFF`         | Enable testing and build OpenSSL self tests          |\n| `OPENSSL_USE_CCACHE`        | bool   | `ON`          | Use ccache if available                              |\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e - `OPENSSL_PATCH`\n\u003e   - Since OpenSSL source is distributed with `LF`, patch files also should be `LF`\n\u003e - `OPENSSL_USE_CCACHE`\n\u003e   - Whenever you change this option, perform a fresh configuration (or just delete `CMakeCache.txt`)\n\u003e   - This option will remove `/Zi /Fd` on MSVC\n\n\u003e [!NOTE]\n\u003e\n\u003e - `OPENSSL_CONFIGURE_OPTIONS`\n\u003e   - `no-shared` is added when `BUILD_SHARED_LIBS` is `OFF`\n\u003e   - `no-tests` is added when `OPENSSL_TEST` is `OFF`\n\u003e - `OPENSSL_TARGET_PLATFORM`\n\u003e   - If this option is empty, the target platform will be detected\n\u003e   - If `openssl-cmake` fails to detect, you need to set this option explicitly\n\n\u003e [!TIP]\n\u003e\n\u003e - `OPENSSL_INSTALL`\n\u003e   - To change the installation path, add `--prefix=\u003cpath\u003e` to `OPENSSL_CONFIGURE_OPTIONS`\n\u003e - `OPENSSL_INSTALL_CERT`\n\u003e   - The CA certs will be downloaded from \u003chttps://curl.se/docs/caextract.html\u003e\n\u003e - `OPENSSL_SOURCE`\n\u003e   - You can download OpenSSL source from the internet or use the local OpenSSL source\n\u003e   - If this option is empty or invalid, OpenSSL source will be downloaded from the official website\n\n## Prerequisites\n\n### Requirements\n\n- CMake 3.25+\n- OpenSSL build tools [Link](https://github.com/openssl/openssl/blob/master/INSTALL.md#prerequisites)\n  - Make implementation\n  - Perl 5\n  - ANSI C compiler\n  - NASM (Windows only)\n- ccache (optional)\n\n### Linux\n\nInstall CMake from [official website](https://cmake.org/download/) or [Snapcraft](https://snapcraft.io/docs/installing-snapd)\n\n```sh\n# Debian\nsudo snap install cmake --classic\nsudo apt-get install -y build-essential perl ninja-build ccache\n```\n\n### macOS\n\nInstall packages from [Homebrew](https://brew.sh/)\n\n```sh\nbrew install cmake perl ninja ccache\nxcode-select --install\n```\n\n### Windows\n\nInstall packages from [Chocolatey](https://chocolatey.org/install)\n\n```sh\n# Powershell (run as administrator)\nchoco install -y cmake jom strawberryperl nasm ccache --installargs 'ADD_CMAKE_TO_PATH=System'\n\n# Append \"C:\\Program Files\\NASM\" to the PATH environment variable\n# or run this code\n[Environment]::SetEnvironmentVariable(\"PATH\", \"$ENV:PATH;C:\\Program Files\\NASM\", \"USER\")\n```\n\n## Usage\n\n### Build\n\n```sh\ncmake --list-presets all                    # List all CMake presets\ncmake --preset windows                      # Configure\ncmake --build --preset windows              # Build\nctest --preset windows                      # Test\ncmake --build --preset windows -t install   # Install\n```\n\n### Integration\n\n```CMake\nFetchContent_Declare(\n    openssl-cmake\n    URL https://github.com/jimmy-park/openssl-cmake/archive/main.tar.gz\n)\nFetchContent_MakeAvailable(openssl-cmake)\n\nadd_executable(main main.cpp)\ntarget_link_libraries(main PRIVATE\n    OpenSSL::SSL\n    OpenSSL::Crypto\n    OpenSSL::applink\n)\n```\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e - `FetchContent_MakeAvailable(openssl-cmake)` must be preceded before `find_package(OpenSSL)`\n\u003e - If some libraries link OpenSSL using `OPENSSL_LIBRARIES` variable rather than `OpenSSL::SSL` target, `add_dependencies()` may help change the build order\n\n#### Using [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake)\n\n```CMake\nCPMAddPackage(\n    NAME openssl-cmake\n    URL https://github.com/jimmy-park/openssl-cmake/archive/main.tar.gz\n    OPTIONS\n    \"OPENSSL_CONFIGURE_OPTIONS option1\\\\\\\\;option2\"\n)\n```\n\n\u003e [!TIP]\n\u003e For some reason, CPM requires double-escaping for semicolon-separated lists.\n\n## Benchmarks\n\n| Configuration               |  Time |      Speed |\n| --------------------------- | ----: | ---------: |\n| Sequential                  | 168 s |     1.00 x |\n| Sequential w/ ccache (cold) | 460 s |     0.37 x |\n| Sequential w/ ccache (warm) | 111 s |     1.51 x |\n| Parallel                    |  34 s |     4.94 x |\n| Parallel w/ ccache (cold)   |  78 s |     2.15 x |\n| Parallel w/ ccache (warm)   |  21 s | **8.00 x** |\n\n- **OS** : Windows 10 22H2\n- **CPU** : AMD Ryzen 5 3600 6-Core Processor 3.60 GHz\n- **RAM** : 16 GB\n- **Storage** : Samsung SSD 860 EVO\n- **Compiler** : MSVC 19.36\n- **Configuration**\n  - OpenSSL 3.1.1 (`VC-WIN64A`, `no-tests`, `no-asm`, `no-makedepend`, `no-shared`)\n  - ccache 4.8.1 (default options)\n\n\u003e [!TIP]\n\u003e There are [benchmark workflows](https://github.com/jimmy-park/openssl-cmake/actions/workflows/ccache.yaml)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmy-park%2Fopenssl-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimmy-park%2Fopenssl-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmy-park%2Fopenssl-cmake/lists"}