Skip to content

Commit

Permalink
Add VCPKG Support for building
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Sep 18, 2024
1 parent fc0a3ed commit 8e7d96f
Show file tree
Hide file tree
Showing 8 changed files with 351 additions and 0 deletions.
244 changes: 244 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 24,
"patch": 0
},
"configurePresets": [
{
"name": "ci",
"displayName": "CI build",
"description": "Build configuration for Azure CI",
"generator": "Ninja",
"binaryDir": "${sourceDir}/../DREAM3D-Build/EbsdLib-CI",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "$env{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
"CMAKE_OSX_DEPLOYMENT_TARGET": {
"type": "STRING",
"value": "11.0"
},
"VCPKG_MANIFEST_DIR": {
"type": "STRING",
"value": "${sourceDir}/"
},
"VCPKG_INSTALLED_DIR": {
"type": "STRING",
"value": "${sourceDir}/../vcpkg-installed"
},
"VCPKG_MANIFEST_INSTALL": {
"type": "BOOL",
"value": "ON"
},
"VCPKG_OVERLAY_TRIPLETS": {
"type": "PATH",
"value": "${sourceDir}/cmake/triplets"
},
"VCPKG_APPLOCAL_DEPS": {
"type": "BOOL",
"value": "OFF"
},
"VCPKG_MANIFEST_FEATURES": {
"type": "STRING",
"value": "parallel"
},
"EbsdLib_ENABLE_HDF5": {
"type": "BOOL",
"value": "ON"
},
"EbsdLib_BUILD_H5SUPPORT": {
"type": "BOOL",
"value": "OFF"
}
}
},
{
"name": "ci-windows-v142",
"displayName": "ci-windows-v142",
"description": "Build configuration for GitHub Actions CI",
"generator": "Visual Studio 17 2022",
"inherits": "ci",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-windows-v142"
},
"VCPKG_HOST_TRIPLET": {
"type": "STRING",
"value": "x64-windows-v142"
}
}
},
{
"name": "ci-windows-v143",
"displayName": "ci-windows-v143",
"description": "Build configuration for GitHub Actions CI",
"generator": "Visual Studio 17 2022",
"inherits": "ci",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-windows-v143"
},
"VCPKG_HOST_TRIPLET": {
"type": "STRING",
"value": "x64-windows-v143"
}
}
},
{
"name": "ci-macos-x64",
"displayName": "ci-macos-x64",
"description": "Build configuration for GitHub Actions CI",
"generator": "Ninja",
"inherits": "ci",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-osx-v11"
},
"VCPKG_HOST_TRIPLET": {
"type": "STRING",
"value": "x64-osx-v11"
}
}
},
{
"name": "ci-macos-arm64",
"displayName": "ci-macos-arm64",
"description": "Build configuration for GitHub Actions CI",
"generator": "Ninja",
"inherits": "ci",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "arm64-osx-dynamic"
},
"VCPKG_HOST_TRIPLET": {
"type": "STRING",
"value": "arm64-osx-dynamic"
}
},
"environment": {
"VCPKG_INSTALLATION_ROOT": "/opt/local/vcpkg"
}
},
{
"name": "ci-linux-x64",
"displayName": "ci-linux-x64",
"description": "Build configuration for GitHub Actions CI",
"generator": "Ninja",
"inherits": "ci",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-linux-dynamic"
},
"VCPKG_HOST_TRIPLET": {
"type": "STRING",
"value": "x64-linux-dynamic"
},
"CMAKE_MAKE_PROGRAM": {
"type": "FILEPATH",
"value": "$env{VCPKG_INSTALLATION_ROOT}/downloads/tools/ninja/1.10.2-linux/ninja"
}
},
"environment": {
"VCPKG_INSTALLATION_ROOT": "/opt/local/vcpkg"
}
}
],
"buildPresets": [
{
"name": "ci-windows-v142",
"displayName": "ci-windows-v142 Release build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-windows-v142",
"configuration": "Release"
},
{
"name": "ci-windows-v143",
"displayName": "ci-windows-v143 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-windows-v143",
"configuration": "Release"
},
{
"name": "ci-macos-x64",
"displayName": "ci-macos-x64 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-macos-x64",
"configuration": "Release"
},
{
"name": "ci-macos-arm64",
"displayName": "ci-macos-arm64 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-macos-arm64",
"configuration": "Release"
},
{
"name": "ci-linux-x64",
"displayName": "ci-linux-x64 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-linux-x64",
"configuration": "Release"
}
],
"testPresets": [
{
"name": "ci-windows-v142",
"displayName": "ci-windows-v142 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-windows-v142",
"configuration": "Release",
"output": {
"outputOnFailure": true
}
},
{
"name": "ci-windows-v143",
"displayName": "ci-windows-v143 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-windows-v143",
"configuration": "Release",
"output": {
"outputOnFailure": true
}
},
{
"name": "ci-macos-x64",
"displayName": "ci-macos-x64 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-macos-x64",
"configuration": "Release",
"output": {
"outputOnFailure": true
}
},
{
"name": "ci-macos-arm64",
"displayName": "ci-macos-arm64 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-macos-arm64",
"configuration": "Release",
"output": {
"outputOnFailure": true
}
},
{
"name": "ci-linux-x64",
"displayName": "ci-linux-x64 CI build",
"description": "Build configuration for GitHub actions CI",
"configurePreset": "ci-linux-x64",
"configuration": "Release",
"output": {
"outputOnFailure": true
}
}
]
}

