CMakeLists.txt 2.67 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 abt_errors.cpp
		 async_response.cpp
9
		 bulk.cpp
10
		 callable_remote_procedure.cpp
Matthieu Dorier's avatar
Matthieu Dorier committed
11
		 endpoint.cpp 
12
                 engine.cpp 
13
		 margo_exception.cpp
14
		 pool.cpp
15
		 proc_buffer.cpp
Matthieu Dorier's avatar
Matthieu Dorier committed
16
                 remote_procedure.cpp 
Matthieu Dorier's avatar
Matthieu Dorier committed
17
		 request.cpp
18 19 20 21
		 remote_bulk.cpp
		 scheduler.cpp
		 task.cpp
		 thread.cpp)
Matthieu Dorier's avatar
Matthieu Dorier committed
22 23 24 25 26 27 28 29 30 31

# 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).
#
Matthieu Dorier's avatar
Matthieu Dorier committed
32
set (THALLIUM_VERSION_MAJOR 0)
33 34
set (THALLIUM_VERSION_MINOR 4)
set (THALLIUM_VERSION_PATCH 0)
Matthieu Dorier's avatar
Matthieu Dorier committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
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)

62 63 64 65 66
# 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
67 68 69 70 71 72 73 74 75 76 77 78 79
#
# "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} )
80 81
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/thallium.pc"
	DESTINATION "lib/pkgconfig/")
Matthieu Dorier's avatar
Matthieu Dorier committed
82 83 84
install (DIRECTORY ../include/thallium
         DESTINATION include
         FILES_MATCHING PATTERN "*.hpp")
Matthieu Dorier's avatar
Matthieu Dorier committed
85 86
install (FILES ../include/thallium.hpp
	 DESTINATION include)
87 88
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/../include/thallium/config.hpp
	DESTINATION include/thallium)