This repository has been archived by the owner on Aug 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from frederikvannoote/develop
Release
- Loading branch information
Showing
11 changed files
with
245 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
image: Visual Studio 2017 | ||
|
||
platform: | ||
- x64 | ||
|
||
configuration: | ||
- Debug | ||
- Release | ||
|
||
environment: | ||
QT_VERSION: 5.9 | ||
QT_COMPILED: msvc2017 | ||
matrix: | ||
- SHARED: ON | ||
- SHARED: OFF | ||
|
||
install: | ||
############################################################################ | ||
# Install Ninja | ||
############################################################################ | ||
- set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip" | ||
- appveyor DownloadFile %NINJA_URL% -FileName ninja.zip | ||
- 7z x ninja.zip -oC:\projects\deps\ninja > nul | ||
- set PATH=C:\projects\deps\ninja;%PATH% | ||
- ninja --version | ||
|
||
############################################################################ | ||
# set correct QTDIR in the PATH environment variable | ||
############################################################################ | ||
- set VS_FULL=%VS_VERSION% Win64 | ||
- set QTDIR=C:/Qt/%QT_VERSION%/%QT_COMPILED%_64 | ||
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 | ||
- set PATH=%PATH%;%QTDIR%/bin | ||
|
||
build_script: | ||
# Clone examples: they are the code to test against. | ||
- git clone https://github.com/frederikvannoote/cmake-common-examples.git examples | ||
- set CMAKE_COMMON=C:/projects/cmake-common | ||
- mkdir installed | ||
|
||
test_script: | ||
# Build and install simplelib | ||
- mkdir simplelib-build | ||
- cd simplelib-build | ||
- cmake -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=../installed -G Ninja ../examples/simplelib | ||
- cmake --build . --config %configuration% --target all | ||
- cmake --build . --config %configuration% --target install | ||
- cmake --build . --config %configuration% --target sdk | ||
- cd .. | ||
|
||
# Relocate library | ||
- xcopy /E installed relocated\ | ||
|
||
# Build and install Simpleapp | ||
- mkdir simpleapp-build | ||
- cd simpleapp-build | ||
- cmake -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=../installed -DCC1simplelib_DIR=../relocated/lib/cmake/CC1simplelib -G Ninja ../examples/simpleapp | ||
- cmake --build . --config %configuration% --target all | ||
- cmake --build . --config %configuration% --target install | ||
- cd .. | ||
|
||
# Build and install QSimpleApp | ||
- mkdir QSimpleApp-build | ||
- cd QSimpleApp-build | ||
- cmake -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=../installed -DCC1simplelib_DIR=../relocated/lib/cmake/CC1simplelib -G Ninja ../examples/QSimpleApp/ | ||
- cmake --build . --config %configuration% --target all | ||
- cmake --build . --config %configuration% --target install | ||
- cd .. | ||
|
||
# Build and install complex lib | ||
- mkdir complexlib-build | ||
- cd complexlib-build | ||
- cmake -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=../installed -G Ninja ../examples/complexlib | ||
- cmake --build . --config %configuration% --target all | ||
- cmake --build . --config %configuration% --target install | ||
- cmake --build . --config %configuration% --target sdk | ||
- cd .. | ||
|
||
# uncomment following lines to be able to debug the appveyor image through RDP protocol when build finished | ||
# https://www.appveyor.com/docs/how-to/rdp-to-build-worker/ | ||
# on_finish: | ||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
language: cpp | ||
sudo: false | ||
dist: trusty | ||
|
||
os: | ||
- linux | ||
- osx | ||
|
||
compiler: | ||
- gcc | ||
- clang | ||
|
||
env: | ||
global: | ||
- | ||
|
||
matrix: | ||
- CMAKE_BUILD_TYPE=Debug | ||
- CMAKE_BUILD_TYPE=Release | ||
|
||
matrix: | ||
exclude: | ||
- os: linux | ||
compiler: clang | ||
- os: osx | ||
compiler: gcc | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- ninja-build | ||
- qtbase5-dev | ||
|
||
before_install: | ||
- | | ||
# Install cmake | ||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then | ||
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.2-Linux-x86_64.tar.gz" | ||
cd /tmp | ||
mkdir cmake | ||
travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake | ||
export PATH=/tmp/cmake/bin:${PATH} | ||
else | ||
if ! brew ls --version cmake &>/dev/null; then brew install cmake; fi | ||
fi | ||
- | | ||
# Install cmake and ninja | ||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then | ||
export QTDIR=/usr/lib/x86_64-linux-gnu/qt5 | ||
export PATH="$QTDIR/bin:$PATH" | ||
else | ||
brew update > /dev/null | ||
brew tap homebrew/versions | ||
brew install ninja | ||
brew install qt | ||
export QTDIR="/usr/local/opt/qt5" | ||
export PATH="$QTDIR/bin:$PATH" | ||
fi | ||
install: | ||
# Clone examples: they are the code to test against. | ||
- git clone https://github.com/frederikvannoote/cmake-common-examples.git ${HOME}/examples | ||
- export CMAKE_COMMON=${TRAVIS_BUILD_DIR} | ||
- mkdir /tmp/installed | ||
|
||
script: | ||
- | | ||
# Build and install simplelib | ||
mkdir /tmp/simplelib-build | ||
cd /tmp/simplelib-build | ||
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=/tmp/installed -G Ninja ${HOME}/examples/simplelib | ||
cmake --build . --target all | ||
cmake --build . --target install | ||
cmake --build . --target sdk | ||
- | | ||
# Relocate library | ||
cp -r /tmp/installed /tmp/relocated | ||
- | | ||
# Build and install Simpleapp | ||
mkdir /tmp/simpleapp-build | ||
cd /tmp/simpleapp-build | ||
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=/tmp/installed -DCC1simplelib_DIR=/tmp/relocated/lib/cmake/CC1simplelib -G Ninja ${HOME}/examples/simpleapp | ||
cmake --build . --target all | ||
cmake --build . --target install | ||
- | | ||
# Build and install QSimpleApp | ||
mkdir /tmp/QSimpleApp-build | ||
cd /tmp/QSimpleApp-build | ||
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=/tmp/installed -DCC1simplelib_DIR=/tmp/relocated/lib/cmake/CC1simplelib -G Ninja ${HOME}/examples/QSimpleApp/ | ||
cmake --build . --target all | ||
cmake --build . --target install | ||
- | | ||
# Build and install complex lib | ||
mkdir /tmp/complexlib-build | ||
cd /tmp/complexlib-build | ||
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=/tmp/installed -G Ninja ${HOME}/examples/complexlib | ||
cmake --build . --target all | ||
cmake --build . --target install | ||
cmake --build . --target sdk | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,3 +67,5 @@ SORT_MEMBER_DOCS = YES | |
SORT_MEMBERS_CTORS_1ST = YES | ||
|
||
USE_MATHJAX = YES | ||
|
||
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
# check if Doxygen is installed | ||
find_package(Doxygen) | ||
if (DOXYGEN_FOUND) | ||
# set input and output files | ||
set(DOXYGEN_IN ${CMAKE_CURRENT_LIST_DIR}/Doxyfile.in) | ||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) | ||
if (NOT TARGET doxygen) | ||
# check if Doxygen is installed | ||
find_package(Doxygen) | ||
if (DOXYGEN_FOUND) | ||
# set input and output files | ||
set(DOXYGEN_IN ${CMAKE_CURRENT_LIST_DIR}/Doxyfile.in) | ||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) | ||
|
||
# request to configure the file | ||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) | ||
message("Doxygen build started") | ||
# request to configure the file | ||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) | ||
message("Doxygen build started") | ||
|
||
# note the option ALL which allows to build the docs together with the application | ||
add_custom_target(doxygen | ||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
COMMENT "Generating API documentation with Doxygen" | ||
VERBATIM ) | ||
else (DOXYGEN_FOUND) | ||
message("Doxygen need to be installed to generate the doxygen documentation") | ||
endif (DOXYGEN_FOUND) | ||
# note the option ALL which allows to build the docs together with the application | ||
add_custom_target(doxygen | ||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
COMMENT "Generating API documentation with Doxygen" | ||
VERBATIM ) | ||
else (DOXYGEN_FOUND) | ||
message("Doxygen need to be installed to generate the doxygen documentation") | ||
endif (DOXYGEN_FOUND) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,19 @@ You can fetch the files during your git clone using a submodule. | |
git submodule add -b <tag> [email protected]:barco-healthcare/cmake-common.git path/to/cmake/common | ||
``` | ||
|
||
## Cloning during cmake run | ||
Add this snippet to your CMakeLists.txt | ||
``` | ||
# Download build system | ||
if(NOT EXISTS "${CMAKE_BINARY_DIR}/buildsys/v2.0") | ||
message(STATUS "Downloading buildsystem...") | ||
find_package(Git REQUIRED) | ||
execute_process(COMMAND ${GIT_EXECUTABLE} clone --branch v2.0 https://github.com/frederikvannoote/cmake-common.git ${CMAKE_BINARY_DIR}/buildsys/v2.0) | ||
endif() | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/buildsys/v2.0") | ||
``` | ||
|
||
# Usage | ||
|
||
You can include these files in your CMakeLists.txt | ||
|