24 changes: 24 additions & 0 deletions CTestConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## enable_testing()
## include(CTest)
set(CTEST_PROJECT_NAME "DREAM3D")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=DREAM3D")
set(CTEST_DROP_SITE_CDASH TRUE)

# Use multiple CPU cores to build
include(ProcessorCount)
ProcessorCount(N)
if(NOT N EQUAL 0)
if(CTEST_CMAKE_GENERATOR MATCHES "Make" OR CTEST_CMAKE_GENERATOR MATCHES "Ninja")
set(CTEST_BUILD_FLAGS "-j${N}")
endif()
set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
endif()
7 changes: 7 additions & 0 deletions cmake/triplets/arm64-osx-v11.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES arm64)
set(VCPKG_OSX_DEPLOYMENT_TARGET 11.0)
7 changes: 7 additions & 0 deletions cmake/triplets/x64-osx-v11.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES x86_64)
set(VCPKG_OSX_DEPLOYMENT_TARGET 11.0)
4 changes: 4 additions & 0 deletions cmake/triplets/x64-windows-v142.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PLATFORM_TOOLSET "v142")
4 changes: 4 additions & 0 deletions cmake/triplets/x64-windows-v143.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PLATFORM_TOOLSET v143)
31 changes: 31 additions & 0 deletions vcpkg-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"default-registry": {
"kind": "git",
"repository": "https://github.com/microsoft/vcpkg",
"baseline": "8eb57355a4ffb410a2e94c07b4dca2dffbee8e50"
},
"registries": [
{
"kind": "git",
"repository": "https://github.com/bluequartzsoftware/simplnx-registry",
"packages": [
"eigen3",
"expected-lite",
"fmt",
"h5support",
"hdf5",
"lz4",
"nlohmann-json",
"nod",
"span-lite",
"tbb",
"ninja",
"vcpkg-cmake",
"vcpkg-cmake-config",
"zlib",
"zstd"
],
"baseline": "c9415182598df306f0d3f2f2b354d9d79cf1bf8b"
}
]
}
30 changes: 30 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "simplnx",
"version": "0.1.0",
"dependencies": [
{
"name": "eigen3"
},
{
"name": "hdf5",
"features": [
"cpp",
"zlib"
]
},
{
"name": "h5support"
}
],
"features": {
"parallel": {
"description": "Parallel support with TBB",
"dependencies": [
{
"name": "tbb"
}
]
}
}
}

0 comments on commit 8e7d96f

Please sign in to comment.