Merge cmkrlib into the cmkr target

vcpkg-wip
Duncan Ogilvie 4 years ago
parent 6d9b40bd15
commit 6395267e4b

1
.gitattributes vendored

@ -0,0 +1 @@
CMakeLists.txt linguist-generated

@ -4,6 +4,8 @@ on: [push, pull_request]
jobs: jobs:
build: build:
# Skip building pull requests from the same repository
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != '${{ github.repository }}'
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -14,10 +16,12 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Build - name: Build
run: | run: |
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
cmake --build build --config ${{ env.BUILD_TYPE }} --parallel cmake --build build --config ${{ env.BUILD_TYPE }} --parallel
- name: Test - name: Test
run: | run: |
cd build/tests cd build/tests

72
CMakeLists.txt generated

@ -53,55 +53,26 @@ add_subdirectory(tests)
set(CMAKE_FOLDER ${CMKR_CMAKE_FOLDER}) set(CMAKE_FOLDER ${CMKR_CMAKE_FOLDER})
# Target cmkrlib
unset(cmkrlib_SOURCES)
list(APPEND cmkrlib_SOURCES
"src/cmkrlib/args.cpp"
"src/cmkrlib/build.cpp"
"src/cmkrlib/cmake.cpp"
"src/cmkrlib/error.cpp"
"src/cmkrlib/gen.cpp"
"src/cmkrlib/help.cpp"
"src/cmkrlib/cmake.hpp"
"src/cmkrlib/enum_helper.hpp"
"src/cmkrlib/fs.hpp"
"include/args.h"
"include/build.h"
"include/error.h"
"include/gen.h"
"include/help.h"
"include/literals.h"
)
list(APPEND cmkrlib_SOURCES
cmake.toml
)
add_library(cmkrlib STATIC ${cmkrlib_SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${cmkrlib_SOURCES})
target_compile_features(cmkrlib PUBLIC
cxx_std_11
)
target_include_directories(cmkrlib PUBLIC
include
)
target_link_libraries(cmkrlib PUBLIC
toml11
ghc_filesystem
mpark_variant
ordered_map
)
# Target cmkr # Target cmkr
unset(cmkr_SOURCES) unset(cmkr_SOURCES)
list(APPEND cmkr_SOURCES list(APPEND cmkr_SOURCES
"src/args.cpp"
"src/build.cpp"
"src/cmake.cpp"
"src/error.cpp"
"src/gen.cpp"
"src/help.cpp"
"src/main.cpp" "src/main.cpp"
"include/args.hpp"
"include/build.hpp"
"include/cmake.hpp"
"include/enum_helper.hpp"
"include/error.hpp"
"include/fs.hpp"
"include/gen.hpp"
"include/help.hpp"
"include/literals.hpp"
) )
list(APPEND cmkr_SOURCES list(APPEND cmkr_SOURCES
@ -117,8 +88,19 @@ endif()
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${cmkr_SOURCES}) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${cmkr_SOURCES})
target_compile_features(cmkr PRIVATE
cxx_std_11
)
target_include_directories(cmkr PRIVATE
include
)
target_link_libraries(cmkr PRIVATE target_link_libraries(cmkr PRIVATE
cmkrlib toml11
ghc_filesystem
mpark_variant
ordered_map
) )
install( install(

@ -8,18 +8,13 @@ description = "CMakeLists generator from TOML"
languages = ["CXX"] languages = ["CXX"]
subdirs = ["third_party", "tests"] subdirs = ["third_party", "tests"]
[target.cmkrlib] [target.cmkr]
type = "static" type = "executable"
sources = ["src/cmkrlib/*.cpp", "src/cmkrlib/*.hpp", "include/*.h"] sources = ["src/*.cpp", "include/*.hpp"]
include-directories = ["include"] include-directories = ["include"]
compile-features = ["cxx_std_11"] compile-features = ["cxx_std_11"]
link-libraries = ["toml11", "ghc_filesystem", "mpark_variant", "ordered_map"] link-libraries = ["toml11", "ghc_filesystem", "mpark_variant", "ordered_map"]
[target.cmkr]
type = "executable"
sources = ["src/main.cpp"]
link-libraries = ["cmkrlib"]
[[install]] [[install]]
targets = ["cmkr"] targets = ["cmkr"]
destination = "${CMAKE_INSTALL_PREFIX}/bin" destination = "${CMAKE_INSTALL_PREFIX}/bin"

@ -1,6 +1,5 @@
#pragma once #pragma once
#ifdef __cplusplus
namespace cmkr { namespace cmkr {
namespace args { namespace args {
@ -9,11 +8,4 @@ const char *handle_args(int argc, char **argv);
} // namespace args } // namespace args
} // namespace cmkr } // namespace cmkr
extern "C" {
#endif
const char *cmkr_args_handle_args(int, char **); const char *cmkr_args_handle_args(int, char **);
#ifdef __cplusplus
}
#endif

@ -1,7 +1,5 @@
#pragma once #pragma once
#ifdef __cplusplus
namespace cmkr { namespace cmkr {
namespace build { namespace build {
@ -13,15 +11,9 @@ int install();
} // namespace build } // namespace build
} // namespace cmkr } // namespace cmkr
extern "C" {
#endif
int cmkr_build_run(int argc, char **argv); int cmkr_build_run(int argc, char **argv);
int cmkr_build_clean(void); int cmkr_build_clean();
int cmkr_build_install(void);
#ifdef __cplusplus int cmkr_build_install();
}
#endif

@ -1,6 +1,5 @@
#pragma once #pragma once
#ifdef __cplusplus
namespace cmkr { namespace cmkr {
namespace error { namespace error {
@ -25,11 +24,4 @@ struct Status {
} // namespace error } // namespace error
} // namespace cmkr } // namespace cmkr
extern "C" {
#endif
const char *cmkr_error_status_string(int); const char *cmkr_error_status_string(int);
#ifdef __cplusplus
}
#endif

@ -1,6 +1,5 @@
#pragma once #pragma once
#ifdef __cplusplus
namespace cmkr { namespace cmkr {
namespace gen { namespace gen {
@ -11,13 +10,6 @@ int generate_cmake(const char *path, bool root = true);
} // namespace gen } // namespace gen
} // namespace cmkr } // namespace cmkr
extern "C" {
#endif
int cmkr_gen_generate_project(const char *typ); int cmkr_gen_generate_project(const char *typ);
int cmkr_gen_generate_cmake(const char *path); int cmkr_gen_generate_cmake(const char *path);
#ifdef __cplusplus
}
#endif

@ -1,6 +1,5 @@
#pragma once #pragma once
#ifdef __cplusplus
namespace cmkr { namespace cmkr {
namespace help { namespace help {
@ -11,13 +10,6 @@ const char *message() noexcept;
} // namespace help } // namespace help
} // namespace cmkr } // namespace cmkr
extern "C" {
#endif
const char *cmkr_help_version(void); const char *cmkr_help_version(void);
const char *cmkr_help_message(void); const char *cmkr_help_message(void);
#ifdef __cplusplus
}
#endif

@ -1,7 +1,7 @@
#include "args.h" #include "args.hpp"
#include "build.h" #include "build.hpp"
#include "gen.h" #include "gen.hpp"
#include "help.h" #include "help.hpp"
#include "fs.hpp" #include "fs.hpp"
#include <exception> #include <exception>

@ -1,7 +1,7 @@
#include "build.h" #include "build.hpp"
#include "cmake.hpp" #include "cmake.hpp"
#include "error.h" #include "error.hpp"
#include "gen.h" #include "gen.hpp"
#include "fs.hpp" #include "fs.hpp"
#include <sstream> #include <sstream>

@ -1,4 +1,4 @@
#include "error.h" #include "error.hpp"
#include <assert.h> #include <assert.h>

@ -1,7 +1,7 @@
#include "gen.h" #include "gen.hpp"
#include "cmake.hpp" #include "cmake.hpp"
#include "error.h" #include "error.hpp"
#include "literals.h" #include "literals.hpp"
#include "fs.hpp" #include "fs.hpp"
#include <cassert> #include <cassert>

@ -1,4 +1,4 @@
#include "help.h" #include "help.hpp"
namespace cmkr { namespace cmkr {
namespace help { namespace help {

@ -1,4 +1,4 @@
#include "args.h" #include "args.hpp"
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>

Loading…
Cancel
Save