Skip to content

Commit

Permalink
Merge pull request #4 from frankkopp/dev_v0.2
Browse files Browse the repository at this point in the history
finalize Dev v0.2
  • Loading branch information
frankkopp authored Jul 16, 2020
2 parents 2b709c0 + 56bcfd2 commit 7c9ec60
Show file tree
Hide file tree
Showing 123 changed files with 3,315,921 additions and 515 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ cmake-build-release/
cmake-build-relwithdebinfo/
cmake-build-minsizerel/
cmake-build-default/
build/
.idea/
.vscode/
*.cache.*
/Release/bin/books/
/Release/bin/config/
8 changes: 8 additions & 0 deletions .run/FrankyCPP_v0.2_Test SHORT.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="FrankyCPP_v0.2_Test SHORT" type="CMakeGoogleTestRunConfigurationType" factoryName="Google Test" REDIRECT_INPUT="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="FrankyCPP" TARGET_NAME="FrankyCPP_v0.2_Test" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="FrankyCPP" RUN_TARGET_NAME="FrankyCPP_v0.2_Test" TEST_PATTERN="-*SpeedTests.*" TEST_MODE="PATTERN">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
<option name="BeforeTestRunTask" enabled="true" />
</method>
</configuration>
</component>
29 changes: 29 additions & 0 deletions .travis.linux_gcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: cpp
compiler: gcc

os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- cmake

before_install:
- sudo apt purge cmake
- wget https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3.tar.gz
- tar -zxf cmake-3.17.3.tar.gz
- cd cmake-3.17.3
- sudo ./bootstrap
- sudo make
- sudo make install
- cmake --version

script:
- export CC=gcc-7
- export CXX=g++-7
- cmake --version
- cmake CMakeLists.txt
- cmake --build .

13 changes: 13 additions & 0 deletions .travis.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
os: windows
language: cpp
compiler: cpp

addons:
apt:
sources:
packages:
- cmake

before_install:
- cmake --version

98 changes: 59 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ message("====================================================================")
cmake_minimum_required(VERSION 3.13)

# Project name and version
project(FrankyCPP VERSION 0.1)
project(FrankyCPP VERSION 0.2)
message("FrankyCPP v" ${PROJECT_VERSION_MAJOR} "." ${PROJECT_VERSION_MINOR})

# updates template file and replaces placeholder variables
Expand All @@ -16,6 +16,8 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
# C++ settings
set(CMAKE_CXX_STANDARD 17)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Unit testing enabled
enable_testing()

Expand All @@ -25,46 +27,55 @@ message("Recognized platform is " ${CMAKE_SYSTEM_NAME} " " ${CMAKE_SYSTEM_VERSIO
# Compiler Settings
message("Compiler is " ${CMAKE_CXX_COMPILER_ID} " " ${CMAKE_CXX_COMPILER_VERSION} " " ${CMAKE_CXX_COMPILER})

if (CMAKE_CXX_COMPILER_ID EQUAL "Clang")
message("Compiler Settings: Clang")
set(CMAKE_CXX_FLAGS "-std=c++17 -Wall -Wextra")
if (CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
message("Compiler Settings: AppleClang")
set(CMAKE_CXX_FLAGS "-std=c++17 -Wall -Wextra -mpopcnt -mbmi2")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -fprofile-instr-generate -fcoverage-mapping -Wpedantic -Wshadow -Wno-conversion -Wunreachable-code -Wuninitialized -Wold-style-cast -Wunused-variable -Wfloat-equal -Wno-gnu-zero-variadic-macro-arguments")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9")
message("Using HAS_EXECUTION_LIB")
add_compile_definitions(HAS_EXECUTION_LIB)
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11")
# message("Using HAS_EXECUTION_LIB")
# add_compile_definitions(HAS_EXECUTION_LIB)
message("Using HAS_PEXT")
add_compile_definitions(HAS_PEXT)
endif ()

elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
message("Compiler Settings: AppleClang")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message("Compiler Settings: Clang")
set(CMAKE_CXX_FLAGS "-std=c++17 -Wall -Wextra -mpopcnt -mbmi2")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -fprofile-instr-generate -fcoverage-mapping -Wpedantic -Wshadow -Wno-conversion -Wunreachable-code -Wuninitialized -Wold-style-cast -Wunused-variable -Wfloat-equal -Wno-gnu-zero-variadic-macro-arguments")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11")
# message("Using HAS_EXECUTION_LIB")
# add_compile_definitions(HAS_EXECUTION_LIB)
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9")
message("Using HAS_EXECUTION_LIB")
add_compile_definitions(HAS_EXECUTION_LIB)
message("Using HAS_PEXT")
add_compile_definitions(HAS_PEXT)
endif ()

elseif (CMAKE_COMPILER_IS_GNUCXX)
message("Compiler Settings: GNU")
set(CMAKE_CXX_FLAGS "-std=c++17 -m64 -Wall -Wextra -Wpedantic -Wno-error=pedantic -Wshadow -Wno-unknown-pragmas -Wno-variadic-macros")
set(CMAKE_CXX_FLAGS "-std=c++17 -m64 -mpopcnt -mbmi2 -Wall -Wextra -Wpedantic -Wno-error=pedantic -Wshadow -Wno-unknown-pragmas -Wno-variadic-macros")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 --coverage -Wno-unused-parameter -Wno-unused-variable")
# additional: -Wno-unknown-pragmas -Weffc++ -Wimplicit-fallthrough -Wswitch -Wpointer-arith -Wcast-qual -Wconversion -Wno-sign-conversion -Wno-error=padded -Wno-error=inline")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.2")
#message("Using HAS_EXECUTION_LIB")
#add_compile_definitions(HAS_EXECUTION_LIB)
endif()
message("Using HAS_PEXT")
add_compile_definitions(HAS_PEXT)
endif ()

elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
message("Compiler Settings: MSVC")
set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W4 /GR /EHsc /std:c++17 /wd4127")
set(CMAKE_CXX_FLAGS_DEBUG " /MDd /Zi /Ob0 /Od /RTC1 /showIncludes")
set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W4 /GR /EHsc /std:c++17 /wd4127 /arch:AVX2 /MP")
set(CMAKE_CXX_FLAGS_DEBUG " /MDd /Zi /Ob0 /Od /RTC1")
# /showIncludes
set(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /Ob2 /DNDEBUG")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.24")
message("Using HAS_EXECUTION_LIB")
add_compile_definitions(HAS_EXECUTION_LIB)
endif()
message("Using HAS_PEXT")
add_compile_definitions(HAS_PEXT)
endif ()
endif ()

message("Compiler flags: " ${CMAKE_CXX_FLAGS})
Expand All @@ -74,13 +85,13 @@ message("EXEC: " ${CMAKE_CXX_LINK_EXECUTABLE})

# For downloading with GIT
message("Finding GIT...")
set(GIT_EXECUTABLE )
set(GIT_EXECUTABLE)
find_package(Git)
if (GIT_FOUND)
message("git found: ${GIT_EXECUTABLE}")
elseif ()
message("git NOT found:")
endif()
endif ()

set(FETCHCONTENT_QUIET OFF)
set(FETCHCONTENT_UPDATES_DISCONNECTED ON)
Expand All @@ -89,21 +100,21 @@ set(FETCHCONTENT_UPDATES_DISCONNECTED ON)
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
)
message("Downloading/Update Google Test")
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
if (NOT googletest_POPULATED)
# Fetch the content using previously declared details
FetchContent_Populate(googletest)
# Set custom variables, policies, etc.
option(INSTALL_GMOCK "Install Googletest's GMock?" OFF)
option(INSTALL_GTEST "Install Googletest's GTest?" OFF)
# Bring the populated content into the build
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endif ()

