Skip to content

Commit 690a43b

Browse files
committed
Get rid of submodules.
1 parent c5b0155 commit 690a43b

File tree

8 files changed

+61
-34
lines changed

8 files changed

+61
-34
lines changed

.appveyor.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ environment:
2424
init: []
2525

2626
install:
27-
- git submodule update --init --recursive
28-
- cd external_libs
29-
- cd ..
3027

3128
before_build:
3229
- if defined BINDIR (set "PATH=%BINDIR%;%PATH:C:\Program Files\Git\usr\bin;=%")

.clang-format

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitmodules

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
[submodule "ext-basics"]
2-
path = external_libs/ext-basics
3-
url = https://github.com/extcpp/basics.git
4-
[submodule "cmake"]
5-
path = cmake
6-
url = https://github.com/extcpp/cmake.git

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# https://apt.llvm.org/
1212

1313
os: linux
14-
dist: bionic
14+
dist: focal
1515
language: cpp
1616
sudo: required
1717

@@ -67,7 +67,7 @@ matrix:
6767
apt:
6868
sources:
6969
#- ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
70-
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
70+
- sourceline: 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main'
7171
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
7272
packages: ['clang-10', 'clang++-10', 'clang-format-10', 'clang-tools-10', 'libc++-10-dev', 'libc++abi-10-dev']
7373

CMakeLists.txt

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
11
# Copyright - 2016-2020 - Jan Christoph Uhde <[email protected]>
22

3-
cmake_minimum_required(VERSION 3.8)
3+
cmake_minimum_required(VERSION 3.14)
44
project(ext-logging VERSION 0.0.1 LANGUAGES CXX)
55
message(STATUS "extINFO -- entering ext-logging")
6-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
76
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
87

98
## OPTIONS
10-
option(EXTLOG_EXAMPLES "build examples" OFF)
11-
option(EXTLOG_WARNINGS "enable warnings" ON)
12-
option(EXTLOG_CHECKED "user assert" ON)
13-
option(EXTLOG_TESTS "build tests" OFF)
9+
option(EXTLOG_EXAMPLES "build examples" OFF)
10+
option(EXTLOG_WARNINGS "enable warnings" ON)
11+
option(EXTLOG_CHECKED "user assert" ON)
12+
option(EXTLOG_TESTS "build tests" OFF)
1413
option(EXTLOG_ENABLE_VIM_GDB "support vim / gdb" ON)
1514

16-
## general setup and includes
17-
set(CMAKE_CXX_STANDARD 17)
18-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
19-
set_property(GLOBAL PROPERTY USE_FOLDERS ON) # XCode / VS folders
20-
21-
set(LIBEXT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external_libs/ext-basics)
15+
# enable extcpp cmake
16+
set(EXT_LIBRARIES_PATH "${CMAKE_LIST_SOURCE_DIR}/.." CACHE STRING "path to extcpp libraries")
17+
include(${CMAKE_CURRENT_LIST_DIR}/ext_cmake_enable.cmake)
2218
include(ext_cmake_setup)
23-
include(ext_cmake_install)
19+
ext_enable_ext_libs(basics)
2420

21+
set_property(GLOBAL PROPERTY USE_FOLDERS ON) # XCode / VS folders
2522
find_package(Threads REQUIRED)
26-
if(NOT TARGET ext::basics)
27-
add_subdirectory(external_libs/ext-basics EXCLUDE_FROM_ALL)
28-
endif()
29-
30-
set(FORCE_COLORED_OUTPUT ON)
31-
ext_colored_compiler_ouput()
3223

3324
# verbose windows linking
3425
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /VERBOSE:LIB")
@@ -124,5 +115,5 @@ add_custom_target(
124115
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
125116
COMMAND ${CMAKE_COMMAND}
126117
-D "EXT_GIT_VERSION_OUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/ext_logging_version.hpp"
127-
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/ext_script_git_version.cmake"
118+
-P "${ext_cmake_dir}/ext_script_git_version.cmake"
128119
)

cmake

Lines changed: 0 additions & 1 deletion
This file was deleted.

ext_cmake_enable.cmake

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#TODO use version parameter to ensure a certaion version
2+
if(EXT_CMAKE_ENABLED)
3+
return()
4+
endif()
5+
6+
#try some common paths
7+
set(ext_cmake_dir_hints
8+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
9+
"${CMAKE_CURRENT_SOURCE_DIR}/../cmake"
10+
"${CMAKE_CURRENT_SOURCE_DIR}/../basics/cmake"
11+
"${EXT_CMAKE_PATH}"
12+
"${EXT_LIBRARIES_PATH}/cmake"
13+
"${EXT_LIBRARIES_PATH}/basics/cmake"
14+
)
15+
16+
foreach(ext_cmake_dir_candidate IN LISTS EXT_CMAKE_HINTS EXT_CMAKE_PATHS ext_cmake_dir_hints)
17+
set(ext_cmake_dir "${ext_cmake_dir_candidate}")
18+
if(EXISTS ${ext_cmake_dir}/ext_script_git_version.cmake)
19+
message(STATUS "extINFO -- found ext cmake directory in: ${ext_cmake_dir}")
20+
break()
21+
endif()
22+
endforeach()
23+
24+
#download
25+
if(NOT EXISTS ${ext_cmake_dir}/ext_script_git_version.cmake)
26+
message(STATUS "extINFO -- downloading extcpp/cmake")
27+
#if there is a cmake directory just use that
28+
include(FetchContent)
29+
FetchContent_Declare(ext_cmake_github
30+
GIT_REPOSITORY https://github.com/extcpp/cmake.git
31+
GIT_TAG master
32+
GIT_PROGRESS TRUE
33+
)
34+
FetchContent_MakeAvailable(ext_cmake_github)
35+
message("downloaded ext/cmake to: ${ext_cmake_github_SOURCE_DIR}")
36+
set(ext_cmake_dir "${ext_cmake_github_SOURCE_DIR}")
37+
endif()
38+
39+
#final check and include
40+
if(NOT EXISTS ${ext_cmake_dir}/ext_script_git_version.cmake)
41+
message(FATAL_ERROR "Could not locate extcpp/cmake directory!")
42+
else()
43+
list(APPEND CMAKE_MODULE_PATH "${ext_cmake_dir}")
44+
endif()
45+
46+
message(STATUS "extINFO -- CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
47+
48+
set(EXT_CMAKE_ENABLED TRUE)

external_libs/ext-basics

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)