diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..da72bdb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.build/ +bin/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4c55df5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,23 @@ +PROJECT( argtable3 ) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) + +cmake_policy(SET CMP0003 NEW) +cmake_policy(SET CMP0015 NEW) + +option(argtable3_build_tests "Build all of argtable3's own tests." ON) + +option(argtable3_build_examples "Build argtable3's examples." ON) + +add_library( argtable3 argtable3.c ) + +install( TARGETS argtable3 ARCHIVE DESTINATION lib) +set_target_properties( argtable3 PROPERTIES DEBUG_POSTFIX d ) + +if (argtable3_build_tests) + add_subdirectory(tests) +endif() + +if (argtable3_build_examples) + add_subdirectory(examples) +endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..9b97200 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,9 @@ +if (NOT WIN32) + add_custom_target(examples + COMMAND make + WORKING_DIRECTORY ${argtable3_SOURCE_DIR}/examples) +else() + add_custom_target(examples + COMMAND nmake /f Makefile.nmake + WORKING_DIRECTORY ${argtable3_SOURCE_DIR}/examples) +endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..c8a3667 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,9 @@ +if (NOT WIN32) + add_custom_target(tests + COMMAND make + WORKING_DIRECTORY ${argtable3_SOURCE_DIR}/tests) +else() + add_custom_target(tests + COMMAND nmake /f Makefile.nmake + WORKING_DIRECTORY ${argtable3_SOURCE_DIR}/tests) +endif()