arapelle / cmtk Goto Github PK
View Code? Open in Web Editor NEWThis CMake ToolKit (CMTK) provides helping CMake functions to manage simple C++ CMake projects easily.
License: MIT License
This CMake ToolKit (CMTK) provides helping CMake functions to manage simple C++ CMake projects easily.
License: MIT License
Call target_default_warning_options() if cmake option NO_DEFAULT_WARNING_OPTIONS is undefined.
add_cpp_executable_test
add_cpp_executable_basic_tests
add_cpp_library_example
add_cpp_library_basic_examples
add_cpp_library_test
add_cpp_library_basic_tests
set_project_name(NAME long_unique_name)
set_project_name(NAMESPACE arba BASE_NAME core)
set_project_semantic_version(0.1.0 PRE_RELEASE "alpha.1" BUILD_METADATA "{[utc_]timestamp}.{commit_sha}")
install(CODE "set(CMTK_INSTALL_FILES \${CMAKE_INSTALL_MANIFEST_FILES})")
For static and shared targets:
Look at strn branch code_coverage
for gcovr
.
disable_in_source_build()
.like generate_verbose_library_config_file(), ...
In Utility:
macro(find_package_if_not_target target package_name)
if(NOT TARGET ${target})
find_package(${package_name} ${ARGN})
endif()
endmacro()
Use cmake_parse_arguments() with list keywords: IF, THEN, ELSE.
Create a cache variable if SPDLOG_ACTIVE_LEVEL
does not exist.
The cache variable is a string enum : "TRACE" "DEBUG" "INFO" "WARN" "ERROR" "CRITICAL" "OFF".
The init value is set to DEBUG if build type is Debug, RELEASE if build type is Release or TRACE otherwise.
PUBLIC
is too confusing (even for me!). So, it is deprecated.
BUILD_SHARED
and BUILD_STATIC
can be ON
, OFF
, UNDEFINED
, OPTION
.
(OPTION
and UNDEFINED
have the same meaning. Just that, UNDEFINED is a possible value of a trioption
.)
OPTION
(and UNDEFINED
too) means building SHARED (or STATIC) target depends on an option.
So, PUBLIC
should be replaced by:
BUILD_SHARED OPTION
BUILD_STATIC OPTION
Should UNDEFINED
value of trioption
be renamed OPTION
? probably not.
# target_SPDLOG_ACTIVE_LEVEL_definition()
function(target_SPDLOG_ACTIVE_LEVEL_definition target)
cmake_parse_arguments(PARSE_ARGV 1 "ARG" "" "LEVEL" "")
if(ARG_LEVEL)
set(SPDLOG_ACTIVE_LEVEL ${ARG_LEVEL})
endif()
fatal_ifndef("Variable SPDLOG_ACTIVE_LEVEL is not defined." SPDLOG_ACTIVE_LEVEL)
target_compile_definitions(${target} PRIVATE SPDLOG_ACTIVE_LEVEL=${SPDLOG_ACTIVE_LEVEL})
endfunction()
If the variable is DEFINED, BUILD_SHARED|STATIC becomes the variable value.
Otherwise, a cache option is created.
When a project is a subproject (git submodule for example) which creates a uninstall script,
it must not remove files of siblings projects installed before him.
When the list of files to remove by the script is created, the list of files already treated by another uninstall script
must be removed from the list.
Remove functions:
generate_default_version_header()
configure_version_header()
Add doc for:
fatal_ifdef()
fatal_ifndef()
fatal_if_none_is_def()
set_ifndef()
set_iftest()
trioption()
option_or_set_ifdef()
trioption_or_set_ifdef()
configure_headers()
set_SPDLOG_ACTIVE_LEVEL_ifndef()
target_default_warning_options()
generate_version_macro_header()
?Replace by set_buid_type_ifndef([TYPES Release Debug ...] [DEFAULT 0|Release])
Examples:
https://github.com/skypjack/entt
BUG : When install_library_package()
is called with UNINSTALL_SCRIPT
with no parameter, UNINSTALL_SCRIPT
is not DEFINED
. So, cmake_uninstall.cmake script are not installed.
Add parameters to parse:
find_or_simple_fetch()
(or find_or_fc_declare_and_make_available()
)Arguments for add_rsc_cpp_library()
:
NAME name
[PARENT_NAMESPACE parent_ns]
[INLINE_PARENT_NAMESPACE parent_ns]
[PRIVATE_RESOURCE_HEADERS]
[PRIVATE_RESOURCE_PATHS_HEADER]
add_cpp_library()
argumentsGenerated lib API:
find_serialized_resource()
Doc:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.