CMakeLists.txt 2.5 KB
Newer Older
Matthieu Dorier's avatar
Matthieu Dorier committed
1 2 3 4 5 6
#
# CMakeLists.txt  cmake file for thallium library
# 13-Oct-2017  mdorier@anl.gov 
#

# list of source files
7 8
set(thallium-src async_response.cpp
		 bulk.cpp
9
		 callable_remote_procedure.cpp
Matthieu Dorier's avatar
Matthieu Dorier committed
10
		 endpoint.cpp 
11
                 engine.cpp 
12 13
		 margo_exception.cpp
		 proc_buffer.cpp
Matthieu Dorier's avatar
Matthieu Dorier committed
14
                 remote_procedure.cpp 
Matthieu Dorier's avatar
Matthieu Dorier committed
15
		 request.cpp
Matthieu Dorier's avatar
Matthieu Dorier committed
16
		 remote_bulk.cpp)
Matthieu Dorier's avatar
Matthieu Dorier committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

# load package helper for generating cmake CONFIG packages
include (CMakePackageConfigHelpers)

# where to install files for "find_package"
set (thallium-pkg "share/cmake/thallium")

#
# library version set here (e.g. for shared libs).
#
set (THALLIUM_VERSION_MAJOR 1)
set (THALLIUM_VERSION_MINOR 0)
set (THALLIUM_VERSION_PATCH 0)
set (thallium-vers "${THALLIUM_VERSION_MAJOR}.${THALLIUM_VERSION_MINOR}")
set (THALLIUM_VERSION "${thallium-vers}.${THALLIUM_VERSION_PATCH}")

add_library(thallium ${thallium-src})
target_link_libraries (thallium mercury margo)
target_include_directories (thallium PUBLIC $<INSTALL_INTERFACE:include>)

# local include's BEFORE, in case old incompatable .hpp files in prefix/include
target_include_directories (thallium BEFORE PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>)

# for shared libs, establish the lib version
set_target_properties (thallium
    PROPERTIES VERSION ${THALLIUM_VERSION}
    SOVERSION ${THALLIUM_VERSION_MAJOR})

#
# installation stuff (packaging and install commands)
#
write_basic_package_version_file(
    "thallium-config-version.cmake"
    VERSION ${THALLIUM_VERSION}
    COMPATIBILITY AnyNewerVersion)

# generate our config file for find_package()
configure_file (thallium-config.cmake.in thallium-config.cmake @ONLY)

57 58 59 60 61
# some bits for the pkg-config file
set (DEST_DIR "${CMAKE_INSTALL_PREFIX}")
set (PRIVATE_LIBS "-lthallium")
CONFIGURE_FILE("thallium.pc.in" "thallium.pc" @ONLY)

Matthieu Dorier's avatar
Matthieu Dorier committed
62 63 64 65 66 67 68 69 70 71 72 73 74
#
# "make install" rules
#
install (TARGETS thallium EXPORT thallium-targets
         ARCHIVE DESTINATION lib
         LIBRARY DESTINATION lib)
install (EXPORT thallium-targets
         DESTINATION ${thallium-pkg}
         FILE "thallium-targets.cmake")
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/thallium-config.cmake"
               "${CMAKE_CURRENT_BINARY_DIR}/thallium-config-version.cmake"
               "../cmake/xpkg-import.cmake"
         DESTINATION ${thallium-pkg} )
75 76
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/thallium.pc"
	DESTINATION "lib/pkgconfig/")
Matthieu Dorier's avatar
Matthieu Dorier committed
77 78 79
install (DIRECTORY ../include/thallium
         DESTINATION include
         FILES_MATCHING PATTERN "*.hpp")
Matthieu Dorier's avatar
Matthieu Dorier committed
80 81
install (FILES ../include/thallium.hpp
	 DESTINATION include)