diff options
author | Brad King <brad.king@kitware.com> | 2004-01-22 14:56:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2004-01-22 14:56:24 (GMT) |
commit | 3a33f2c33822a3f266064b2e483ab79b5675bd5c (patch) | |
tree | 7f7fde451d33ba1e4e56e532cb55366530ae03b9 /Tests | |
parent | 8bd124e7d0e655f6195200f83e37dbd0a24624e3 (diff) | |
download | CMake-3a33f2c33822a3f266064b2e483ab79b5675bd5c.zip CMake-3a33f2c33822a3f266064b2e483ab79b5675bd5c.tar.gz CMake-3a33f2c33822a3f266064b2e483ab79b5675bd5c.tar.bz2 |
ENH: Adding test for jumping over and building a missing library.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Jump/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/Jump/Executable/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/Jump/Executable/jumpExecutable.cxx | 12 | ||||
-rw-r--r-- | Tests/Jump/Library/CMakeLists.txt | 21 | ||||
-rw-r--r-- | Tests/Jump/Library/jumpShared.cxx | 7 | ||||
-rw-r--r-- | Tests/Jump/Library/jumpStatic.cxx | 1 |
6 files changed, 47 insertions, 0 deletions
diff --git a/Tests/Jump/CMakeLists.txt b/Tests/Jump/CMakeLists.txt new file mode 100644 index 0000000..3a506aa --- /dev/null +++ b/Tests/Jump/CMakeLists.txt @@ -0,0 +1,4 @@ +PROJECT(Jump) + +SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1) +SUBDIRS(Executable Library) diff --git a/Tests/Jump/Executable/CMakeLists.txt b/Tests/Jump/Executable/CMakeLists.txt new file mode 100644 index 0000000..032c212 --- /dev/null +++ b/Tests/Jump/Executable/CMakeLists.txt @@ -0,0 +1,2 @@ +ADD_EXECUTABLE(jumpExecutable jumpExecutable.cxx) +TARGET_LINK_LIBRARIES(jumpExecutable jumpStatic jumpShared) diff --git a/Tests/Jump/Executable/jumpExecutable.cxx b/Tests/Jump/Executable/jumpExecutable.cxx new file mode 100644 index 0000000..7a050c7 --- /dev/null +++ b/Tests/Jump/Executable/jumpExecutable.cxx @@ -0,0 +1,12 @@ +#ifdef _WIN32 +# define JUMP_IMPORT __declspec(dllimport) +#else +# define JUMP_IMPORT extern +#endif + +extern int jumpStatic(); +JUMP_IMPORT int jumpShared(); +int main() +{ + return jumpShared() && jumpShared(); +} diff --git a/Tests/Jump/Library/CMakeLists.txt b/Tests/Jump/Library/CMakeLists.txt new file mode 100644 index 0000000..3139800 --- /dev/null +++ b/Tests/Jump/Library/CMakeLists.txt @@ -0,0 +1,21 @@ +ADD_LIBRARY(jumpStatic STATIC jumpStatic.cxx) +ADD_LIBRARY(jumpShared SHARED jumpShared.cxx) + +IF(WIN32) + SET(LIB_NAME + ${CMAKE_SHARED_LIBRARY_PREFIX}jumpStatic${CMAKE_SHARED_LIBRARY_SUFFIX}) + SET(EXE_DIR ${Jump_BINARY_DIR}/Executable) + IF(EXECUTABLE_OUTPUT_PATH) + SET(EXE_DIR ${EXECUTABLE_OUTPUT_PATH}) + ENDIF(EXECUTABLE_OUTPUT_PATH) + SET(LIB_DIR ${Jump_BINARY_DIR}/Library) + IF(LIBRARY_OUTPUT_PATH) + SET(LIB_DIR ${LIBRARY_OUTPUT_PATH}) + ENDIF(LIBRARY_OUTPUT_PATH) + ADD_CUSTOM_COMMAND(TARGET target + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy + ${LIB_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME} + ${EXE_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME} +ENDIF(WIN32) diff --git a/Tests/Jump/Library/jumpShared.cxx b/Tests/Jump/Library/jumpShared.cxx new file mode 100644 index 0000000..f500058 --- /dev/null +++ b/Tests/Jump/Library/jumpShared.cxx @@ -0,0 +1,7 @@ +#ifdef _WIN32 +# define JUMP_EXPORT __declspec(dllexport) +#else +# define JUMP_EXPORT +#endif + +JUMP_EXPORT int jumpShared() { return 0; } diff --git a/Tests/Jump/Library/jumpStatic.cxx b/Tests/Jump/Library/jumpStatic.cxx new file mode 100644 index 0000000..1f92eb9 --- /dev/null +++ b/Tests/Jump/Library/jumpStatic.cxx @@ -0,0 +1 @@ +int jumpStatic() { return 0; } |