-
Notifications
You must be signed in to change notification settings - Fork 36
/
CMakeLists.txt
434 lines (384 loc) · 15.5 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
cmake_minimum_required(VERSION 2.6)
#default to Release build if not specified
#This is before the project(plfs) invocation to allow it to be cached
if (NOT CMAKE_BUILD_TYPE)
message("-- CMAKE_BUILD_TYPE not selected, default to Release")
set(CMAKE_BUILD_TYPE Release CACHE STRING "The type of build")
endif()
#begin plfs project
project(plfs)
#set project number X.X.X?
set (plfs_VERSION_MAJOR 2)
set (plfs_VERSION_MINOR 5)
set (plfs_VERSION_PATCH 1)
set (plfs_DATA_VERSION 1.0)
set (PACKAGE_STRING "PLFS ${plfs_VERSION_MAJOR}.${plfs_VERSION_MINOR}")
set (plfs_VERSION_FULL "${plfs_VERSION_MAJOR}.${plfs_VERSION_MINOR}")
if (DEFINED plfs_VERSION_PATCH)
#if it's 0 don't print it
if (plfs_VERSION_PATCH)
set (PACKAGE_STRING "${PACKAGE_STRING}.${plfs_VERSION_PATCH}")
set (plfs_VERSION_FULL "${plfs_VERSION_FULL}.${plfs_VERSION_PATCH}")
endif()
endif()
#setup "make dist"
set(ARCHIVE_NAME
${CMAKE_PROJECT_NAME}-${plfs_VERSION_FULL})
add_custom_target(dist
COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD
| bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
#setup special modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/Modules/")
#special headers
include(CheckIncludeFiles)
check_include_files ("sys/fsuid.h" HAVE_SYS_FSUID_H)
if (HAVE_SYS_FSUID_H)
add_definitions (-DHAVE_SYS_FSUID_H)
endif (HAVE_SYS_FSUID_H)
#setup includes for building source
set(PLFS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(PLFS_TOOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tools")
set(PLFS_TESTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests")
set(PLFS_MAN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/man")
#BUILD_DIR is where we build from
set(PLFS_BUILD_DIR "${CMAKE_BINARY_DIR}")
#setup our output paths
set(EXECUTABLE_OUTPUT_PATH "${PLFS_BUILD_DIR}/bin")
set(LIBRARY_OUTPUT_PATH "${PLFS_BUILD_DIR}/lib")
#grab the plfs.h
include_directories (${PROJECT_BINARY_DIR})
#set includes for everything
include_directories (${PLFS_SOURCE_DIR})
include_directories (${PLFS_TOOLS_DIR})
#IOStore stuff
include_directories(${PLFS_SOURCE_DIR}/IOStore)
include_directories(${PLFS_SOURCE_DIR}/IOStore/Glib)
include_directories(${PLFS_SOURCE_DIR}/IOStore/Posix)
#Logical FDFS stuff
include_directories(${PLFS_SOURCE_DIR}/LogicalFS)
#Logical Container
include_directories(${PLFS_SOURCE_DIR}/LogicalFS/Container)
include_directories(${PLFS_SOURCE_DIR}/LogicalFS/Container/Index)
include_directories(${PLFS_SOURCE_DIR}/LogicalFS/Container/ByteRangeIndex)
include_directories(${PLFS_SOURCE_DIR}/LogicalFS/Container/MDHIMIndex)
include_directories(${PLFS_SOURCE_DIR}/LogicalFS/Container/PatternIndex)
#Logical Flatfile
include_directories(${PLFS_SOURCE_DIR}/LogicalFS/FlatFile)
#Logical Smallfile
include_directories(${PLFS_SOURCE_DIR}/LogicalFS/SmallFile)
include_directories(${PLFS_SOURCE_DIR}/LogicalFS/SmallFile/smallfile)
#Mlog
include_directories(${PLFS_SOURCE_DIR}/Mlog)
#Plfsrc
include_directories(${PLFS_SOURCE_DIR}/Plfsrc)
#user defined search paths
foreach(path ${CMAKE_INCLUDE_PATH})
include_directories(${path})
endforeach()
#set up extra definitions
add_definitions (-D_FILE_OFFSET_BITS=64)
#set up extra options
OPTION (DISABLE_FUSE "Disable Fuse." OFF)
message ("-- DISABLE_FUSE ${DISABLE_FUSE}")
OPTION (DISABLE_MLOG "Disable Mlog." OFF)
message ("-- DISABLE_MLOG ${DISABLE_MLOG}")
if (DISABLE_MLOG)
add_definitions (-DMLOG_NEVERLOG)
endif(DISABLE_MLOG)
OPTION (ADMIN_TOOLS "Install admin tools to SBINDIR." OFF)
message ("-- ADMIN_TOOLS set to ${ADMIN_TOOLS}")
OPTION (DISABLE_MLOG_MACRO_OPTS "Disable Macro Opts for MLOG." OFF)
message ("-- DISABLE_MLOG_MACRO_OPTS ${DISABLE_MLOG_MACRO_OPTS}")
if (DISABLE_MLOG_MACRO_OPTS)
add_definitions (-DMLOG_NOMACRO_OPT)
endif(DISABLE_MLOG_MACRO_OPTS)
OPTION (ENABLE_PLFS_STATS "Enable stats collection for plfs." OFF)
message ("-- ENABLE_PLFS_STATS ${ENABLE_PLFS_STATS}")
if (ENABLE_PLFS_STATS)
add_definitions(-DFUSE_COLLECT_TIMES -DUTIL_COLLECT_TIMES)
endif(ENABLE_PLFS_STATS)
OPTION (DISABLE_STATIC_LIB "Disable Building Static Libs." OFF)
message ("-- DISABLE_STATIC_LIB ${DISABLE_STATIC_LIB}")
OPTION (BUILD_HDFS "Build HDFS IOStore." OFF)
message ("-- BUILD_HDFS ${BUILD_HDFS}")
if (BUILD_HDFS)
find_package(JNI)
if (NOT JNI_FOUND)
message(FATAL_ERROR "JNI not found")
endif(NOT JNI_FOUND)
find_package(HDFS)
if (NOT HDFS_FOUND)
message(FATAL_ERROR "HDFS not found")
endif(NOT HDFS_FOUND)
endif(BUILD_HDFS)
OPTION (BUILD_PVFS "Build PVFS IOStore." OFF)
message ("-- BUILD_PVFS ${BUILD_PVFS}")
if (BUILD_PVFS)
find_package(PVFS)
if (NOT PVFS_FOUND)
message(FATAL_ERROR "PVFS not found")
endif(NOT PVFS_FOUND)
if (PVFS_NEEDSSL)
message("-- your PVFS needs openssl libs...")
find_package(OpenSSL)
if (NOT OPENSSL_FOUND)
message(FATAL_ERROR "cannot find OpenSSL lib!")
endif(NOT OPENSSL_FOUND)
# we must link with OPENSSL_LIBRARIES
SET(PVFS_LIBRARIES ${PVFS_LIBRARIES} ${OPENSSL_LIBRARIES})
endif(PVFS_NEEDSSL)
endif(BUILD_PVFS)
OPTION (BUILD_IOFSL "Build IOFSL IOStore." OFF)
message ("-- BUILD_IOFSL ${BUILD_IOFSL}")
find_package(FUSE)
if (BUILD_IOFSL)
find_package(IOFSL)
if (NOT IOFSL_FOUND)
message(FATAL_ERROR "IOFSL not found")
endif (NOT IOFSL_FOUND)
if (NOT FUSE_FOUND)
message(FATAL_ERROR "FUSE development headers not found")
endif (NOT FUSE_FOUND)
add_definitions(-DNDEBUG)
add_definitions(${FUSE_DEFINITIONS})
endif (BUILD_IOFSL)
#create the plfs library
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR} plfs_src_dir)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/IOStore iostore)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/IOStore/Glib iostore_glib)
if (BUILD_HDFS)
add_definitions(-DUSE_HDFS)
include_directories(${JNI_INCLUDE_DIRS})
include_directories(${HDFS_INCLUDE_DIR})
include_directories(${PLFS_SOURCE_DIR}/IOStore/HDFS)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/IOStore/HDFS iostore_hdfs)
endif(BUILD_HDFS)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/IOStore/Posix iostore_posix)
if (BUILD_PVFS)
add_definitions(-DUSE_PVFS)
include_directories(${PVFS_INCLUDE_DIR})
include_directories(${PLFS_SOURCE_DIR}/IOStore/PVFS)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/IOStore/PVFS iostore_pvfs)
endif(BUILD_PVFS)
if (BUILD_IOFSL)
add_definitions(-DUSE_IOFSL)
include_directories(${IOFSL_INCLUDE_DIR})
include_directories(${PLFS_SOURCE_DIR}/IOStore/FUSE)
include_directories(${PLFS_SOURCE_DIR}/IOStore/FUSE/IOFSL)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/IOStore/FUSE iostore_fuse)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/IOStore/FUSE/IOFSL iostore_iofsl)
endif (BUILD_IOFSL)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/LogicalFS logicalfs)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/LogicalFS/Container logicalfs_container)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/LogicalFS/Container/ByteRangeIndex container_br_index)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/LogicalFS/FlatFile logicalfs_flatfile)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/LogicalFS/SmallFile logicalfs_smallfile)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/LogicalFS/SmallFile/smallfile smallfile)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/Mlog mlog)
AUX_SOURCE_DIRECTORY(${PLFS_SOURCE_DIR}/Plfsrc plfsrc)
SET(SRCDIR ${plfs_src_dir} ${iostore} ${iostore_glib} ${iostore_hdfs}
${iostore_posix} ${iostore_pvfs} ${iostore_fuse} ${iostore_iofsl}
${logicalfs} ${logicalfs_container} ${container_br_index} ${logicalfs_flatfile}
${logicalfs_smallfile} ${smallfile} ${mlog} ${plfsrc}
)
#setup custom destination paths here so all targets will either be
#defined here or overridden by the user
if (CMAKE_INSTALL_PREFIX)
message ("-- CMAKE_INSTALL_PREFIX set to ${CMAKE_INSTALL_PREFIX}")
endif(CMAKE_INSTALL_PREFIX)
if (NOT LIBDIR OR LIBDIR STREQUAL "lib")
set (LIBDIR "lib/" CACHE PATH "Destination of all libraries")
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBDIR}")
else()
message("-- LIBDIR set to ${LIBDIR}")
set (CMAKE_INSTALL_RPATH ${LIBDIR})
endif()
if (NOT BINDIR)
set (BINDIR "bin/" CACHE PATH "Destination of all binaries")
else()
message("-- BINDIR set to ${BINDIR}")
endif()
if (NOT SBINDIR)
set (SBINDIR "sbin/" CACHE PATH "Destination of all system binaries")
else()
message("-- SBINDIR set to ${SBINDIR}")
endif()
if (NOT INCLUDEDIR)
set (INCLUDEDIR "include/" CACHE PATH "Destination of all includes")
else()
message("-- INCLUDEDIR set to ${INCLUDEDIR}")
endif()
if (NOT MANDIR)
set (MANDIR "share/man/" CACHE PATH "Destination of all manpages")
else()
message("-- MANDIR set to ${MANDIR}")
endif()
if (NOT ADMIN_TOOLS)
message("-- ADMIN_TOOLS not set, admin tools will not be installed")
endif()
#setup RPATH/RUNPATH flags and shared library
if (NOT APPLE)
set (CMAKE_EXE_LINKER_FLAGS "-dynamic -Wl,--enable-new-dtags")
set (CMAKE_SHARED_LINKER_FLAGS "-dynamic -Wl,--enable-new-dtags")
set (CMAKE_MODULE_LINKER_FLAGS "-dynamic -Wl,--enable-new-dtags")
endif()
#yaml-cpp which we call plfs-yaml to avoid conflicts
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/src/Plfsrc/yaml-cpp ${PLFS_BUILD_DIR}/yaml-cpp)
include_directories (src/Plfsrc/yaml-cpp/include)
include_directories (src/Plfsrc/yaml-cpp/boost)
#static and shared both same name
add_library(plfs_lib SHARED ${SRCDIR} ${sources} ${public_headers}
${private_headers} ${contrib_headers} ${contrib_public_headers}
${contrib_private_headers})
SET_TARGET_PROPERTIES(plfs_lib PROPERTIES OUTPUT_NAME plfs)
set_target_properties(plfs_lib PROPERTIES
VERSION "${plfs_VERSION_FULL}"
SOVERSION "${plfs_VERSION_MAJOR}.${plfs_VERSION_MINOR}"
PROJECT_LABEL "plfs_lib shared")
#target_link_libraries (plfs_lib plfs-yaml)
if (NOT DISABLE_STATIC_LIB)
add_library(plfs_lib_static STATIC ${SRCDIR} ${sources} ${public_headers}
${private_headers} ${contrib_headers} ${contrib_public_headers}
${contrib_private_headers})
#make sure these build first, causes issues in 2.6
#if not
add_dependencies(plfs_lib plfs_lib_static)
INSTALL(TARGETS plfs_lib plfs_lib_static
LIBRARY DESTINATION ${LIBDIR}
ARCHIVE DESTINATION ${LIBDIR})
SET_TARGET_PROPERTIES(plfs_lib_static PROPERTIES OUTPUT_NAME plfs)
set_target_properties(plfs_lib_static PROPERTIES
VERSION "${plfs_VERSION_FULL}"
SOVERSION "${plfs_VERSION_MAJOR}.${plfs_VERSION_MINOR}"
PROJECT_LABEL "plfs_lib static")
# target_link_libraries(plfs_lib_static plfs-yaml-static)
else()
INSTALL(TARGETS plfs_lib
LIBRARY DESTINATION ${LIBDIR})
endif(NOT DISABLE_STATIC_LIB)
#zlib
find_package (ZLIB REQUIRED)
if (ZLIB_FOUND)
target_link_libraries (plfs_lib ${ZLIB_LIBRARIES})
endif (ZLIB_FOUND)
#pthread
find_package (Threads REQUIRED)
if (Threads_FOUND)
target_link_libraries (plfs_lib ${CMAKE_THREAD_LIBS_INIT})
endif (Threads_FOUND)
#statvfs
check_include_files(sys/statvfs.h HAVE_SYS_STATVFS_H)
if (HAVE_SYS_STATVFS_H)
set (STATVFS "#include <sys/statvfs.h>")
endif (HAVE_SYS_STATVFS_H)
configure_file (
"${PLFS_SOURCE_DIR}/plfs.h.in"
"${PROJECT_BINARY_DIR}/plfs.h"
)
#fuse
if (FUSE_FOUND AND NOT DISABLE_FUSE)
message("-- FUSE found")
#build fuse
AUX_SOURCE_DIRECTORY(fuse plfs_fuse_dir)
add_executable (plfs_fuse ${plfs_fuse_dir})
add_definitions(${FUSE_DEFINITIONS})
include_directories (${FUSE_INCLUDE_DIR})
target_link_libraries (plfs_fuse ${FUSE_LIBRARIES})
target_link_libraries (plfs_fuse plfs_lib)
if (BUILD_HDFS)
target_link_libraries (plfs_fuse ${JAVA_JVM_LIBRARY})
target_link_libraries (plfs_fuse ${HDFS_LIBS})
endif(BUILD_HDFS)
if (BUILD_PVFS)
target_link_libraries (plfs_fuse ${PVFS_LIBRARIES})
endif(BUILD_PVFS)
if (BUILD_IOFSL)
target_link_libraries (plfs_fuse ${IOFSL_LIBRARIES})
endif (BUILD_IOFSL)
#change its name so that it create plfs executable
SET_TARGET_PROPERTIES(plfs_fuse PROPERTIES OUTPUT_NAME plfs)
#set install dir
INSTALL(TARGETS plfs_fuse DESTINATION ${SBINDIR})
elseif (NOT DISABLE_FUSE)
message(FATAL_ERROR "FUSE not found and DISABLE_FUSE not specified")
endif(FUSE_FOUND AND NOT DISABLE_FUSE)
#helper tools
foreach (SOURCE dcon.c findmesgbuf.c plfs_check_config.cpp plfs_ls.cpp
plfs_flatten_index.cpp plfs_map.cpp plfs_query.cpp plfs_recover.cpp
plfs_version.cpp)
get_filename_component(PROG ${SOURCE} NAME_WE)
add_executable(${PROG} ${PLFS_TOOLS_DIR}/${SOURCE})
target_link_libraries (${PROG} plfs_lib)
if (BUILD_HDFS)
target_link_libraries (${PROG} ${JAVA_JVM_LIBRARY})
target_link_libraries (${PROG} ${HDFS_LIBS})
endif(BUILD_HDFS)
if (BUILD_PVFS)
target_link_libraries (${PROG} ${PVFS_LIBRARIES})
endif(BUILD_PVFS)
if (BUILD_IOFSL)
target_link_libraries (${PROG} ${IOFSL_LIBRARIES})
endif(BUILD_IOFSL)
endforeach(SOURCE)
#test tools
add_subdirectory("${PLFS_TESTS_DIR}")
#analysis
if($ENV{PLFS_ACE})
message("-- PLFS_ACE set, building analysis tools")
set(PLFS_ANALYSIS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/analysis")
add_subdirectory("${PLFS_ANALYSIS_DIR}")
else()
message("-- PLFS_ACE environment variable not set,
analysis tools will not be built")
endif()
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
#set devloper compiler options
#ALL developers should build in debug mode by default
set(CMAKE_CXX_FLAGS "-Wall -Werror -Wshadow -Wno-long-long -Wextra ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "-Wall -Werror -Wshadow -Wno-long-long -Wextra ${CMAKE_C_FLAGS}")
endif()
# setup targets for user-level tools
INSTALL(TARGETS plfs_check_config plfs_flatten_index plfs_ls plfs_version
DESTINATION ${BINDIR}
)
# only install admin toolset if defined
if (ADMIN_TOOLS)
INSTALL(TARGETS dcon findmesgbuf plfs_map plfs_query plfs_recover
DESTINATION ${SBINDIR})
endif()
INSTALL(FILES "${PLFS_BUILD_DIR}/plfs.h" DESTINATION ${INCLUDEDIR})
INSTALL(FILES "${PLFS_SOURCE_DIR}/plfs_error.h" DESTINATION ${INCLUDEDIR})
INSTALL(FILES "${PLFS_SOURCE_DIR}/Mlog/mlogfacs.h"
"${PLFS_SOURCE_DIR}/plfs_internal.h"
"${PLFS_SOURCE_DIR}/Util.h"
"${PLFS_SOURCE_DIR}/COPYRIGHT.h" DESTINATION ${INCLUDEDIR}/plfs)
#man pages
add_subdirectory("${PLFS_MAN_DIR}")
FILE(GLOB man1 ${PLFS_BUILD_DIR}/share/man/man1/*.1)
FILE(GLOB man3 ${PLFS_BUILD_DIR}/share/man/man3/*.3)
FILE(GLOB man5 ${PLFS_BUILD_DIR}/share/man/man5/*.5)
FILE(GLOB man7 ${PLFS_BUILD_DIR}/share/man/man7/*.7)
INSTALL(FILES ${man1} DESTINATION ${MANDIR}/man1)
INSTALL(FILES ${man3} DESTINATION ${MANDIR}/man3)
INSTALL(FILES ${man5} DESTINATION ${MANDIR}/man5)
INSTALL(FILES ${man7} DESTINATION ${MANDIR}/man7)
#build patches
message("-- Generating ad_plfs patches")
execute_process(COMMAND ./scripts/make_ad_plfs_patch
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/mpi_adio OUTPUT_QUIET)
execute_process(COMMAND ./scripts/make_ad_plfs_patch --mpi=mpich
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/mpi_adio OUTPUT_QUIET)
#if we ever move to cmake 2.8 this would be a cool feature.
#set up rpm build process
#set(CPACK_PACKAGE_VERSION ${plfs_VERSION_FULL})
#set(CPACK_GENERATOR "RPM")
#set(CPACK_PACKAGE_NAME "plfs")
#set(CPACK_PACKAGE_RELEASE 1)
#set(CPACK_PACKAGE_CONTACT "Aaron Torres")
#set(CPACK_PACKAGE_VENDOR "Los Alamos National Laboratory")
#set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
#set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
#configure_file("${CMAKE_CURRENT_SOURCE_DIR}/plfs.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/plfs.spec" @ONLY IMMEDIATE)
#set(CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/plfs.spec")
#include(CPack)