This repository has been archived by the owner on Feb 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (43 loc) · 1.54 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
## CMakeLists.txt
## Stanisław Grams <sgrams@fmdx.pl>
##
## secpass.org
## © 2019
cmake_minimum_required (VERSION 2.8.11)
project (secpass)
set (PACKAGE ${PROJECT_NAME})
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
add_definitions (-Wall)
add_definitions (-Wextra)
add_definitions (-Wno-unused-parameter)
add_definitions (-Wsign-compare)
endif ()
set (SGX_SDK $ENV{SGX_SDK})
set (SGX_ARCH x64)
set (SGX_MODE SIM CACHE STRING "SGX mode: SIM or HW") # SGX mode: sim, hw
set (COMPILE_EXAMPLES NO CACHE BOOL "Build examples")
set (SGX_BUILD DEBUG CACHE STRING "Build: DEBUG, PRERELEASE or RELEASE")
include (cmake/sgx_init.cmake)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
# Gather all src files from subdirs
function (add_src_files list)
get_property (is_defined GLOBAL PROPERTY SRC_LIST DEFINED)
if (NOT is_defined)
define_property (GLOBAL PROPERTY ${list}
BRIEF_DOCS "List of source files"
FULL_DOCS "List of source files to be compiled in one library")
endif ()
# make absolute paths
set (SRC)
foreach (s IN LISTS ARGN)
if (NOT IS_ABSOLUTE "${s}")
get_filename_component (s "${s}" ABSOLUTE)
endif ()
list (APPEND SRC "${s}")
endforeach ()
# append to global list
set_property (GLOBAL APPEND PROPERTY ${list} "${SRC}")
endfunction (add_src_files)
add_subdirectory (src)