BuildSystem: Cleanup userspace directory layout
userspace programs are now in userspace/programs userspace tests are now in userspace/tests This makes listing userspace projects much cleaner. Libraries were already separated to their own directory, so other programs should also.
This commit is contained in:
28
userspace/programs/create_program.sh
Executable file
28
userspace/programs/create_program.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
PROGRAM_NAME=$1
|
||||
|
||||
mkdir $PROGRAM_NAME
|
||||
|
||||
cat > $PROGRAM_NAME/CMakeLists.txt << EOF
|
||||
set(SOURCES
|
||||
main.cpp
|
||||
)
|
||||
|
||||
add_executable($PROGRAM_NAME \${SOURCES})
|
||||
banan_link_library($PROGRAM_NAME ban)
|
||||
banan_link_library($PROGRAM_NAME libc)
|
||||
|
||||
install(TARGETS $PROGRAM_NAME)
|
||||
EOF
|
||||
|
||||
cat > $PROGRAM_NAME/main.cpp << EOF
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Hello World\n");
|
||||
}
|
||||
EOF
|
||||
Reference in New Issue
Block a user