-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
86 lines (78 loc) · 3.55 KB
/
CMakeLists.txt
File metadata and controls
86 lines (78 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
project(pixels-cli)
set(CMAKE_CXX_STANDARD 20)
include(ExternalProject)
include(ProcessorCount)
# get core count
ProcessorCount(CORES)
if(CORES EQUAL 0)
set(CORES 1)
endif()
# boost-dev
set(BOOST_LIBRARIES "program_options,regex")
set(BOOST_BOOTSTRAP_COMMAND ./bootstrap.sh --with-libraries=${BOOST_LIBRARIES})
set(BOOST_BUILD_TOOL ./b2)
set(BOOST_CXXFLAGS "cxxflags=-std=c++11")
set(BOOST_GIT_REPOSITORY git@github.com:boostorg/boost.git)
set(BOOST_GIT_TAG boost-1.74.0)
set(BOOST_GIT_SUBMODULES
libs/headers libs/regex libs/program_options libs/algorithm
# The primary dependencies for algorithm, program_options, and regex:
libs/any libs/bind libs/config libs/core libs/detail libs/function libs/iterator libs/lexical_cast
libs/smart_ptr libs/static_assert libs/throw_exception libs/tokenizer libs/type_traits libs/assert
libs/concept_check libs/container_hash libs/integer libs/mpl libs/predef libs/preprocessor libs/conversion
libs/function_types libs/fusion libs/optional libs/utility libs/move libs/typeof libs/tuple libs/io
libs/type_index libs/array libs/container libs/math libs/numeric/conversion libs/range libs/intrusive
libs/atomic libs/lambda libs/mp11 libs/winapi libs/exception libs/unordered
# The tools required to build boost:
tools/auto_index tools/bcp tools/boost_install tools/boostbook tools/boostdep
tools/build tools/check_build tools/cmake tools/docca tools/inspect tools/litre tools/quickbook)
# download and compile boost libraries
ExternalProject_Add(boost
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/deps
GIT_REPOSITORY ${BOOST_GIT_REPOSITORY}
GIT_TAG ${BOOST_GIT_TAG}
GIT_SUBMODULES ${BOOST_GIT_SUBMODULES}
GIT_SUBMODULES_RECURSE true
GIT_SHALLOW true
SOURCE_DIR "boost"
BUILD_IN_SOURCE true
UPDATE_COMMAND ${BOOST_BOOTSTRAP_COMMAND}
CONFIGURE_COMMAND ./b2 headers
BUILD_COMMAND ${BOOST_BUILD_TOOL} stage
${BOOST_CXXFLAGS}
threading=multi
variant=release
link=static
-j${CORES}
INSTALL_COMMAND ""
# logging
LOG_CONFIGURE true
LOG_BUILD true
LOG_INSTALL true
)
ExternalProject_Get_Property(boost SOURCE_DIR)
set(BOOST_INCLUDE_DIR ${SOURCE_DIR})
set(BOOST_LIBRARY_PREFIX ${SOURCE_DIR}/stage/lib/${CMAKE_STATIC_LIBRARY_PREFIX})
# boost algorithm is a header only library, no need to add dependency
# add boost program_options library
add_library(Boost::program_options STATIC IMPORTED GLOBAL)
set_property(TARGET Boost::program_options PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${BOOST_INCLUDE_DIR})
set_property(TARGET Boost::program_options PROPERTY IMPORTED_LOCATION ${BOOST_LIBRARY_PREFIX}boost_program_options${CMAKE_STATIC_LIBRARY_SUFFIX})
add_dependencies(Boost::program_options boost)
# add boost regex library
add_library(Boost::regex STATIC IMPORTED GLOBAL)
set_property(TARGET Boost::regex PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${BOOST_INCLUDE_DIR})
set_property(TARGET Boost::regex PROPERTY IMPORTED_LOCATION ${BOOST_LIBRARY_PREFIX}boost_regex${CMAKE_STATIC_LIBRARY_SUFFIX})
add_dependencies(Boost::regex boost)
unset(SOURCE_DIR)
set(pixels_cli_cxx
main.cpp
lib/executor/LoadExecutor.cpp
lib/load/Parameters.cpp
lib/load/PixelsConsumer.cpp)
add_executable(pixels-cli ${pixels_cli_cxx})
include_directories(include)
include_directories(../pixels-core/include)
include_directories(../pixels-common/include)
target_link_libraries(pixels-cli
Boost::program_options Boost::regex duckdb pixels-core)