diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-07-12 13:12:07 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-07-12 13:12:07 +0200 |
commit | 55d13e8dc72eb10d266762f413dabf4b5b887713 (patch) | |
tree | 2cb57f61860280c54e8dd924c5d4ef27e164e0dc /dbug/CMakeLists.txt | |
parent | 20056897002575c3e81b7ce08b171cadc906bebc (diff) | |
download | mariadb-git-55d13e8dc72eb10d266762f413dabf4b5b887713.tar.gz |
* build dbug manual and unit tests
* document safemalloc
Diffstat (limited to 'dbug/CMakeLists.txt')
-rw-r--r-- | dbug/CMakeLists.txt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt index b0a6eba5d08..09b3ed928ab 100644 --- a/dbug/CMakeLists.txt +++ b/dbug/CMakeLists.txt @@ -20,3 +20,47 @@ INCLUDE_DIRECTORIES( SET(DBUG_SOURCES dbug.c) ADD_CONVENIENCE_LIBRARY(dbug ${DBUG_SOURCES}) TARGET_LINK_LIBRARIES(dbug mysys) + +ADD_EXECUTABLE(tests tests.c) +TARGET_LINK_LIBRARIES(tests dbug) + +ADD_EXECUTABLE(factorial my_main.c factorial.c) +TARGET_LINK_LIBRARIES(factorial dbug) + +IF(NOT WIN32) + FIND_PROGRAM(GROFF groff) + FIND_PROGRAM(NROFF nroff) + SET(OUTPUT_INC output1.r output2.r output3.r output4.r output5.r) + SET(SOURCE_INC factorial.r main.r example1.r example2.r example3.r) + ADD_CUSTOM_COMMAND(OUTPUT ${OUTPUT_INC} + DEPENDS factorial + COMMAND ./factorial 1 2 3 4 5 > output1.r + COMMAND ./factorial -\#t:o 2 3 > output2.r + COMMAND ./factorial -\#d:t:o 3 > output3.r + COMMAND ./factorial -\#d,result:o 4 > output4.r + COMMAND ./factorial -\#d:f,factorial:F:L:o 3 > output5.r) + FOREACH(file ${SOURCE_INC}) + STRING(REGEX REPLACE "\\.r" ".c" srcfile ${file}) + ADD_CUSTOM_COMMAND(OUTPUT ${file} DEPENDS ${srcfile} + COMMAND sed -e 's!\\\\!\\\\\\\\!g' + <${CMAKE_CURRENT_SOURCE_DIR}/${srcfile} >${file}) + ENDFOREACH(file) + ADD_CUSTOM_COMMAND(OUTPUT tests-t DEPENDS tests-t.pl + COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/tests-t.pl tests-t) + ADD_CUSTOM_TARGET(unit ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tests-t) + + IF(GROFF) + ADD_CUSTOM_COMMAND(OUTPUT user.ps + DEPENDS user.r ${OUTPUT_INC} ${SOURCE_INC} + COMMAND ${GROFF} -mm ${CMAKE_CURRENT_SOURCE_DIR}/user.r > user.ps) + ADD_CUSTOM_TARGET(ps ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/user.ps) + ENDIF(GROFF) + IF(NROFF) + ADD_CUSTOM_COMMAND(OUTPUT user.t + DEPENDS user.r ${OUTPUT_INC} ${SOURCE_INC} + COMMAND ${NROFF} -mm ${CMAKE_CURRENT_SOURCE_DIR}/user.r > user.t) + ADD_CUSTOM_TARGET(t ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/user.t) + ENDIF(NROFF) + +ENDIF(NOT WIN32) + |