-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
44 lines (35 loc) · 1.13 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
cmake_minimum_required (VERSION 3.3)
project (asn1cpp)
add_definitions(
-std=c++11
-Wall
-Wextra
)
set(ASN_OPTIONS -fwide-types -gen-PER)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
# Add library directories
include_directories(${PROJECT_SOURCE_DIR}/include)
if (NOT DEFINED MAKE_TESTS)
set(MAKE_TESTS 1)
endif()
# If enabled, add tests
if (MAKE_TESTS)
if (NOT EXISTS ${PROJECT_SOURCE_DIR}/deps/asn1c/.git)
message(FATAL_ERROR "Asn1c repo not initialized, did you run 'git submodule init; git submodule update'?")
endif()
# Add and compile asn1c
include(ExternalProject)
ExternalProject_Add(asn1c
SOURCE_DIR ${PROJECT_SOURCE_DIR}/deps/asn1c
CONFIGURE_COMMAND ${PROJECT_SOURCE_DIR}/deps/asn1c/configure --prefix=${PROJECT_BINARY_DIR}
BUILD_COMMAND ${MAKE}
)
ExternalProject_Add_Step(asn1c autoreconf
COMMAND autoreconf -iv
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/deps/asn1c/
DEPENDERS configure
)
include(CTest)
add_subdirectory (${PROJECT_SOURCE_DIR}/test)
endif()