Skip to content

Commit

Permalink
Rename library to mtgo_utils (#19)
Browse files Browse the repository at this point in the history
* Rename library to mtgo_utils
  • Loading branch information
BigPeet authored Mar 18, 2021
1 parent f041915 commit 72e5066
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
compile_commands.json
cscope.out
**/build/*
**/install/*

# VSCode
.vscode/*
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)

project(mtgo_utils VERSION 0.1.1)
project(mtgo_utils VERSION 0.1.2)

include(cmake/StandardProjectSettings.cmake)
include(cmake/PreventInSourceBuilds.cmake)
Expand Down
2 changes: 1 addition & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
add_subdirectory(gamelog)
add_subdirectory(mtgo_utils)
46 changes: 23 additions & 23 deletions lib/gamelog/CMakeLists.txt → lib/mtgo_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
# Gamelog Library
set(LOG_LIB gamelog)
# mtgo_utils Library
set(LIB_NAME mtgo_utils)

set(LOG_SOURCES
set(LIB_SOURCES
src/gamelog.cpp
)

set(LOG_HEADERS
include/gamelog/gamelog.h
set(LIB_HEADERS
include/mtgo_utils/gamelog.h
)

set(LOG_TESTS
set(LIB_TESTS
tests/test_main.cpp
tests/test_gamelog.cpp
)

add_library(
${LOG_LIB}
${LIB_NAME}
SHARED
${LOG_SOURCES}
${LIB_SOURCES}
)

set_target_properties(
${LOG_LIB}
${LIB_NAME}
PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION}
PUBLIC_HEADER ${LOG_HEADERS}
PUBLIC_HEADER ${LIB_HEADERS}
)

target_link_libraries(
${LOG_LIB}
${LIB_NAME}
PRIVATE project_options
project_warnings
)

analyse_with_iwyu(${LOG_LIB})
analyse_with_iwyu(${LIB_NAME})

target_include_directories(
${LOG_LIB}
${LIB_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

# System install
install(TARGETS ${LOG_LIB}
install(TARGETS ${LIB_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${LOG_LIB}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${LIB_NAME}
)

# Unit Tests
if (ENABLE_TESTING)
add_executable(
${LOG_LIB}-test
${LOG_TESTS}
${LIB_NAME}-test
${LIB_TESTS}
)
target_link_libraries(
${LOG_LIB}-test
${LIB_NAME}-test
PRIVATE
${LOG_LIB}
${LIB_NAME}
gtest
gtest_main
project_options
project_warnings
)

add_test(
NAME ${LOG_LIB}-test
COMMAND ${LOG_LIB}-test
NAME ${LIB_NAME}-test
COMMAND ${LIB_NAME}-test
)

install(
TARGETS ${LOG_LIB}-test
TARGETS ${LIB_NAME}-test
RUNTIME DESTINATION build
)
endif()
endif()
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef MTGO_UTILS_LIB_GAMELOG_INCLUDE_GAMELOG_H
#define MTGO_UTILS_LIB_GAMELOG_INCLUDE_GAMELOG_H
#ifndef LIB_MTGO_UTILS_INCLUDE_MTGO_UTILS_GAMELOG_H
#define LIB_MTGO_UTILS_INCLUDE_MTGO_UTILS_GAMELOG_H

#include <filesystem>
#include <fstream>
Expand Down Expand Up @@ -44,4 +44,4 @@ bool IsMatchGameLog(std::filesystem::path const& file_path);

} // namespace gl

#endif /* ifndef MTGO_UTILS_LIB_GAMELOG_INCLUDE_GAMELOG_H */
#endif /* ifndef LIB_MTGO_UTILS_INCLUDE_MTGO_UTILS_GAMELOG_H */
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <utility>
#include <vector>

#include "gamelog/gamelog.h"
#include "mtgo_utils/gamelog.h"

namespace gl {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <filesystem>
#include "gtest/gtest.h"

#include "gamelog/gamelog.h"
#include "mtgo_utils/gamelog.h"

class GameLogTest : public ::testing::Test
{
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/file_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ target_link_libraries(
${FILE_PARSER}
PRIVATE project_options
project_warnings
gamelog
mtgo_utils
)

analyse_with_iwyu(${FILE_PARSER})
Expand Down
2 changes: 1 addition & 1 deletion src/file_parser/src/file_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <system_error>
#include <vector>

#include "gamelog/gamelog.h"
#include "mtgo_utils/gamelog.h"

static void show_usage(std::string const& exec_name)
{
Expand Down

0 comments on commit 72e5066

Please sign in to comment.