2023-06-02 18:40:24 +03:00
|
|
|
#!/bin/bash
|
2023-05-11 18:10:06 +03:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
PROGRAM_NAME=$1
|
|
|
|
|
|
|
|
mkdir $PROGRAM_NAME
|
|
|
|
|
|
|
|
cat > $PROGRAM_NAME/CMakeLists.txt << EOF
|
|
|
|
set(SOURCES
|
|
|
|
main.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable($PROGRAM_NAME \${SOURCES})
|
2024-06-19 04:20:23 +03:00
|
|
|
banan_link_library($PROGRAM_NAME ban)
|
|
|
|
banan_link_library($PROGRAM_NAME libc)
|
2023-05-11 18:10:06 +03:00
|
|
|
|
2024-07-21 17:41:40 +03:00
|
|
|
install(TARGETS $PROGRAM_NAME OPTIONAL)
|
2023-05-11 18:10:06 +03:00
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > $PROGRAM_NAME/main.cpp << EOF
|
2024-06-19 04:20:23 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2023-05-11 18:10:06 +03:00
|
|
|
int main()
|
|
|
|
{
|
2024-06-19 04:20:23 +03:00
|
|
|
printf("Hello World\n");
|
2023-05-11 18:10:06 +03:00
|
|
|
}
|
|
|
|
EOF
|