Modernize codebase

- Enhance CMakeLists.txt files.
- Move to Boost Test from Google Test to support pre-C++11 compilers.
- Add more configurations on CI matrix builds.
- Other minor fixes
This commit is contained in:
Daniil Kovalev
2021-07-01 11:17:20 -04:00
committed by GitHub
parent 0af15e45de
commit 7b7615a6d9
80 changed files with 3451 additions and 3799 deletions

View File

@@ -1,3 +1,7 @@
FIND_PACKAGE (Threads REQUIRED)
FIND_PACKAGE (Boost COMPONENTS timer)
LIST (APPEND exec_PROGRAMS
class_intrusive.cpp
class_intrusive_map.cpp
@@ -35,9 +39,8 @@ FOREACH (source_file ${exec_PROGRAMS})
${source_file_we}
${source_file}
)
TARGET_INCLUDE_DIRECTORIES (${source_file_we}
PRIVATE
$<TARGET_PROPERTY:msgpackcxx,INTERFACE_INCLUDE_DIRECTORIES>
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
msgpackc-cxx
)
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
@@ -57,12 +60,9 @@ FOREACH (source_file ${with_pthread_PROGRAMS})
${source_file_we}
${source_file}
)
TARGET_INCLUDE_DIRECTORIES (${source_file_we}
PRIVATE
$<TARGET_PROPERTY:msgpackcxx,INTERFACE_INCLUDE_DIRECTORIES>
)
TARGET_LINK_LIBRARIES (${source_file_we}
${CMAKE_THREAD_LIBS_INIT}
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
msgpackc-cxx
Threads::Threads
)
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
@@ -77,27 +77,17 @@ FOREACH (source_file ${with_pthread_PROGRAMS})
ENDFOREACH ()
FOREACH (source_file ${with_boost_lib_PROGRAMS})
INCLUDE_DIRECTORIES (
../include
${Boost_INCLUDE_DIRS}
)
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
ADD_EXECUTABLE (
${source_file_we}
${source_file}
)
TARGET_INCLUDE_DIRECTORIES (${source_file_we}
PRIVATE
$<TARGET_PROPERTY:msgpackcxx,INTERFACE_INCLUDE_DIRECTORIES>
)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
TARGET_LINK_LIBRARIES (${source_file_we}
${Boost_TIMER_LIBRARY}
${Boost_CHRONO_LIBRARY}
${Boost_SYSTEM_LIBRARY}
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
msgpackc-cxx
Boost::timer
)
IF (NOT MSVC AND NOT APPLE)
TARGET_LINK_LIBRARIES (${source_file_we}
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
rt
)
ENDIF ()