There are several ways to specify a particular version of CommonLibSSE-NG when using vcpkg and CMake. Here are the most effective approaches:
Method 1: Using vcpkg.json (Recommended)
Create or modify a vcpkg.json file in your project root:
{ "name": "your-project-name", "version": "1.0.0", "dependencies": [ { "name": "commonlibsse-ng", "version>=": "3.0.0" } ] }
Or to pin to an exact version:
{ "name": "your-project-name", "version": "1.0.0", "dependencies": [ { "name": "commonlibsse-ng", "version": "3.0.0" } ] }
Method 2: Using vcpkg Command Line
Install a specific version directly:
vcpkg install commonlibsse-ng:x64-windows --recurse
To see available versions:
vcpkg search commonlibsse-ng
Method 3: CMake Integration
In your CMakeLists.txt:
cmake_minimum_required(VERSION 3.21) project(YourProject) # Set vcpkg toolchain set(CMAKE_TOOLCHAIN_FILE "path/to/vcpkg/scripts/buildsystems/vcpkg.cmake") # Find the package find_package(CommonLibSSE CONFIG REQUIRED) # Link to your target target_link_libraries(your_target PRIVATE CommonLibSSE::CommonLibSSE)
Method 4: Using Baseline and Overrides
If you need very specific version control, create a vcpkg-configuration.json:
{ "default-registry": { "kind": "git", "repository": "https://github.com/Microsoft/vcpkg", "baseline": "your-desired-baseline-commit" }, "registries": [ { "kind": "git", "repository": "https://github.com/Ryan-rsm-McKenzie/CommonLibSSE-NG", "baseline": "specific-commit-hash", "packages": ["commonlibsse-ng"] } ] }
Troubleshooting Tips
-
Clear vcpkg cache if you're having version conflicts:
vcpkg remove commonlibsse-ng vcpkg install commonlibsse-ng:x64-windows -
Check available versions:
vcpkg search commonlibsse-ng --x-full-desc -
Verify installation:
vcpkg list commonlibsse-ng
The vcpkg.json approach (Method 1) is generally the most maintainable solution as it keeps your dependencies clearly documented and version-controlled with your project.