Initial commit
This commit is contained in:
committed by
Brendan LE GLAUNEC
parent
2af5f4475e
commit
201d7e31c6
@@ -0,0 +1,91 @@
|
||||
## Copyright 2016 Etix Labs
|
||||
##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License");
|
||||
## you may not use this file except in compliance with the License.
|
||||
## You may obtain a copy of the License at
|
||||
##
|
||||
## http://www.apache.org/licenses/LICENSE-2.0
|
||||
##
|
||||
## Unless required by applicable law or agreed to in writing, software
|
||||
## distributed under the License is distributed on an "AS IS" BASIS,
|
||||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
## See the License for the specific language governing permissions and
|
||||
## limitations under the License.
|
||||
|
||||
message(STATUS "Configuring deps.boost")
|
||||
|
||||
set(BOOST_VERSION 1.60.0)
|
||||
# set(BoostSHA1 2fc96c1651ac6fe9859b678b165bd78dc211e881)
|
||||
|
||||
# Set up general b2 (bjam) command line arguments
|
||||
set(b2Args <SOURCE_DIR>/b2
|
||||
# link=static
|
||||
threading=multi
|
||||
runtime-link=shared
|
||||
--layout=tagged
|
||||
--build-dir=build
|
||||
--without-wave
|
||||
--without-python
|
||||
stage
|
||||
-d+2
|
||||
)
|
||||
|
||||
if(TARGET_ARCH STREQUAL "x86_64")
|
||||
list(APPEND b2Args address-model=64)
|
||||
endif()
|
||||
|
||||
string(REPLACE "." "_" BOOST_VERSION_UNDERSCORE ${BOOST_VERSION})
|
||||
|
||||
set(BOOST_DIR boost)
|
||||
set(BOOST_PATH ${DEPS_DIR}/${BOOST_DIR})
|
||||
|
||||
# Set up build steps
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(
|
||||
deps.boost
|
||||
PREFIX ${BOOST_PATH}
|
||||
URL http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_UNDERSCORE}.tar.bz2/download
|
||||
TIMEOUT 600
|
||||
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory <SOURCE_DIR>/build
|
||||
BUILD_COMMAND "${b2Args}"
|
||||
# BUILD_COMMAND "<SOURCE_DIR>/b2 address-model=64 threading=multi runtime-link=shared --layout=tagged --build-dir=<SOURCE_DIR>/build"
|
||||
BUILD_IN_SOURCE ON
|
||||
INSTALL_COMMAND ""
|
||||
# INSTALL_COMMAND <SOURCE_DIR>/b2 install --prefix=${BOOST_PATH}
|
||||
LOG_DOWNLOAD ON
|
||||
LOG_UPDATE ON
|
||||
LOG_CONFIGURE ON
|
||||
LOG_BUILD ON
|
||||
LOG_TEST ON
|
||||
LOG_INSTALL ON
|
||||
)
|
||||
|
||||
# Set extra step to build b2 (bjam)
|
||||
set(b2Bootstrap "./bootstrap.sh")
|
||||
ExternalProject_Add_Step(
|
||||
deps.boost
|
||||
make_b2
|
||||
COMMAND ${b2Bootstrap}
|
||||
COMMENT "Building b2..."
|
||||
DEPENDEES download
|
||||
DEPENDERS configure
|
||||
WORKING_DIRECTORY <SOURCE_DIR>
|
||||
LOG ON
|
||||
)
|
||||
|
||||
|
||||
ExternalProject_Get_Property(deps.boost SOURCE_DIR)
|
||||
set(BOOST_INCLUDE_DIR ${SOURCE_DIR} PARENT_SCOPE)
|
||||
set(BOOST_LIBRARY_DIR "${SOURCE_DIR}/stage/lib")
|
||||
set(BOOST_LIBRARY_DIR ${BOOST_LIBRARY_DIR} PARENT_SCOPE)
|
||||
|
||||
# list all the boost libraries .dylib/.so
|
||||
file(GLOB BOOST_INSTALL_DEPENDENCIES "${BOOST_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}boost_*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
list (APPEND CCTV_INSTALL_DEPENDENCIES ${BOOST_INSTALL_DEPENDENCIES})
|
||||
# on linux
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
file(GLOB BOOST_INSTALL_DEPENDENCIES "${BOOST_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}boost_*${CMAKE_SHARED_LIBRARY_SUFFIX}.${BOOST_VERSION}")
|
||||
list (APPEND CCTV_INSTALL_DEPENDENCIES ${BOOST_INSTALL_DEPENDENCIES})
|
||||
endif()
|
||||
|
||||
set(CCTV_INSTALL_DEPENDENCIES ${CCTV_INSTALL_DEPENDENCIES} PARENT_SCOPE)
|
||||
@@ -0,0 +1,28 @@
|
||||
## Copyright 2016 Etix Labs
|
||||
##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License");
|
||||
## you may not use this file except in compliance with the License.
|
||||
## You may obtain a copy of the License at
|
||||
##
|
||||
## http://www.apache.org/licenses/LICENSE-2.0
|
||||
##
|
||||
## Unless required by applicable law or agreed to in writing, software
|
||||
## distributed under the License is distributed on an "AS IS" BASIS,
|
||||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
## See the License for the specific language governing permissions and
|
||||
## limitations under the License.
|
||||
|
||||
# function to retrieve files sources inside a list of folders
|
||||
function(find_sources DIRS)
|
||||
set(_headers "")
|
||||
set(_srcs "")
|
||||
foreach (dir ${ARGV})
|
||||
file (GLOB h_${dir} "${dir}/*.h")
|
||||
file (GLOB s_${dir} "${dir}/*.c*")
|
||||
source_group (${dir} FILES ${s_${dir}} ${h_${dir}})
|
||||
set (_srcs ${_srcs} ${s_${dir}})
|
||||
set (_headers ${_headers} ${h_${dir}})
|
||||
endforeach ()
|
||||
set (SOURCES ${_srcs} PARENT_SCOPE)
|
||||
set (HEADERS ${_headers} PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -0,0 +1,48 @@
|
||||
## Copyright 2016 Etix Labs
|
||||
##
|
||||
## Licensed under the Apache License, Version 2.0 (the "License");
|
||||
## you may not use this file except in compliance with the License.
|
||||
## You may obtain a copy of the License at
|
||||
##
|
||||
## http://www.apache.org/licenses/LICENSE-2.0
|
||||
##
|
||||
## Unless required by applicable law or agreed to in writing, software
|
||||
## distributed under the License is distributed on an "AS IS" BASIS,
|
||||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
## See the License for the specific language governing permissions and
|
||||
## limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.8)
|
||||
include(ExternalProject)
|
||||
|
||||
message(STATUS "Configuring deps.jsoncpp")
|
||||
|
||||
set(JSONCPP_DIR jsoncpp)
|
||||
set(JSONCPP_PATH ${DEPS_DIR}/${JSONCPP_DIR})
|
||||
|
||||
ExternalProject_Add(
|
||||
deps.jsoncpp
|
||||
PREFIX ${JSONCPP_PATH}
|
||||
GIT_REPOSITORY https://github.com/open-source-parsers/jsoncpp.git
|
||||
TIMEOUT 10
|
||||
CONFIGURE_COMMAND ${CMAKE_COMMAND} "-DCMAKE_INSTALL_PREFIX=${JSONCPP_PATH}" -DBUILD_TYPE=Release -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DJSONCPP_WITH_TESTS=OFF -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF <SOURCE_DIR>
|
||||
BUILD_IN_SOURCE ON
|
||||
UPDATE_COMMAND ""
|
||||
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
|
||||
INSTALL_COMMAND ""
|
||||
LOG_DOWNLOAD ON
|
||||
LOG_UPDATE ON
|
||||
LOG_CONFIGURE ON
|
||||
LOG_BUILD ON
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property(deps.jsoncpp SOURCE_DIR)
|
||||
|
||||
set (JSONCPP_INCLUDE_DIR "${SOURCE_DIR}/include" PARENT_SCOPE)
|
||||
set (JSONCPP_LIBRARY_DIR "${SOURCE_DIR}/src/lib_json")
|
||||
set (JSONCPP_LIBRARY_DIR ${JSONCPP_LIBRARY_DIR} PARENT_SCOPE)
|
||||
|
||||
file(GLOB JSONCPP_INSTALL_DEPENDENCIES "${JSONCPP_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}jsoncpp*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
|
||||
list (APPEND CCTV_INSTALL_DEPENDENCIES ${JSONCPP_INSTALL_DEPENDENCIES})
|
||||
|
||||
set(CCTV_INSTALL_DEPENDENCIES ${CCTV_INSTALL_DEPENDENCIES} PARENT_SCOPE)
|
||||
Reference in New Issue
Block a user