install_cosmologytools.cmake 1.82 KB
Newer Older
1 2 3 4 5 6 7 8 9
if (APPLE)
  set (SHARED_LIBRARY_PREFIX "lib")
  set (SHARED_LIBRARY_SUFFIX ".dylib")
elseif (UNIX)
  set (SHARED_LIBRARY_PREFIX "lib")
  set (SHARED_LIBRARY_SUFFIX ".so")
elseif(WIN32)
  message(FATAL_ERROR "Not supported on Windows")
endif()
10

11 12
# Remove any old directory.
execute_process(
13
  COMMAND ${CMAKE_COMMAND} -E remove_directory ${TMP_DIR}/CosmologyToolsPlugin-${bundle_suffix}
14 15 16 17
  WORKING_DIRECTORY ${TMP_DIR}
)

# Create a directory to put the plugin under.
18
execute_process(
19
    COMMAND ${CMAKE_COMMAND} -E make_directory ${TMP_DIR}/CosmologyToolsPlugin-${bundle_suffix}
20 21 22
    WORKING_DIRECTORY ${TMP_DIR}
)

23
# Copy the plugin lib.
24
execute_process(
25
  COMMAND ${CMAKE_COMMAND} -E copy ${BINARY_DIR}/libs/${SHARED_LIBRARY_PREFIX}PVCosmologyToolsPlugins${SHARED_LIBRARY_SUFFIX} ${TMP_DIR}/CosmologyToolsPlugin-${bundle_suffix}
26 27
  WORKING_DIRECTORY ${TMP_DIR}
)
George Zagaris's avatar
George Zagaris committed
28 29

if (APPLE)
30 31
  execute_process(
    COMMAND ${CMAKE_CURRENT_LIST_DIR}/apple/fixup_plugin.py
32
            # The directory containing the plugin dylibs or the plugin itself.
33
            ${TMP_DIR}/CosmologyToolsPlugin-${bundle_suffix}/${SHARED_LIBRARY_PREFIX}PVCosmologyToolsPlugins${SHARED_LIBRARY_SUFFIX}
34 35 36 37 38 39 40
            # names to replace (in order)
            "${PARAVIEW_BINARY_DIR}/lib/=@executable_path/../Libraries/"
            "${INSTALL_DIR}/lib/Qt=@executable_path/../Frameworks/Qt"
            "${INSTALL_DIR}/lib/=@executable_path/../Libraries/"
            "libhdf5.7.3.0.dylib=@executable_path/../Libraries/libhdf5.1.8.9.dylib"
            "libhdf5_hl.7.3.0.dylib=@executable_path/../Libraries/libhdf5.1.8.9.dylib"
            "libcgns.3.1.dylib=@executable_path/../Libraries/libcgns.3.1.dylib"
41
            )
George Zagaris's avatar
George Zagaris committed
42
endif()
43 44

execute_process(
45 46
    COMMAND ${CMAKE_COMMAND}
    -E tar cvfz ${bundle_name}-${bundle_suffix}.tgz CosmologyToolsPlugin-${bundle_suffix}
47 48
    WORKING_DIRECTORY ${TMP_DIR}
)