Browse Source

CMake build script added

pull/9/head
Arkadiy Shapkin 8 years ago
parent
commit
f0bc6782f3
  1. 2
      .gitignore
  2. 23
      CMakeLists.txt
  3. 9
      examples/CMakeLists.txt
  4. 9
      tests/CMakeLists.txt

2
.gitignore

@ -0,0 +1,2 @@
.build/
bin/

23
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()

9
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()

9
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()
Loading…
Cancel
Save