cmake rebuild
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
BasedOnStyle: LLVM
|
||||||
|
AccessModifierOffset: '-4'
|
||||||
|
AlignAfterOpenBracket: Align
|
||||||
|
AlignConsecutiveAssignments: 'true'
|
||||||
|
AlignConsecutiveDeclarations: 'true'
|
||||||
|
AlignEscapedNewlines: Left
|
||||||
|
AlignOperands: 'true'
|
||||||
|
AlignTrailingComments: 'true'
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: 'true'
|
||||||
|
AllowShortBlocksOnASingleLine: 'false'
|
||||||
|
AllowShortCaseLabelsOnASingleLine: 'true'
|
||||||
|
AllowShortFunctionsOnASingleLine: All
|
||||||
|
AllowShortIfStatementsOnASingleLine: 'true'
|
||||||
|
AllowShortLoopsOnASingleLine: 'true'
|
||||||
|
AlwaysBreakTemplateDeclarations: 'true'
|
||||||
|
BinPackArguments: 'true'
|
||||||
|
BinPackParameters: 'false'
|
||||||
|
BreakBeforeBraces: Linux
|
||||||
|
BreakBeforeInheritanceComma: 'true'
|
||||||
|
BreakBeforeTernaryOperators: 'true'
|
||||||
|
BreakConstructorInitializers: BeforeComma
|
||||||
|
ColumnLimit: '120'
|
||||||
|
CompactNamespaces: 'false'
|
||||||
|
Cpp11BracedListStyle: 'true'
|
||||||
|
FixNamespaceComments: 'true'
|
||||||
|
IncludeBlocks: Regroup
|
||||||
|
IndentPPDirectives: AfterHash
|
||||||
|
IndentWidth: '4'
|
||||||
|
Language: Cpp
|
||||||
|
MaxEmptyLinesToKeep: '1'
|
||||||
|
SortIncludes: 'true'
|
||||||
|
SortUsingDeclarations: 'true'
|
||||||
|
SpaceAfterTemplateKeyword: 'true'
|
||||||
|
SpaceBeforeAssignmentOperators: 'true'
|
||||||
|
SpaceBeforeParens: Never
|
||||||
|
SpaceInEmptyParentheses: 'false'
|
||||||
|
SpacesInAngles: 'true'
|
||||||
|
SpacesInContainerLiterals: 'false'
|
||||||
|
SpacesInParentheses: 'true'
|
||||||
|
Standard: Cpp11
|
||||||
|
TabWidth: '4'
|
||||||
|
UseTab: Never
|
||||||
+22
-7
@@ -1,13 +1,28 @@
|
|||||||
project( torrentLib )
|
project( torrent )
|
||||||
cmake_minimum_required( VERSION 3.0 )
|
cmake_minimum_required( VERSION 3.0 )
|
||||||
|
|
||||||
set (CMAKE_CXX_STANDARD 11)
|
|
||||||
|
|
||||||
file ( GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp )
|
option( BUILD_TESTS "Build ${PROJECT_NAME} tests" OFF )
|
||||||
file ( GLOB_RECURSE MOC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp )
|
|
||||||
|
|
||||||
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include )
|
set( ${PROJECT_NAME}_private_headers ${CMAKE_CURRENT_SOURCE_DIR}/src/include )
|
||||||
|
file( GLOB_RECURSE ${PROJECT_NAME}_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp )
|
||||||
add_executable( ${PROJECT_NAME} ${SOURCES} ${MOC_HEADERS})
|
|
||||||
|
|
||||||
|
|
||||||
|
add_library( ${PROJECT_NAME} ${${PROJECT_NAME}_sources} )
|
||||||
|
target_include_directories( ${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
|
PRIVATE ${${PROJECT_NAME}_private_headers} )
|
||||||
|
|
||||||
|
|
||||||
|
set_target_properties( ${PROJECT_NAME} PROPERTIES
|
||||||
|
CXX_STANDARD 17
|
||||||
|
CXX_STANDARD_REQUIRED YES )
|
||||||
|
|
||||||
|
|
||||||
|
if( BUILD_TESTS )
|
||||||
|
file( GLOB_RECURSE ${PROJECT_NAME}_test_sources ${CMAKE_CURRENT_SOURCE_DIR}/example/*.* )
|
||||||
|
add_executable( ${PROJECT_NAME}_tests ${${PROJECT_NAME}_test_sources} )
|
||||||
|
target_include_directories( ${PROJECT_NAME}_tests PRIVATE ${${PROJECT_NAME}_private_headers} )# Enable C++17
|
||||||
|
set_target_properties( ${PROJECT_NAME}_tests PROPERTIES
|
||||||
|
CXX_STANDARD 17
|
||||||
|
CXX_STANDARD_REQUIRED YES )
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::cout << "test";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
std::cout << "test";
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user