summaryrefslogtreecommitdiff
path: root/dbug/CMakeLists.txt
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@aura-online.co.uk>2014-04-27 00:02:19 +0100
committerJames Le Cuirot <chewi@aura-online.co.uk>2014-04-27 00:02:19 +0100
commitcdc38712e4d359348346758e47e1ebc7d1743f82 (patch)
tree369cb23b079daf840b5df010b7b5e5ca99a3a958 /dbug/CMakeLists.txt
parentfbfa0043279757b2860e846c82cbf55ab92af9b8 (diff)
downloadmariadb-git-cdc38712e4d359348346758e47e1ebc7d1743f82.tar.gz
MySQL Bug #61340: Use CMake EXPORT feature to aid cross-compiling.
This technique is documented at: http://www.cmake.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build Basic steps are: # mkdir native cross # cd native # cmake /path/to/maria # make IMPORT_EXECUTABLES # cd ../cross # cmake -DCMAKE_TOOLCHAIN_FILE=foo -DIMPORT_EXECUTABLES=/path/to/native/import_executables.cmake /path/to/maria # make
Diffstat (limited to 'dbug/CMakeLists.txt')
-rw-r--r--dbug/CMakeLists.txt16
1 files changed, 9 insertions, 7 deletions
diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt
index fddf234a4f1..bc4288c157c 100644
--- a/dbug/CMakeLists.txt
+++ b/dbug/CMakeLists.txt
@@ -24,8 +24,10 @@ 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 CMAKE_CROSSCOMPILING)
+ ADD_EXECUTABLE(factorial my_main.c factorial.c)
+ TARGET_LINK_LIBRARIES(factorial dbug)
+ENDIF()
IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode)
FIND_PROGRAM(GROFF groff)
@@ -34,11 +36,11 @@ IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode)
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)
+ 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}