build: Added example build.
authorAndreas Schneider <asn@cynapses.org>
Wed, 29 Dec 2010 13:48:07 +0000 (14:48 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 31 May 2011 17:45:28 +0000 (19:45 +0200)
src/CMakeLists.txt
src/example/CMakeLists.txt [new file with mode: 0644]

index 7822c64..93697ff 100644 (file)
@@ -35,6 +35,8 @@ include_directories(
     ${CMOCKERY_PRIVATE_INCLUDE_DIRS}
 )
 
+add_definitions(-DHAVE_CONFIG_H=1)
+
 add_library(${CMOCKERY_SHARED_LIBRARY} SHARED ${cmockery_SRCS})
 
 target_link_libraries(${CMOCKERY_SHARED_LIBRARY} ${CMOCKERY_LINK_LIBRARIES})
@@ -82,3 +84,4 @@ if (WITH_STATIC_LIB)
 endif (WITH_STATIC_LIB)
 
 add_subdirectory(google)
+add_subdirectory(example)
diff --git a/src/example/CMakeLists.txt b/src/example/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0ba8f21
--- /dev/null
@@ -0,0 +1,30 @@
+project(cmockery-examples C CXX)
+
+include_directories(
+    ${CMAKE_BINARY_DIR}
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMOCKERY_PUBLIC_INCLUDE_DIRS}
+)
+
+add_definitions(-DUNIT_TESTING=1)
+
+add_executable(calculator_test calculator.c calculator_test.c)
+target_link_libraries(calculator_test ${CMOCKERY_SHARED_LIBRARY})
+
+add_executable(allocate_module_test allocate_module.c allocate_module_test.c)
+target_link_libraries(allocate_module_test ${CMOCKERY_SHARED_LIBRARY})
+
+add_executable(assert_macro_test assert_macro.c assert_macro_test.c)
+target_link_libraries(assert_macro_test ${CMOCKERY_SHARED_LIBRARY})
+
+add_executable(customer_database_test customer_database.c customer_database_test.c)
+target_link_libraries(customer_database_test ${CMOCKERY_SHARED_LIBRARY})
+
+add_executable(key_value_test key_value.c key_value_test.c)
+target_link_libraries(key_value_test ${CMOCKERY_SHARED_LIBRARY})
+
+add_executable(product_database_test product_database.c product_database_test.c)
+target_link_libraries(product_database_test ${CMOCKERY_SHARED_LIBRARY})
+
+add_executable(run_tests run_tests.c)
+target_link_libraries(run_tests ${CMOCKERY_SHARED_LIBRARY})