diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 135aa7f..27c7acd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,9 +1,17 @@ cmake_minimum_required(VERSION 3.0) project(test) +option(BUILD_C "build hello world in C Language" OFF) +option(BUILD_CXX "build hello world in CXX Language" ON) option(BUILD_TXT "build hello world txt file" OFF) -add_executable(hello_world hello_world.cpp) +if(BUILD_C) + add_executable(hello_world_c hello_world.c) +endif() + +if(BUILD_CXX) + add_executable(hello_world hello_world.cpp) +endif() if(BUILD_TXT) add_custom_target( diff --git a/test/hello_world.c b/test/hello_world.c new file mode 100644 index 0000000..7791fbb --- /dev/null +++ b/test/hello_world.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello world!\n"); + return 0; +}