use fetch-content instead of submodules

self-hosting
Mohammed Alyousef 4 years ago
parent fa35d54009
commit bce39a944d

3
.gitmodules vendored

@ -1,3 +0,0 @@
[submodule "vendor"]
path = vendor
url = https://github.com/ToruNiina/toml11.git

@ -6,6 +6,15 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(cmkr VERSION 0.1.0) project(cmkr VERSION 0.1.0)
include(FetchContent)
FetchContent_Declare(
toml11
GIT_REPOSITORY https://github.com/ToruNiina/toml11
)
FetchContent_MakeAvailable(toml11)
set(CMKRLIB_SOURCES set(CMKRLIB_SOURCES
"src/cmake.cpp" "src/cmake.cpp"
@ -19,7 +28,10 @@ add_library(cmkrlib STATIC ${CMKRLIB_SOURCES})
target_include_directories(cmkrlib PUBLIC target_include_directories(cmkrlib PUBLIC
"include" "include"
"vendor" )
target_link_libraries(cmkrlib PUBLIC
toml11::toml11
) )
target_compile_features(cmkrlib PUBLIC target_compile_features(cmkrlib PUBLIC

@ -7,8 +7,7 @@ cmkr requires a C++17 compiler, cmake >= 3.14 and git. It depends on toml11 by T
``` ```
git clone https://github.com/moalyousef/cmkr git clone https://github.com/moalyousef/cmkr
cd cmkr cd cmkr
git submodule update --init --recursive cmake -Bbin
cmake -S. -Bbin
cmake --build bin cmake --build bin
``` ```
@ -37,12 +36,16 @@ minimum = "3.14"
name = "cmkr" name = "cmkr"
version = "0.1.0" version = "0.1.0"
[fetch-content]
toml11 = { GIT_REPOSITORY = "https://github.com/ToruNiina/toml11" }
[[bin]] [[bin]]
name = "cmkrlib" name = "cmkrlib"
type = "static" type = "static"
sources = ["src/cmake.cpp", "src/gen.cpp", "src/help.cpp", "src/build.cpp", "src/error.cpp"] sources = ["src/cmake.cpp", "src/gen.cpp", "src/help.cpp", "src/build.cpp", "src/error.cpp"]
include-dirs = ["include", "vendor"] include-dirs = ["include"]
features = ["cxx_std_17"] features = ["cxx_std_17"]
link-libs = ["toml11::toml11"]
[[bin]] [[bin]]
name = "cmkr" name = "cmkr"

@ -5,12 +5,16 @@ minimum = "3.14"
name = "cmkr" name = "cmkr"
version = "0.1.0" version = "0.1.0"
[fetch-content]
toml11 = { GIT_REPOSITORY = "https://github.com/ToruNiina/toml11" }
[[bin]] [[bin]]
name = "cmkrlib" name = "cmkrlib"
type = "static" type = "static"
sources = ["src/cmake.cpp", "src/gen.cpp", "src/help.cpp", "src/build.cpp", "src/error.cpp"] sources = ["src/cmake.cpp", "src/gen.cpp", "src/help.cpp", "src/build.cpp", "src/error.cpp"]
include-dirs = ["include", "vendor"] include-dirs = ["include"]
features = ["cxx_std_17"] features = ["cxx_std_17"]
link-libs = ["toml11::toml11"]
[[bin]] [[bin]]
name = "cmkr" name = "cmkr"

@ -1 +0,0 @@
Subproject commit 9132abc5c403bfeaf12a8ff940a9fbdc45220843
Loading…
Cancel
Save