From 095027f46aaff4388661eaf3e438300586597019 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 17 Mar 2016 16:32:32 -0400 Subject: [PATCH] Build: Migrated from cmake ExternalProject_Add to git submodule --- CMakeLists.txt | 9 +-------- src/CMakeLists.txt | 30 ++++++++++++++++++++++++------ src/commands/CMakeLists.txt | 2 +- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afdda351..b0202460 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,6 @@ set (HAVE_CMAKE true) project (timew) include (CXXSniffer) -include (ExternalProject) set (PROJECT_VERSION "0.1.0") @@ -42,12 +41,6 @@ configure_file ( ${CMAKE_SOURCE_DIR}/cmake.h.in ${CMAKE_SOURCE_DIR}/cmake.h) -ExternalProject_Add (libshared - GIT_REPOSITORY "https://git.tasktools.org/scm/tm/libshared.git" - GIT_TAG "master" - #UPDATE_DISCONNECTED 1 # Needs 3.2 - ) - add_subdirectory (src) add_subdirectory (src/commands) add_subdirectory (doc) @@ -67,6 +60,6 @@ set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION}) set (CPACK_SOURCE_IGNORE_FILES "CMakeCache" "CMakeFiles" "CPackConfig" "CPackSourceConfig" "_CPack_Packages" "cmake_install" "install_manifest" "Makefile$" "test" "package-config" "src/timew$" "src/libtimew.a" - "src/commands/libcommands.a" "libshared-prefix" + "src/commands/libcommands.a" "/\\\\.gitignore" "/\\\\.git/" "swp$" "src/gr$") include (CPack) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6e4636c7..ad751e37 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 2.8) include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/commands + ${CMAKE_SOURCE_DIR}/src/libshared/src ${TIMEW_INCLUDE_DIRS}) set (timew_SRCS Database.cpp Database.h @@ -14,17 +15,34 @@ set (timew_SRCS Database.cpp Database.h Rules.cpp Rules.h init.cpp) -add_library (timew STATIC ${timew_SRCS}) -include_directories(${CMAKE_INSTALL_PREFIX}/include) -link_directories(${CMAKE_INSTALL_PREFIX}/lib) +set (libshared_SRCS libshared/src/Args.cpp libshared/src/Args.h + libshared/src/Color.cpp libshared/src/Color.h + libshared/src/Configuration.cpp libshared/src/Configuration.h + libshared/src/Datetime.cpp libshared/src/Datetime.h + libshared/src/Duration.cpp libshared/src/Duration.h + libshared/src/FS.cpp libshared/src/FS.h + libshared/src/JSON.cpp libshared/src/JSON.h + libshared/src/Msg.cpp libshared/src/Msg.h + libshared/src/Pig.cpp libshared/src/Pig.h + libshared/src/RX.cpp libshared/src/RX.h + libshared/src/Table.cpp libshared/src/Table.h + libshared/src/Timer.cpp libshared/src/Timer.h + libshared/src/format.cpp libshared/src/format.h + libshared/src/shared.cpp libshared/src/shared.h + libshared/src/unicode.cpp libshared/src/unicode.h + libshared/src/utf8.cpp libshared/src/utf8.h + libshared/src/wcwidth6.cpp) + +add_library (timew STATIC ${timew_SRCS}) +add_library (libshared STATIC ${libshared_SRCS}) add_executable (timew_executable timew.cpp) add_executable (gr_executable gr.cpp) -target_link_libraries (timew_executable timew commands shared ${TIMEW_LIBRARIES}) -target_link_libraries (gr_executable timew shared ${TIMEW_LIBRARIES}) +target_link_libraries (timew_executable timew commands libshared ${TIMEW_LIBRARIES}) +target_link_libraries (gr_executable timew libshared ${TIMEW_LIBRARIES}) set_property (TARGET timew_executable PROPERTY OUTPUT_NAME "timew") -set_property (TARGET gr_executable PROPERTY OUTPUT_NAME "gr") +set_property (TARGET gr_executable PROPERTY OUTPUT_NAME "gr") install (TARGETS timew_executable DESTINATION bin) diff --git a/src/commands/CMakeLists.txt b/src/commands/CMakeLists.txt index 3d94b113..913307fe 100644 --- a/src/commands/CMakeLists.txt +++ b/src/commands/CMakeLists.txt @@ -2,8 +2,8 @@ cmake_minimum_required (VERSION 2.8) include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/commands + ${CMAKE_SOURCE_DIR}/src/libshared/src ${TIMEW_INCLUDE_DIRS}) -include_directories(${CMAKE_INSTALL_PREFIX}/include) set (commands_SRCS CmdClear.cpp CmdConfig.cpp