-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged development repository to public.
- Loading branch information
Will Sobel
committed
Aug 12, 2020
1 parent
7e006ac
commit e8f90e2
Showing
113 changed files
with
71,728 additions
and
2,626 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Checks: '-*,modernize-*,-modernize-avoid-c-arrays,-modernize-use-trailing-return-type,bugprone-*,-bugprone-unhandled-self-assignment,-bugprone-branch-clone' | ||
WarningsAsErrors: '*' | ||
HeaderFilterRegex: '/src/.*\.hpp$' | ||
AnalyzeTemporaryDtors: false | ||
FormatStyle: File | ||
CheckOptions: | ||
- key: modernize-use-default-member-init.UseAssignment | ||
value: 1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,20 @@ | ||
set(AGENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src) | ||
set(AGENT_SOURCES cppagent.cpp) | ||
|
||
if(WIN32) | ||
# Version info | ||
string(TIMESTAMP AGENT_VERSION_TIME "%Y-%m-%dT%H:%M:%SZ" UTC) | ||
set(RESOURCE_FILE "${PROJECT_BINARY_DIR}/agent/version.rc") | ||
configure_file("${AGENT_SOURCE_DIR}/version.rc.in" "${RESOURCE_FILE}") | ||
|
||
set(WINDOWS_LIBRARIES shlwapi) | ||
else() | ||
set(RESOURCE_FILE "") | ||
endif() | ||
|
||
if(UNIX AND NOT APPLE) | ||
set(LINUX_LIBRARIES pthread) | ||
configure_file("${CMAKE_CURRENT_LIST_DIR}/../src/version.rc.in" "${RESOURCE_FILE}") | ||
list(APPEND AGENT_SOURCES "${RESOURCE_FILE}") | ||
endif() | ||
|
||
file(GLOB AGENT_SRCS *.cpp) | ||
|
||
# Allow better viewing and grouping of files in Visual Studio by defining source groups | ||
source_group("Headers Files" FILES ${AGENT_HEADERS}) | ||
source_group("Source Files" FILES ${AGENT_SRCS}) | ||
source_group("Dlib Source Files" FILES ${DLIB_FIX_SRCS}) | ||
source_group("Resource Files" FILES ${RESOURCE_FILE}) | ||
|
||
add_executable(agent ${AGENT_SRCS} ${DLIB_FIX_SRCS} ${AGENT_HEADERS} ${RESOURCE_FILE}) | ||
|
||
AddMsvcXPSupport(agent) | ||
AddLibXML2Support(agent) | ||
AddDLibSupport(agent) | ||
AddDateSupport(agent) | ||
AddJsonSupport(agent) | ||
|
||
target_include_directories(agent PRIVATE "${AGENT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}/agent") | ||
target_link_libraries(agent PRIVATE agent_lib PRIVATE ${LINUX_LIBRARIES} ${WINDOWS_LIBRARIES}) | ||
|
||
if (MSVC) | ||
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}" "/DLIBXML_STATIC") | ||
endif() | ||
add_executable(agent ${AGENT_SOURCES}) | ||
target_link_libraries( | ||
agent | ||
PRIVATE | ||
agent_lib | ||
$<$<PLATFORM_ID:Windows>:shlwapi> | ||
) | ||
target_clangtidy_setup(agent_lib) | ||
|
||
install(TARGETS agent RUNTIME DESTINATION bin) | ||
add_dependencies(agent UPDATE_VERSION) | ||
|
||
target_compile_features(agent PRIVATE cxx_std_14) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,85 @@ | ||
set(AGENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src) | ||
set(AGENT_SOURCES | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/adapter.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/adapter.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/agent.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/agent.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/asset.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/asset.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/change_observer.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/change_observer.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/checkpoint.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/checkpoint.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/component_configuration.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/component.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/component.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/composition.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/config.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/config.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/connector.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/connector.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/coordinate_systems.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/cutting_tool.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/cutting_tool.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/data_item.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/data_item.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/definitions.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/device.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/device.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/globals.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/globals.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/json_printer.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/json_printer.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/observation.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/observation.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/options.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/options.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/printer.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/ref_counted.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/relationships.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/rolling_file_logger.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/rolling_file_logger.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/sensor_configuration.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/service.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/service.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/specifications.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/version.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/xml_parser.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/xml_parser.hpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/xml_printer.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../src/xml_printer.hpp" | ||
) | ||
|
||
if(UNIX AND NOT APPLE) | ||
set(LINUX_LIBRARIES pthread) | ||
endif() | ||
|
||
file(GLOB AGENT_SRCS "${AGENT_SOURCE_DIR}/*.cpp") | ||
file(GLOB AGENT_HEADERS "${AGENT_SOURCE_DIR}/*.hpp") | ||
|
||
# configure a header file to pass some of the CMake settings to the source code | ||
## configure a header file to pass some of the CMake settings to the source code | ||
add_custom_target(UPDATE_VERSION ALL | ||
COMMAND ${CMAKE_COMMAND} -E touch_nocreate "${AGENT_SOURCE_DIR}/version.cpp") | ||
|
||
configure_file("${AGENT_SOURCE_DIR}/version.h.in" "${PROJECT_BINARY_DIR}/agent_lib/version.h") | ||
|
||
# Allow better viewing and grouping of files in Visual Studio by defining source groups | ||
source_group("Headers Files" FILES ${AGENT_HEADERS}) | ||
source_group("Source Files" FILES ${AGENT_SRCS}) | ||
source_group("Dlib Source Files" FILES ${DLIB_FIX_SRCS}) | ||
|
||
add_library(agent_lib ${AGENT_SRCS} ${DLIB_FIX_SRCS} ${AGENT_HEADERS}) | ||
|
||
AddMsvcXPSupport(agent_lib) | ||
AddLibXML2Support(agent_lib) | ||
AddDLibSupport(agent_lib) | ||
AddDateSupport(agent_lib) | ||
AddJsonSupport(agent_lib) | ||
|
||
target_include_directories(agent_lib | ||
PRIVATE "${PROJECT_BINARY_DIR}/agent_lib" | ||
PUBLIC "${CMAKE_CURRENT_LIST_DIR}/../src") | ||
|
||
target_compile_definitions(agent_lib PRIVATE NOMINMAX) | ||
|
||
if (MSVC) | ||
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}" "/DLIBXML_STATIC") | ||
endif() | ||
COMMAND ${CMAKE_COMMAND} -E touch_nocreate "${CMAKE_CURRENT_SOURCE_DIR}/../src/version.cpp") | ||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../src/version.h.in" "${PROJECT_BINARY_DIR}/agent_lib/version.h") | ||
|
||
add_library(agent_lib STATIC ${AGENT_SOURCES}) | ||
add_dependencies(agent_lib UPDATE_VERSION) | ||
target_include_directories( | ||
agent_lib | ||
PUBLIC | ||
"${PROJECT_BINARY_DIR}/agent_lib" | ||
"${CMAKE_CURRENT_LIST_DIR}/../src" | ||
) | ||
target_link_libraries( | ||
agent_lib | ||
PUBLIC | ||
dlib::dlib | ||
date | ||
json | ||
LibXml2::LibXml2 | ||
$<$<PLATFORM_ID:Linux>:pthread> | ||
) | ||
target_compile_definitions( | ||
agent_lib | ||
PUBLIC | ||
$<$<PLATFORM_ID:Windows>:NOMINMAX> | ||
$<$<PLATFORM_ID:Windows>:WINVER=${WINVER}> | ||
$<$<PLATFORM_ID:Windows>:_WIN32_WINNT=${WINVER}> | ||
) | ||
|
||
target_compile_features(agent_lib PRIVATE cxx_std_14) | ||
|
||
# set_property(SOURCE ${AGENT_SOURCES} PROPERTY COMPILE_FLAGS_DEBUG "${COVERAGE_FLAGS}") | ||
target_compile_features(agent_lib PUBLIC cxx_std_14) | ||
target_clangformat_setup(agent_lib) | ||
target_clangtidy_setup(agent_lib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
include_guard() | ||
|
||
option(AGENT_ENABLE_CLANGTIDY "Runs clang-tidy on all source files" OFF) | ||
|
||
find_program( | ||
CLANG_TIDY_EXECUTABLE | ||
NAMES clang-tidy-10 clang-tidy-9 clang-tidy-8 clang-tidy-7 clang-tidy-6.0 clang-tidy-5.0 clang-tidy-4.0 clang-tidy | ||
DOC "Path to clang-tidy executable" | ||
) | ||
|
||
function(target_clangtidy_setup _target) | ||
if(AGENT_ENABLE_CLANGTIDY) | ||
if(CLANG_TIDY_EXECUTABLE) | ||
set_target_properties( | ||
${_target} PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE}" | ||
) | ||
else() | ||
message(FATAL_ERROR "Could not find clang-tidy") | ||
endif() | ||
endif() | ||
endfunction() |
Oops, something went wrong.