FetchContent_MakeAvailable(googletest)
include_directories(
Expand All @@ -115,7 +126,7 @@ include(FetchContent)
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 6.1.2
GIT_TAG 6.1.2
)
message("Downloading/Update FMT")
FetchContent_MakeAvailable(fmt)
Expand All @@ -128,7 +139,7 @@ include(FetchContent)
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.5.0
GIT_TAG v1.7.0
)
message("Downloading/Update SPDLOG")
option(SPDLOG_FMT_EXTERNAL ON)
Expand All @@ -138,26 +149,35 @@ include_directories(
)

# BOOST
if (APPLE OR CYGWIN)
if (APPLE)
message("Find Boost on Apple")
set(BOOST_ROOT "/usr/local/boost_1_73_0")
set(Boost_INCLUDE_DIR "/usr/local/boost_1_73_0")
elseif (CYGWIN)
message("Find Boost on Cygwin")
set(BOOST_ROOT "/usr/local/boost_1_72_0")
set(Boost_INCLUDE_DIR "/usr/local/boost_1_72_0")
elseif (WIN32)
message("Find Boost on Win32")
set(BOOST_ROOT "C:/Boost")
set(BOOST_INCLUDEDIR "C:/Boost/include/boost-1_73")
set(BOOST_LIBRARYDIR "C:/Boost/lib")
else ()
message("Find Boost on other")
set(BOOST_ROOT "/usr/local/boost_1_73_0")
set(Boost_INCLUDE_DIR "/usr/local/boost_1_73_0")
endif ()
if (WIN32)
set(BOOST_ROOT "C:/Boost/boost_1_72_0")
set(BOOST_INCLUDEDIR "C:/Boost/boost_1_72_0")
set(BOOST_LIBRARYDIR "C:/Boost/boost_1_72_0/lib64-msvc-14.2")
endif ()
set (Boost_DEBUG FALSE)
set (Boost_USE_MULTITHREADED TRUE)
set (Boost_USE_STATIC_LIBS TRUE)
set (Boost_USE_STATIC_RUNTIME FALSE)
set(Boost_DEBUG FALSE)
set(Boost_USE_MULTITHREADED TRUE)
set(Boost_USE_STATIC_LIBS TRUE)
set(Boost_USE_STATIC_RUNTIME FALSE)
find_package(Boost 1.72.0 COMPONENTS serialization program_options timer log log_setup REQUIRED)
if (Boost_FOUND)
message("BOOST found: " ${BOOST_ROOT} " " ${Boost_INCLUDE_DIR})
include_directories(${Boost_INCLUDE_DIRS})
endif ()
set (BOOST_ALL_NO_LIB 0)
set (BOOST_LIB_DIAGNOSTIC 1)
set(BOOST_ALL_NO_LIB 0)
set(BOOST_LIB_DIAGNOSTIC 1)

# My project
include_directories(
Expand Down
Loading

0 comments on commit 7c9ec60

Please sign in to comment.