-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
79 lines (59 loc) · 2.28 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
cmake_minimum_required (VERSION 3.7)
project (eml VERSION 1.1)
include(FindPkgConfig)
include(CheckIncludeFiles) # AC_CHECK_INCLUDE equivalent (verifies if file.h exists)
include(CheckFunctionExists) # Checks existence of a function in a lib
include(CMakeDependentOption)
include(GNUInstallDirs) # gnu lib tree
macro(print_all_variables)
message(STATUS "print_all_variables------------------------------------------{")
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
message(STATUS "print_all_variables------------------------------------------}")
endmacro()
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules
)
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-std=c99)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
include_directories("${PROJECT_SOURCE_DIR}/config")
include_directories("${PROJECT_SOURCE_DIR}/src")
include_directories("${PROJECT_SOURCE_DIR}/include")
foreach(LIB ${COMMA_SEPARATED_LIST})
set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
endforeach()
configure_file(config/eml.pc.in eml.pc @ONLY)
pkg_search_module(CONFUSE REQUIRED libconfuse)
check_include_files(nvml.h HAVE_NVML)
check_include_files(miclib.h HAVE_MIC)
set(JAVA_AWT_LIBRARY NotNeeded)
set(JAVA_JVM_LIBRARY NotNeeded)
set(JAVA_INCLUDE_PATH2 NotNeeded)
set(JAVA_AWT_INCLUDE_PATH NotNeeded)
find_package(JNI)
find_package(Doxygen)
option(BUILD_DOCUMENTATION "Create and install the HTML based API
documentation (requires Doxygen)" ${DOXYGEN_FOUND})
if(BUILD_DOCUMENTATION)
if(NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen is needed to build the documentation.")
endif()
set(doxyfile_in config/Doxyfile.in)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/config/Doxyfile)
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
message("Doxygen build started.")
add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
endif()
add_subdirectory(src)
add_subdirectory(utils)
#print_all_variables()