diff --git a/CMakeLists.txt b/CMakeLists.txt index fd62c43..7af3ed1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,3 +140,10 @@ option(EbsdLib_BUILD_TOOLS "Build example applications" ON) if(EbsdLib_BUILD_TOOLS) include(${EbsdLibProj_SOURCE_DIR}/Source/Apps/SourceList.cmake) endif() + + +# ----------------------------------------------------------------------- +# Include the packaging Cmake codes +# ----------------------------------------------------------------------- +include(${EbsdLibProj_SOURCE_DIR}/cmake/Packaging.cmake) + diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..6ebbc1e --- /dev/null +++ b/CMakePresets.json @@ -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 + } + } + ] + } + \ No newline at end of file diff --git a/CTestConfig.cmake b/CTestConfig.cmake new file mode 100644 index 0000000..d31789b --- /dev/null +++ b/CTestConfig.cmake @@ -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() diff --git a/Source/Apps/SourceList.cmake b/Source/Apps/SourceList.cmake index 72a5de4..ea96746 100644 --- a/Source/Apps/SourceList.cmake +++ b/Source/Apps/SourceList.cmake @@ -31,12 +31,12 @@ if(EbsdLib_INSTALL_FILES) install(FILES "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Cubic m-3 (Th)/Cubic m-3 (Th).tiff" "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Cubic m-3m (Oh)/Cubic m-3m (Oh).tiff" - "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Hexagonal 6|m (C6h)//Hexagonal 6|m (C6h).tiff" - "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Hexagonal 6|mmm (D6h)/Hexagonal 6|mmm (D6h).tiff" - "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Monoclinic 2|m (C2h)/Monoclinic 2|m (C2h).tiff" + "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Hexagonal 6_m (C6h)/Hexagonal 6_m (C6h).tiff" + "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Hexagonal 6_mmm (D6h)/Hexagonal 6_mmm (D6h).tiff" + "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Monoclinic 2_m (C2h)/Monoclinic 2_m (C2h).tiff" "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Orthorhombic mmm (D2h)/Orthorhombic mmm (D2h).tiff" - "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Tetragonal 4|m (C4h)/Tetragonal 4|m (C4h).tiff" - "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Tetragonal 4|mmm (D4h)//Tetragonal 4|mmm (D4h).tiff" + "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Tetragonal 4_m (C4h)/Tetragonal 4_m (C4h).tiff" + "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Tetragonal 4_mmm (D4h)//Tetragonal 4_mmm (D4h).tiff" "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Triclinic -1 (Ci)/Triclinic -1 (Ci).tiff" "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Trigonal -3 (C3i)/Trigonal -3 (C3i).tiff" "${EbsdLibProj_SOURCE_DIR}/Data/IPF_Legend/Trigonal -3m (D3d)/Trigonal -3m (D3d).tiff" diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake new file mode 100644 index 0000000..550a050 --- /dev/null +++ b/cmake/Packaging.cmake @@ -0,0 +1,49 @@ +set(CPACK_PACKAGE_VENDOR "BlueQuartz Software") + +if(UNIX OR APPLE) + set(CPACK_BINARY_BUNDLE "OFF") + set(CPACK_BINARY_DEB "OFF") + set(CPACK_BINARY_DRAGNDROP "OFF") + set(CPACK_BINARY_FREEBSD "OFF") + set(CPACK_BINARY_IFW "OFF") + set(CPACK_BINARY_NSIS "OFF") + set(CPACK_BINARY_OSXX11 "OFF") + set(CPACK_BINARY_PACKAGEMAKER "OFF") + set(CPACK_BINARY_PRODUCTBUILD "OFF") + set(CPACK_BINARY_RPM "OFF") + set(CPACK_BINARY_STGZ "OFF") + set(CPACK_BINARY_TBZ2 "OFF") + set(CPACK_BINARY_TGZ "ON") + set(CPACK_BINARY_TXZ "OFF") + set(CPACK_BINARY_TZ "OFF") +else() + set(CPACK_BINARY_NSIS OFF) + set(CPACK_BINARY_ZIP ON) +endif() + +if(WIN32) + set(EbsdLib_HOST_NAME "windows") +elseif(APPLE) + set(EbsdLib_HOST_NAME "macos") +else() + set(EbsdLib_HOST_NAME "linux") +endif() + + + +set(EbsdLib_MAIN_PACKAGE_NAME "EbsdLib") + + +set(CPACK_COMPONENTS_ALL "Applications;Unspecified;license") +set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.github.com/bluequartzsoftware/ebsdlib") +set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_SUMMARY "EbsdLib: C++ Codes to import and analyze EBSD data.") +set(CPACK_PACKAGE_NAME "EbsdLib") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY EbsdLib) +set(CPACK_PACKAGE_FILE_NAME "EbsdLib-${EbsdLibProj_VERSION}-${EbsdLib_HOST_NAME}-${CMAKE_SYSTEM_PROCESSOR}") + + + +# THIS MUST BE THE LAST LINE OF THIS FILE BECAUSE ALL THE CPACK VARIABLES MUST BE +# DEFINED BEFORE CPack IS INCLUDED +INCLUDE(CPack) + diff --git a/cmake/triplets/arm64-osx-v11.cmake b/cmake/triplets/arm64-osx-v11.cmake new file mode 100644 index 0000000..159a5ed --- /dev/null +++ b/cmake/triplets/arm64-osx-v11.cmake @@ -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) diff --git a/cmake/triplets/x64-osx-v11.cmake b/cmake/triplets/x64-osx-v11.cmake new file mode 100644 index 0000000..5cfbf54 --- /dev/null +++ b/cmake/triplets/x64-osx-v11.cmake @@ -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) diff --git a/cmake/triplets/x64-windows-v142.cmake b/cmake/triplets/x64-windows-v142.cmake new file mode 100644 index 0000000..638b5d5 --- /dev/null +++ b/cmake/triplets/x64-windows-v142.cmake @@ -0,0 +1,4 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_PLATFORM_TOOLSET "v142") diff --git a/cmake/triplets/x64-windows-v143.cmake b/cmake/triplets/x64-windows-v143.cmake new file mode 100644 index 0000000..0924eea --- /dev/null +++ b/cmake/triplets/x64-windows-v143.cmake @@ -0,0 +1,4 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_PLATFORM_TOOLSET v143) diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 0000000..a4a8e9c --- /dev/null +++ b/vcpkg-configuration.json @@ -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" + } + ] +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..263b10d --- /dev/null +++ b/vcpkg.json @@ -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" + } + ] + } + } +}