cmake
GitHub CI 도구의 CMake 통합
수색…
주식 CMake로 Travis CI 구성
Travis CI에는 CMake 2.8.7이 미리 설치되어 있습니다.
out-of 소스 빌드를위한 최소한의 .travis.yml
스크립트
language: cpp
compiler:
- gcc
before_script:
# create a build folder for the out-of-source build
- mkdir build
# switch to build directory
- cd build
# run cmake; here we assume that the project's
# top-level CMakeLists.txt is located at '..'
- cmake ..
script:
# once CMake has done its job we just build using make as usual
- make
# if the project uses ctest we can run the tests like this
- make test
최신 CMake로 Travis CI 구성
Travis에 미리 설치된 CMake 버전은 매우 오래된 버전입니다. 공식 Linux 바이너리 를 사용하여 최신 버전으로 빌드 할 수 있습니다.
다음은 .travis.yml
의 예 .travis.yml
.
language: cpp
compiler:
- gcc
# the install step will take care of deploying a newer cmake version
install:
# first we create a directory for the CMake binaries
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
# we use wget to fetch the cmake binaries
- travis_retry wget --no-check-certificate https://cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz
# this is optional, but useful:
# do a quick md5 check to ensure that the archive we downloaded did not get compromised
- echo "f3546812c11ce7f5d64dc132a566b749 *cmake-3.3.2-Linux-x86_64.tar.gz" > cmake_md5.txt
- md5sum -c cmake_md5.txt
# extract the binaries; the output here is quite lengthy,
# so we swallow it to not clutter up the travis console
- tar -xvf cmake-3.3.2-Linux-x86_64.tar.gz > /dev/null
- mv cmake-3.3.2-Linux-x86_64 cmake-install
# add both the top-level directory and the bin directory from the archive
# to the system PATH. By adding it to the front of the path we hide the
# preinstalled CMake with our own.
- PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH
# don't forget to switch back to the main build directory once you are done
- cd ${TRAVIS_BUILD_DIR}
before_script:
# create a build folder for the out-of-source build
- mkdir build
# switch to build directory
- cd build
# run cmake; here we assume that the project's
# top-level CMakeLists.txt is located at '..'
- cmake ..
script:
# once CMake has done its job we just build using make as usual
- make
# if the project uses ctest we can run the tests like this
- make test
Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow