-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
60 lines (49 loc) · 1.66 KB
/
CMakeLists.txt
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
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
57
58
59
60
cmake_minimum_required (VERSION 3.1)
project (mutils-tasks)
#Versions
set(mutils_tasks_VERSION 1.0)
#CXX FLAGS
set(CMAKE_CXX_FLAGS "-std=c++14 -fPIC -DMAX_THREADS=100")
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS_DEBUG "-std=c++14 -fPIC -DMAX_THREADS=100 -g")
set(CMAKE_SHARED_LINKER_FLAGS "-shared --enable-new-dtags")
if ( NOT DEFINED CMAKE_INSTALL_LIBDIR )
set( CMAKE_INSTALL_LIBDIR lib )
endif ( )
#Check dependencies
find_package(mutils 1.0)
if(NOT ${mutils_FOUND})
message( FATAL_ERROR "mutils not found.")
endif(NOT ${mutils_FOUND})
add_library(mutils-tasks SHARED FutureFreePool.cpp GlobalPool.cpp)
target_include_directories(mutils-tasks PRIVATE
$<BUILD_INTERFACE:${mutils-tasks_SOURCE_DIR}/include>)
#Make install
install(TARGETS mutils-tasks EXPORT mutils-tasks
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY include/mutils-tasks
DESTINATION include)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/mutils-tasks/mutils-tasksConfigVersion.cmake"
VERSION ${mutils_tasks_VERSION}
COMPATIBILITY AnyNewerVersion
)
export (EXPORT mutils-tasks
FILE "${CMAKE_CURRENT_BINARY_DIR}/mutils-tasks/mutils-tasksTargets.cmake"
)
configure_file (mutils-tasksConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/mutils-tasks/mutils-tasksConfig.cmake"
COPYONLY
)
set(ConfigPackageLocation lib/cmake/mutils-tasks)
install(EXPORT mutils-tasks
FILE mutils-tasksTargets.cmake
DESTINATION ${ConfigPackageLocation}
)
install(
FILES
mutils-tasksConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/mutils-tasks/mutils-tasksConfigVersion.cmake"
DESTINATION ${ConfigPackageLocation}
)