project(nncc)
+enable_testing()
+
+###
+### Configuration
+###
+find_package(GTest)
+
+if(NOT DEFINED ENABLE_TEST)
+ # Enable test by default
+ set(ENABLE_TEST ${GTEST_FOUND})
+endif(NOT DEFINED ENABLE_TEST)
+
+if(${ENABLE_TEST} AND NOT ${GTEST_FOUND})
+ message(FATAL_ERROR "Google Test is required to enable test")
+endif(${ENABLE_TEST} AND NOT ${GTEST_FOUND})
+
+###
+### Function
+###
+function(add_nncc_library)
+ add_library(${ARGV})
+endfunction(add_nncc_library)
+
+function(add_nncc_test)
+ if(ENABLE_TEST)
+ add_executable(${ARGV})
+ target_include_directories(${ARGV0} PRIVATE ${GTEST_INCLUDE_DIRS})
+ target_link_libraries(${ARGV0} ${GTEST_BOTH_LIBRARIES} pthread)
+ add_test(${ARGV0} ${ARGV0})
+ endif(ENABLE_TEST)
+endfunction(add_nncc_test)
+
+function(nncc_test_link_libraries)
+ if(ENABLE_TEST)
+ target_link_libraries(${ARGV})
+ endif(ENABLE_TEST)
+endfunction(nncc_test_link_libraries)
+
+###
+### Components
+###
add_subdirectory(libs)
add_subdirectory(tools)
add_subdirectory(contrib)