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 #35 from ilelann/cmake
CMake build
- Loading branch information
Showing
52 changed files
with
253 additions
and
367 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,32 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
include(ExternalProject) | ||
include(CMakeParseArguments) | ||
enable_testing() | ||
|
||
project(adobe_source_libraries CXX) | ||
|
||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
link_directories(${CMAKE_INSTALL_PREFIX}/lib) | ||
|
||
ExternalProject_Add(double-conversion_prj | ||
PREFIX ${CMAKE_BINARY_DIR}/thirdparty/double-conversion | ||
GIT_REPOSITORY https://github.com/google/double-conversion.git | ||
#GIT_REPOSITORY https://github.com/stlab/double-conversion.git | ||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}) | ||
|
||
function(target_link_doubleconversion target) | ||
|
||
#tweak on include double-conversion path | ||
target_compile_definitions(${target} PUBLIC -DADOBE_BUILT_WITH_CMAKE) | ||
|
||
add_dependencies(${target} double-conversion_prj) | ||
target_include_directories(${target} PUBLIC ${CMAKE_INSTALL_PREFIX}/include) | ||
target_link_libraries(${target} PUBLIC double-conversion) | ||
endfunction(target_link_doubleconversion) | ||
|
||
find_package(Boost COMPONENTS system thread unit_test_framework program_options REQUIRED) | ||
|
||
add_subdirectory(source) | ||
add_subdirectory(test) |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
BUILDDIR=${BUILDDIR:-build} | ||
TOOLSET=${TOOLSET:-clang} | ||
BUILDMODE=${BUILDMODE:-RELEASE} | ||
|
||
mkdir -p ../${BUILDDIR}/${TOOLSET}/${BUILDMODE} | ||
pushd ../${BUILDDIR}/${TOOLSET}/${BUILDMODE} | ||
|
||
cmake -DCMAKE_CXX_COMPILER=${TOOLSET} -DCMAKE_BUILD_TYPE=${BUILDMODE} -DCMAKE_INSTALL_PREFIX=stage -G "Unix Makefiles" ../../../adobe_source_libraries | ||
make -j4 | ||
make test | ||
|
||
popd | ||
|
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,8 @@ | ||
#!/bin/bash | ||
|
||
BUILDDIR=${1:-build} | ||
|
||
BUILDDIR=${BUILDDIR} TOOLSET=clang++ BUILDMODE=RELEASE sh cmake_build.sh | ||
BUILDDIR=${BUILDDIR} TOOLSET=clang++ BUILDMODE=DEBUG sh cmake_build.sh | ||
BUILDDIR=${BUILDDIR} TOOLSET=g++ BUILDMODE=RELEASE sh cmake_build.sh | ||
BUILDDIR=${BUILDDIR} TOOLSET=g++ BUILDMODE=DEBUG sh cmake_build.sh |
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,20 @@ | ||
aux_source_directory(. SRC_LIST) | ||
file(GLOB_RECURSE INC_LIST ../adobe/*.hpp) | ||
add_library(asl ${SRC_LIST} ${INC_LIST}) | ||
|
||
target_include_directories(asl PUBLIC ..) | ||
target_compile_definitions(asl PUBLIC ADOBE_STD_SERIALIZATION) | ||
|
||
#otherwise boost concept checking fails on adobe::selection_t because it lacks non const begin/end | ||
target_compile_definitions(asl PUBLIC -DBOOST_RANGE_ENABLE_CONCEPT_ASSERT=0) | ||
|
||
#otherwise boost::move and std::move are ambiguous | ||
target_compile_definitions(asl PUBLIC -DBOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) | ||
|
||
target_compile_options(asl PUBLIC $<$<CXX_COMPILER_ID:Clang>:-fconstexpr-depth=1024>) | ||
target_compile_options(asl PUBLIC $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=1024>) | ||
|
||
target_link_doubleconversion(asl) | ||
|
||
target_link_libraries(asl PUBLIC ${Boost_SYSTEM_LIBRARY}) | ||
|
Oops, something went wrong.