summaryrefslogtreecommitdiffstats
path: root/Tests/Jump/Library/Shared/CMakeLists.txt
blob: a37299a7999ffe0b6cda286d0be040d41cd5a610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
add_library(jumpShared SHARED jumpShared.cxx)

if(WIN32 OR CYGWIN)
  set(SHARED_MUST_BE_IN_EXE_DIR 1)
endif()

if(APPLE)
  set(SHARED_MUST_BE_IN_EXE_DIR 1)
endif()

if(SHARED_MUST_BE_IN_EXE_DIR)
  set(LIB_NAME
    ${CMAKE_SHARED_LIBRARY_PREFIX}jumpShared${CMAKE_SHARED_LIBRARY_SUFFIX})
  set(EXE_DIR ${Jump_BINARY_DIR}/Executable)
  if(EXECUTABLE_OUTPUT_PATH)
    set(EXE_DIR ${EXECUTABLE_OUTPUT_PATH})
  endif()
  set(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared)
  if(LIBRARY_OUTPUT_PATH)
    set(LIB_DIR ${LIBRARY_OUTPUT_PATH})
  endif()
  add_custom_command(TARGET jumpShared
    POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy
    ${LIB_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME}
    ${EXE_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME})
endif()