Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
boolinq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
boolinq
Commits
cfc682ae
Commit
cfc682ae
authored
Feb 02, 2014
by
Gluttton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic CMake support.
parent
d958ab34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
0 deletions
+122
-0
CMakeLists.txt
CMakeLists.txt
+38
-0
CMakeLists.txt
boolinq/CMakeLists.txt
+84
-0
No files found.
CMakeLists.txt
0 → 100644
View file @
cfc682ae
# Common variables.
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
)
PROJECT
(
boolinq
)
SET
(
boolinq_VERSION_MAJOR 2
)
SET
(
boolinq_VERSION_MINOR 0
)
SET
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS
}
-O0 -ggdb3 -DDEBUG"
)
SET
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS
}
-O3"
)
INCLUDE_DIRECTORIES
(
${
PROJECT_SOURCE_DIR
}
)
INCLUDE_DIRECTORIES
(
${
PROJECT_SOURCE_DIR
}
/benchmark/include
)
# Boolinq source code.
SET
(
Boolinq_INCLUDES
${
PROJECT_SOURCE_DIR
}
/boolinq/boolinq.h
)
# Static code analyse.
SET
(
CppCheck_REPORT
${
PROJECT_BINARY_DIR
}
/cppcheck.report
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
CppCheck_REPORT
}
COMMAND cppcheck
${
Boolinq_INCLUDES
}
--enable=all --force --inconclusive &>cppcheck.report
)
ADD_CUSTOM_TARGET
(
cppcheck DEPENDS
${
CppCheck_REPORT
}
)
SET_DIRECTORY_PROPERTIES
(
PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
${
CppCheck_REPORT
}
)
# Testing (available only if appropriate tools are exist).
FIND_PACKAGE
(
GTest
)
# FIXME: I have no idea why this condition doesn't work!?
#IF (GTest_FOUND)
ADD_SUBDIRECTORY
(
boolinq
)
ADD_SUBDIRECTORY
(
benchmark
)
ADD_DEPENDENCIES
(
boolinqbenchmark benchmark
)
#ENDIF ()
boolinq/CMakeLists.txt
0 → 100644
View file @
cfc682ae
# Common variables.
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++11"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall -Wextra -Wmissing-include-dirs -Wundef -Wfloat-equal -Wshadow -Wunsafe-loop-optimizations"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wdouble-promotion -Winit-self -Wvector-operation-performance -Wnoexcept -Weffc++ -Wstrict-null-sentinel"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Woverloaded-virtual -Wsign-promo"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wvla -Winvalid-pch -Winline -Wredundant-decls"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wlogical-op -Wcast-align"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wcast-qual -Wpointer-arith -Wtrampolines"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wold-style-cast"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wzero-as-null-pointer-constant"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fprofile-arcs -ftest-coverage"
)
SET
(
CMAKE_SHARED_LINKER_FLAGS
"-fprofile-arcs -ftest-coverage"
)
# Unit tests.
SET
(
BoolinqTest_SOURCES
${
PROJECT_SOURCE_DIR
}
/boolinq/AllTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/AnyTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/AvgTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/BitsRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/BytesRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/ConcatRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/ContainsTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/CountTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/DistinctRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/DotCallTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/ElementAtTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/ForeachTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/GroupByRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/IterRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/LinqTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/MaxTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/MinTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/OrderByRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/ReverseRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/SelectRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/SkipRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/SkipWhileRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/SumTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/TakeRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/TakeWhileRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/ToDequeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/ToListTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/ToSetTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/ToVectorTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/UnbitsRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/UnbytesRangeTest.cpp
${
PROJECT_SOURCE_DIR
}
/boolinq/WhereRangeTest.cpp
)
ADD_EXECUTABLE
(
boolinqtest
${
BoolinqTest_SOURCES
}
)
TARGET_LINK_LIBRARIES
(
boolinqtest gtest gtest_main gcov pthread
)
ENABLE_TESTING
()
ADD_TEST
(
BoolinqTest boolinqtest
)
# Test coverage report.
SET
(
Coverage_REPORT
${
PROJECT_BINARY_DIR
}
/coverage.info
)
SET
(
Coverage_DIR
${
PROJECT_BINARY_DIR
}
/coverage
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
Coverage_REPORT
}
COMMAND lcov -q -c -f -b . -d
${
PROJECT_BINARY_DIR
}
/boolinq -o
${
Coverage_REPORT
}
COMMAND lcov -e
${
Coverage_REPORT
}
'
${
PROJECT_SOURCE_DIR
}
/boolinq/*' -o
${
Coverage_REPORT
}
COMMAND genhtml
${
Coverage_REPORT
}
--legend --demangle-cpp -f -q -o
${
Coverage_DIR
}
DEPENDS boolinqtest
)
ADD_CUSTOM_TARGET
(
coverage DEPENDS
${
Coverage_REPORT
}
)
# FIXME: Doesn't work correctly (require explicit call cmake when files appear).
FILE
(
GLOB_RECURSE Coverage_GCNO
${
PROJECT_BINARY_DIR
}
/*.gcno
)
FILE
(
GLOB_RECURSE Coverage_GCDA
${
PROJECT_BINARY_DIR
}
/*.gcda
)
LIST
(
APPEND Coverage_DATA
"
${
Coverage_REPORT
}
"
)
LIST
(
APPEND Coverage_DATA
"
${
Coverage_DIR
}
"
)
LIST
(
APPEND Coverage_DATA
"
${
Coverage_GCNO
}
"
)
LIST
(
APPEND Coverage_DATA
"
${
Coverage_GCDA
}
"
)
SET_DIRECTORY_PROPERTIES
(
PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"
${
Coverage_DATA
}
"
)
# Benchmarks.
SET
(
BoolinqBenchmark_SOURCES
${
PROJECT_SOURCE_DIR
}
/boolinq/SpeedTest.cpp
)
ADD_EXECUTABLE
(
boolinqbenchmark
${
BoolinqBenchmark_SOURCES
}
)
TARGET_LINK_LIBRARIES
(
boolinqbenchmark gtest pthread benchmark
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment