initial commit for new repo
This commit is contained in:
58
dev/conan-project/.clang-format
Normal file
58
dev/conan-project/.clang-format
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: 'true'
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: 'true'
|
||||
AlignTrailingComments: 'true'
|
||||
AllowAllParametersOfDeclarationOnNextLine: 'true'
|
||||
AllowShortBlocksOnASingleLine: 'true'
|
||||
AllowShortCaseLabelsOnASingleLine: 'true'
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AllowShortIfStatementsOnASingleLine: 'false'
|
||||
AllowShortLoopsOnASingleLine: 'false'
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: 'false'
|
||||
AlwaysBreakTemplateDeclarations: 'true'
|
||||
BinPackArguments: 'true'
|
||||
BinPackParameters: 'true'
|
||||
BreakAfterJavaFieldAnnotations: 'true'
|
||||
BreakBeforeBinaryOperators: All
|
||||
BreakBeforeBraces: Linux
|
||||
BreakBeforeInheritanceComma: 'false'
|
||||
BreakBeforeTernaryOperators: 'true'
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakStringLiterals: 'true'
|
||||
ColumnLimit: '80'
|
||||
CompactNamespaces: 'false'
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: 'false'
|
||||
Cpp11BracedListStyle: 'true'
|
||||
FixNamespaceComments: 'true'
|
||||
IncludeBlocks: Regroup
|
||||
IndentCaseLabels: 'false'
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWrappedFunctionNames: 'false'
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: 'true'
|
||||
KeepEmptyLinesAtTheStartOfBlocks: 'false'
|
||||
Language: Cpp
|
||||
MaxEmptyLinesToKeep: '1'
|
||||
NamespaceIndentation: Inner
|
||||
PointerAlignment: Right
|
||||
ReflowComments: 'true'
|
||||
SortIncludes: 'true'
|
||||
SortUsingDeclarations: 'true'
|
||||
SpaceAfterCStyleCast: 'false'
|
||||
SpaceAfterTemplateKeyword: 'false'
|
||||
SpaceBeforeAssignmentOperators: 'true'
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: 'false'
|
||||
SpacesBeforeTrailingComments: '2'
|
||||
SpacesInAngles: 'false'
|
||||
SpacesInCStyleCastParentheses: 'false'
|
||||
SpacesInContainerLiterals: 'false'
|
||||
SpacesInParentheses: 'false'
|
||||
SpacesInSquareBrackets: 'false'
|
||||
Standard: Cpp11
|
||||
UseTab: ForIndentation
|
||||
|
||||
...
|
||||
179
dev/conan-project/.gitignore
vendored
Normal file
179
dev/conan-project/.gitignore
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
# Created by https://www.gitignore.io/api/c,c++,ninja,macos,linux,cmake,windows,visualstudiocode
|
||||
# Edit at https://www.gitignore.io/?templates=c,c++,ninja,macos,linux,cmake,windows,visualstudiocode
|
||||
|
||||
### C ###
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
*.obj
|
||||
*.elf
|
||||
|
||||
# Linker output
|
||||
*.ilk
|
||||
*.map
|
||||
*.exp
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.i*86
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
# Debug files
|
||||
*.dSYM/
|
||||
*.su
|
||||
*.idb
|
||||
*.pdb
|
||||
|
||||
# Kernel Module Compile Results
|
||||
*.mod*
|
||||
*.cmd
|
||||
.tmp_versions/
|
||||
modules.order
|
||||
Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
### C++ ###
|
||||
# Prerequisites
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
|
||||
# Precompiled Headers
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
*.smod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
|
||||
# Executables
|
||||
|
||||
### CMake ###
|
||||
CMakeLists.txt.user
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
CMakeScripts
|
||||
Testing
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
install_manifest.txt
|
||||
compile_commands.json
|
||||
CTestTestfile.cmake
|
||||
_deps
|
||||
|
||||
### CMake Patch ###
|
||||
# External projects
|
||||
*-prefix/
|
||||
|
||||
### Linux ###
|
||||
*~
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
### macOS ###
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
### Ninja ###
|
||||
.ninja_deps
|
||||
.ninja_log
|
||||
|
||||
### VisualStudioCode ###
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
### VisualStudioCode Patch ###
|
||||
# Ignore all local history of files
|
||||
.history
|
||||
|
||||
### Windows ###
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# End of https://www.gitignore.io/api/c,c++,ninja,macos,linux,cmake,windows,visualstudiocode
|
||||
|
||||
build
|
||||
56
dev/conan-project/CMakeLists.txt
Normal file
56
dev/conan-project/CMakeLists.txt
Normal file
@@ -0,0 +1,56 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
project("PROJECTNAME"
|
||||
VERSION 0.1
|
||||
DESCRIPTION "Description of PROJECTNAME"
|
||||
HOMEPAGE_URL "https://labs.phundrak.fr/phundrak/PROJECTNAME"
|
||||
LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_COMPILER /usr/bin/clang++)
|
||||
file(GLOB SRC_FILES "src/*.cc")
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
|
||||
include(functions)
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
|
||||
enable_cxx_compiler_flag_if_supported("-Wall")
|
||||
enable_cxx_compiler_flag_if_supported("-pedantic")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
enable_cxx_compiler_flag_if_supported("-g")
|
||||
else()
|
||||
enable_cxx_compiler_flag_if_supported("-O3")
|
||||
enable_cxx_compiler_flag_if_supported("-flto")
|
||||
endif()
|
||||
|
||||
# include_directories(<PUBLIC HEADER DIRECTORIES>)
|
||||
|
||||
# Main software
|
||||
set(TGT PROJECTNAME)
|
||||
add_executable(${TGT} ${SRC_FILES})
|
||||
target_compile_features(${TGT} PRIVATE cxx_std_17)
|
||||
target_include_directories(${TGT} PRIVATE include/PROJECTNAME)
|
||||
target_link_libraries(${TGT} ${CONAN_LIBS})
|
||||
|
||||
# Tests, -DTESTS=True to activate
|
||||
if(TESTS)
|
||||
set(TESTTGT PROJECTNAME-tests)
|
||||
file(GLOB TEST_FILES "tests/tests.cc")
|
||||
add_executable(${TESTTGT} ${TEST_FILES})
|
||||
target_compile_features(${TESTTGT} PRIVATE cxx_std_17)
|
||||
target_include_directories(${TESTTGT} PRIVATE include/PROJECTNAME)
|
||||
target_link_libraries(${TESTTGT} ${CONAN_LIBS})
|
||||
endif()
|
||||
|
||||
# OS specific instructions.
|
||||
if(APPLE)
|
||||
elseif(WIN32)
|
||||
# Windows developer environment specific instructions.
|
||||
if(MINGW)
|
||||
elseif(MSYS)
|
||||
elseif(CYGWIN)
|
||||
endif()
|
||||
elseif(UNIX)
|
||||
else()
|
||||
endif()
|
||||
21
dev/conan-project/LICENSE
Normal file
21
dev/conan-project/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Jinsoo Heo
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
60
dev/conan-project/README.org
Normal file
60
dev/conan-project/README.org
Normal file
@@ -0,0 +1,60 @@
|
||||
[[http://spacemacs.org][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]]
|
||||
|
||||
* PROJECTNAME
|
||||
|
||||
PROJECTNAME is a C++17 project written for and built with CMake and Ninja.
|
||||
|
||||
* How to build PROJECTNAME
|
||||
|
||||
You will ned to have Ninja and Conan installed. To install Ninja, install the
|
||||
appropriate package offered by your package manager (~ninja-build~ on Debian,
|
||||
~ninja~ on Arch Linux and Void Linux), and to install conan, use ~pip~.
|
||||
#+begin_src shell
|
||||
pip install --user conan
|
||||
#+end_src
|
||||
|
||||
This project is built with conan, ninja and cmake using clang-7 for C++17. To
|
||||
use it, first install clang-7 and lldb 7, then run this:
|
||||
#+begin_src shell
|
||||
conan profile new default --detect
|
||||
conan profile update settings.compiler=clang default
|
||||
conan profile update settings.compiler.version=7.0 default
|
||||
conan profile update settings.compiler.libcxx=libstdc++11 default
|
||||
conan profile update env.CC=/bin/clang default
|
||||
conan profile update env.CXX=/bin/clang++ default
|
||||
#+end_src
|
||||
If you do not wish to overwrite your ~default~ profile, you can instead create a
|
||||
new one, for instance ~clang~. To do so, write the name of your new profile (in
|
||||
this example ~clang~) instead of ~default~ in the commands shown above.
|
||||
|
||||
Then, To build and run the program, go to the root of the project and run this:
|
||||
#+begin_src shell
|
||||
mkdir build && cd build
|
||||
conan install .. --build missing
|
||||
cmake -DCMAKE_CXX_COMPILER=clang++ .. -G Ninja
|
||||
cmake --build .
|
||||
#+end_src
|
||||
If you want to use another profile than your default one, you should run the
|
||||
following line instead of the second line:
|
||||
#+begin_src shell
|
||||
conan install .. --build missing --profile <your_profile>
|
||||
#+end_src
|
||||
If you wish to build the project’s tests in addition to the project itself, you
|
||||
can add the option ~-DTESTS=True~ to the first ~cmake~ command to build the
|
||||
project’s tests too.
|
||||
#+begin_src shell
|
||||
cmake -DCMAKE_CXX_COMPILER=clang++ -DTESTS=True .. -G Ninja
|
||||
#+end_src
|
||||
|
||||
If you do not wish to build your project with Ninja but with another generator,
|
||||
such as Unix Makefiles, simply replace ~Ninja~ in the second to last ~cmake~
|
||||
command with the name of your generator. For instance:
|
||||
#+begin_src shell
|
||||
cmake -DCMAKE_CXX_COMPILER=clang++ .. -G "Unix Makefiles"
|
||||
#+end_src
|
||||
You can still build your project by running ~cmake --build .~ or by running
|
||||
~make~ manually.
|
||||
|
||||
* Credits
|
||||
|
||||
Awesome C++ Template by [[https://github.com/devkoriel/AwesomeCppTemplate][devkoriel]].
|
||||
12
dev/conan-project/cmake/functions.cmake
Normal file
12
dev/conan-project/cmake/functions.cmake
Normal file
@@ -0,0 +1,12 @@
|
||||
INCLUDE(CheckCXXCompilerFlag)
|
||||
|
||||
function(enable_cxx_compiler_flag_if_supported flag)
|
||||
string(FIND "${CMAKE_CXX_FLAGS}" "${flag}" flag_already_set)
|
||||
if(flag_already_set EQUAL -1)
|
||||
check_cxx_compiler_flag("${flag}" flag_supported)
|
||||
if(flag_supported)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE)
|
||||
endif()
|
||||
unset(flag_supported CACHE)
|
||||
endif()
|
||||
endfunction()
|
||||
16
dev/conan-project/conanfile.py
Normal file
16
dev/conan-project/conanfile.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from conans import ConanFile, CMake
|
||||
|
||||
|
||||
class PROJECTNAMEConan(ConanFile):
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
requires = "gtest/1.8.1@bincrafters/stable"
|
||||
generators = "cmake", "gcc", "txt"
|
||||
|
||||
def imports(self):
|
||||
self.copy("*.dll", dst="bin", src="bin") # From bin to bin
|
||||
self.copy("*.dylib*", dst="bin", src="lib") # From lib to bin
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
2495
dev/conan-project/doc/Doxyfile
Executable file
2495
dev/conan-project/doc/Doxyfile
Executable file
File diff suppressed because it is too large
Load Diff
6
dev/conan-project/src/main.cc
Normal file
6
dev/conan-project/src/main.cc
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
std::cout << "Hello World!" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
16
dev/conan-project/src/main.cpp
Normal file
16
dev/conan-project/src/main.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "Poco/MD5Engine.h"
|
||||
#include "Poco/DigestStream.h"
|
||||
|
||||
#include "class.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Poco::MD5Engine md5;
|
||||
Poco::DigestOutputStream ds(md5);
|
||||
ds << "abcdefghijklmnopqrstuvwxyz";
|
||||
ds.close();
|
||||
std::cout << Poco::DigestEngine::digestToHex(md5.digest()) << std::endl;
|
||||
return 0;
|
||||
}
|
||||
16
dev/conan-project/tests/tests.cc
Normal file
16
dev/conan-project/tests/tests.cc
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(SquareRootTest, PositiveNos) {
|
||||
ASSERT_EQ(6, 2 * 3);
|
||||
ASSERT_EQ(6, -2 * -3);
|
||||
}
|
||||
|
||||
TEST(SquareRootTest, NegativeNos) {
|
||||
ASSERT_EQ(-6, -2 * 3);
|
||||
ASSERT_EQ(-6, 2 * -3);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
Reference in New Issue
Block a user