-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathCMakeLists.txt
69 lines (58 loc) · 3.29 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
cmake_minimum_required( VERSION 2.6 FATAL_ERROR )
#
# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their
# definition # and dump it in the cache along with proper documentation,
# otherwise set CMAKE_BUILD_TYPE # to Debug prior to calling PROJECT()
#
IF(DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ELSE()
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ENDIF()
PROJECT(CUV CXX C)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeModules )
EXECUTE_PROCESS(COMMAND "date" "+%Y%m%d%H%M" OUTPUT_VARIABLE DATESTR)
string(REGEX REPLACE "^(....)(..)(..)(..)(..).*" "\\1\\2\\3\\4\\5" DATESTR ${DATESTR})
SET(LIB_SUFFIX "")
#IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
#SET(LIB_SUFFIX _dbg)
#ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_SOURCE_GENERATOR "DEB")
SET(CPACK_GENERATOR "DEB")
#SET(CPACK_PACKAGE_NAME "cuv${LIB_SUFFIX}")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "N-dimensional array datastructures and algorithms on CPU and GPU")
SET(CPACK_PACKAGE_VENDOR "Hannes Schulz")
SET(CPACK_PACKAGE_CONTACT "Hannes Schulz <[email protected]>")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README")
IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
ENDIF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "9")
SET(CPACK_PACKAGE_VERSION_PATCH ${DATESTR})
SET(CPACK_SOURCE_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES};cfg/config.h;${CMAKE_SOURCE_DIR}/.git;${CMAKE_SOURCE_DIR}/src/matrix_ops/spmv_kernel_inst.cuh;${CMAKE_SOURCE_DIR}/src/matrix_ops/spmv_kernel_inst.cuh-;${CMAKE_SOURCE_DIR}/build;${CMAKE_SOURCE_DIR}/debug")
SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}${LIB_SUFFIX}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET (CPACK_OUTPUT_FILE_PREFIX "../..")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Hannes Schulz <[email protected]>")
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/prerm;")
#SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;")
#SET(CPACK_PACKAGE_INSTALL_DIRECTORY "cuv${LIB_SUFFIX}")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev, libblas-dev, libpng-dev, libjpeg-dev" )
SET(CPACK_DEBIAN_PACKAGE_SUGGESTS "cimg-dev, python-dev, libboost-python-dev" )
INCLUDE(CPack)
FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_BINARY_DIR}/docs/Doxyfile)
ADD_CUSTOM_COMMAND(
DEPENDS ${CMAKE_BINARY_DIR}/docs/Doxyfile
OUTPUT ${CMAKE_BINARY_DIR}/docs/html/index.html
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/docs/Doxyfile
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ADD_CUSTOM_TARGET(doc DEPENDS ${CMAKE_BINARY_DIR}/docs/html/index.html ${CMAKE_BINARY_DIR}/docs/Doxyfile)
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/docs/html DESTINATION share/doc/libcuv-doc)
ENDIF(DOXYGEN_FOUND)
ENABLE_TESTING()
add_subdirectory(src)