Coder Social home page Coder Social logo

pozemka / cmake-findvcvars Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scikit-build/cmake-findvcvars

0.0 0.0 0.0 45 KB

Finds a "vcvars" batch script. This CMake module can be used when configuring a project or when running in cmake -P script mode.

License: BSD 3-Clause "New" or "Revised" License

CMake 100.00%

cmake-findvcvars's Introduction

FindVcvars

Finds a "vcvars" batch script.

This CMake module can be used when configuring a project or when running in cmake -P script mode.

Why this repository ?

Waiting the module is integrated in upstream CMake (most likely CMake 3.13), this repository allows project to easily integrate the module by either copying its content or downloading it.

For reference, the associated merge request is https://gitlab.kitware.com/cmake/cmake/merge_requests/899

Notes

  • Anticipate future release of VS 2022 listing MSVC_VERSION up to 1940 as being valid version numbers.

  • There is no support for looking up Microsoft Visual C++ Compiler for Python 2.7

Changes

v1.6

  • Update _Vcvars_SUPPORTED_MSVC_VERSIONS anticipating future VS 2022 releases

  • Fix typo in commentdd

v1.5

  • Add support for msvc version 1929
  • Add initial support for Visual Studio 2022

v1.4

  • Add support for MSVC version 1928
  • Add support for MSVC version 1927

v1.3

  • Add support for MSVC version 1916 through 1926

v1.2

  • Add support for Visual Studio 2017 15.8 (msvc version 1915)

v1.1

  • Rename Vcvars_WRAPPER_BATCH_FILE to Vcvars_LAUNCHER

Integrating the module in your project

There are few possible approaches:

Approach 1: Download

  • Add file cmake/CMakeLists.txt with the following code used to download the module:
# Download FindVcvars.cmake
set(dest_file "${CMAKE_CURRENT_BINARY_DIR}/FindVcvars.cmake")
set(expected_hash "0fd1104a5e0f91f89b64dd700ce57ab9f7d7356fcabe9c895e62aca32386008e")
set(url "https://raw.githubusercontent.com/scikit-build/cmake-FindVcvars/v1.6/FindVcvars.cmake")
if(NOT EXISTS ${dest_file})
  file(DOWNLOAD ${url} ${dest_file} EXPECTED_HASH SHA256=${expected_hash})
else()
  file(SHA256 ${dest_file} current_hash)
  if(NOT ${current_hash} STREQUAL ${expected_hash})
    file(DOWNLOAD ${url} ${dest_file} EXPECTED_HASH SHA256=${expected_hash})
  endif()
endif()
  • Update top-level CMakeLists.txt with:
add_subdirectory(cmake)
  • Update CMAKE_MODULE_PATH:
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_BINARY_DIR}/cmake)

Approach 2: Copy

  • Copy FindVcvars.cmake into your source tree making sure you reference the tag (or SHA) in the associated commit message.

  • Update CMAKE_MODULE_PATH:

list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

Approach 3: Git submodule

Add this repository as a git submodule.

Maintainers

These instructions below have been tested on a Linux system, they may have to be adapted to work on macOS or Windows.

Creating new release and updating README

  • Step 1: List all tags sorted by version
git fetch --tags && \
  git tag -l | sort -V
  • Step 2: Choose the next release version number and tag the release
tag=vX.Y.Z
git tag -s -m "FindVcvars $tag" $tag

git push origin $tag
  • Step 3: Update release and expected_hash in README
cd cmake-FindVcvars

expected_hash=$(sha256sum FindVcvars.cmake | cut -d" " -f1) && \
sed -E "s/set\(expected_hash.+\)/set\(expected_hash \"$expected_hash\"\)/g" -i README.md && \
sed -E "s/v[0-9](\.[0-9])+\/FindVcvars.cmake/$tag\/FindVcvars.cmake/g" -i README.md && \
git add README.md && \
git commit -m "README: Update release and expected_hash"
  • Step 4: Amend the commit and update the CHANGES section.

  • Step 5: Push changes

git push origin master

cmake-findvcvars's People

Contributors

jcfr avatar jamesobutler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.