new template : cpp light aka cppl : garde dossier essentiel
This commit is contained in:
parent
d4f662089d
commit
4abef052ce
18
bashrc
18
bashrc
|
@ -47,8 +47,6 @@ clear
|
|||
shuf -n 1 ~/dev/script/mcphrase | figlet
|
||||
|
||||
# alias
|
||||
alias dev="f(){ cd ~/dev/$1; }; f"
|
||||
alias cours="f(){ cd ~/cours/$1;}; f"
|
||||
alias cls="clear && neofetch"
|
||||
alias clr="clear"
|
||||
alias rm="trash"
|
||||
|
@ -63,11 +61,7 @@ alias ....="cd ../../.."
|
|||
alias send-nude="pqiv --fullscreen -t ~/pictures/nude.jpeg"
|
||||
alias libresprite="~/documents/libresprite.AppImage 1>/dev/null &"
|
||||
alias lsa="ls -a"
|
||||
alias lsd="f(){ ls -d $1*/;}; f"
|
||||
alias lsf="f(){ ls -p $1 | grep -v / && echo;}; f"
|
||||
alias lsl="ls -l"
|
||||
alias ls..="f(){ ls $1..;}; f"
|
||||
alias ls.="f(){ ls -a $1 | grep \"^\.\" | tr '\n' '\t' && echo;}; f"
|
||||
alias bashrc="nvim ~/dev/script/bashrc && exec bash"
|
||||
alias agenda="v ~/documents/agenda"
|
||||
alias quoi="echo feur && espeak -v fr-fr feur"
|
||||
|
@ -89,5 +83,15 @@ alias mcphrase="shuf -n 1 ~/dev/script/mcphrase | figlet"
|
|||
alias gay-ouataz="figlet gay-ouataz | lolcat -p 0.5 2>/dev/null"
|
||||
alias tg="figlet TG "
|
||||
alias livres="cd ~/livres"
|
||||
#alias emoji="f(){ grep -i $1 ~/dev/emoji; }; f"
|
||||
alias lss="ls | grep -i"
|
||||
#alias fss="find . | grep -v \\\.git | grep -i"
|
||||
|
||||
# alias avec parametre
|
||||
emoji(){ grep -i $1 ~/dev/emoji; }
|
||||
dev(){ cd ~/dev/$1; }
|
||||
cours(){ cd ~/cours/$1;}
|
||||
lsd(){ ls -d $1*/;}
|
||||
lsf(){ ls -p $1 | grep -v /$;}
|
||||
ls..(){ ls $1..;}
|
||||
ls.(){ ls -a $1 | grep ^\\.;}
|
||||
fss(){ find . | grep -v \\\.git | grep -i $1.[^/]*$; }
|
||||
|
|
8
newp
8
newp
|
@ -11,6 +11,14 @@ case $1 in
|
|||
cat CMakeLists.temp > CMakeLists.txt
|
||||
rm CMakeLists.temp
|
||||
echo $2 > .wakatime-project;;
|
||||
cppl) cp -r ~/dev/script/newp-template/cppl.template $2
|
||||
cd $2
|
||||
touch CMakeLists.temp
|
||||
name=${2##*/}
|
||||
sed "s/^\(project(cppl.template\)/project($name/" CMakeLists.txt > CMakeLists.temp
|
||||
cat CMakeLists.temp > CMakeLists.txt
|
||||
rm CMakeLists.temp
|
||||
echo $2 > .wakatime-project;;
|
||||
web) cp -r ~/dev/script/newp-template/web.template $2
|
||||
cd $2
|
||||
echo "name : $2" > .webconfig
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
# Project
|
||||
project(cppl.template LANGUAGES CXX)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_EXTENSIONS off)
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Weffc++ -Wextra -Wsign-conversion")
|
||||
|
||||
# Sources
|
||||
file(GLOB_RECURSE SOURCES src/*.cpp)
|
||||
file(GLOB_RECURSE HEADERS include/*.hpp include/*.h src/*.hpp src/*.h)
|
||||
|
||||
# ex librairie
|
||||
# find_package(exlib REQUIRED) # ou QUIET (req = obligée, si erreur stop ; quiet = si erreur, informe et continue)
|
||||
# include_directories(${exlib_INCLUDE_DIRS}) # optionnel, si erreur chercher exlibCONFIG.cmake pour trouver le $() qui convient
|
||||
# link_directories(${exlib_LIB_DIRS}) # optionnel; pareil qu'en dessus
|
||||
# add_definitions(${exlib_FLAGS})
|
||||
|
||||
# Executable
|
||||
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
|
||||
|
||||
# suite exlib
|
||||
# target_link_libraries(${PROJECT_NAME} ${exlib_LIBRARIES})
|
||||
|
||||
# Includes
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC src)
|
||||
|
||||
# tuto
|
||||
# https://www.youtube.com/watch?v=9fowTjLimxQ tuto cmake
|
||||
# https://www.youtube.com/watch?v=Lrt3i83wsy4 tuto cmake lib
|
|
@ -0,0 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
int main(){
|
||||
std::cout << "Hello World!" << std::endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue