commit 37f297e278cbde3e9ff5e5672d05b6f5a31861b2 Author: zhangzhe Date: Tue Mar 14 21:07:39 2023 +0800 1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..07ed706 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/* \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9934fa7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.6) + +set(PROJECT_N hello) + +SET(CMAKE_C_COMPILER /home/user/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android22-clang) +SET(CMAKE_CXX_COMPILER /home/user/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android22-clang++) + +project(${PROJECT_N} VERSION 1.0) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +file(GLOB_RECURSE SRCS ${PROJECT_SOURCE_DIR}/src/*.cpp) + +# a macro that gets all of the header containing directories. +MACRO(header_directories return_list includes_base_folder extention ) + FILE(GLOB_RECURSE new_list ${includes_base_folder}/*.${extention}) + SET(dir_list "") + FOREACH(file_path ${new_list}) + GET_FILENAME_COMPONENT(dir_path ${file_path} PATH) + SET(dir_list ${dir_list} ${dir_path}) + ENDFOREACH() + LIST(REMOVE_DUPLICATES dir_list) + SET(${return_list} ${dir_list}) +ENDMACRO() + +# using said macro. +header_directories(INCLUDES ${PROJECT_SOURCE_DIR}/include/ hpp) + +message("src files:") +foreach(file ${SRCS}) + message(STATUS ${file}) +endforeach() + +message("include directories:") +foreach(dir ${INCLUDES}) + message(STATUS ${dir}) +endforeach() +add_executable(${PROJECT_N} ${SRCS}) + +target_include_directories(${PROJECT_N} PUBLIC include) diff --git a/hello b/hello new file mode 100755 index 0000000..a91725a Binary files /dev/null and b/hello differ diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..112495b --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,6 @@ +#include +int main(int argc, char const *argv[]) +{ + std::cout<< "Hello World!" << std::endl; + return 0; +}