forked from zeek/binpac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (49 loc) · 1.89 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
project(BinPAC C CXX)
cmake_minimum_required(VERSION 2.6.3 FATAL_ERROR)
include(cmake/CommonCMakeConfig.cmake)
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" BINPAC_VERSION LIMIT_COUNT 1)
########################################################################
## Dependency Configuration
include(FindRequiredPackage)
FindRequiredPackage(FLEX)
FindRequiredPackage(BISON)
if (MISSING_PREREQS)
foreach (prereq ${MISSING_PREREQ_DESCS})
message(SEND_ERROR ${prereq})
endforeach ()
message(FATAL_ERROR "Configuration aborted due to missing prerequisites")
endif ()
########################################################################
## System Introspection
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
########################################################################
## Recurse on sub-directories
add_subdirectory(lib)
add_subdirectory(src)
########################################################################
## Build Summary
if (BinPAC_SKIP_INSTALL)
set(binpac_install_summary "Install skipped")
else ()
set(binpac_install_summary "${CMAKE_INSTALL_PREFIX}")
endif ()
if (CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} BuildType)
endif ()
message(
"\n==================| BinPAC Build Summary |===================="
"\n"
"\nInstall prefix: ${binpac_install_summary}"
"\nDebug mode: ${ENABLE_DEBUG}"
"\n"
"\nCC: ${CMAKE_C_COMPILER}"
"\nCFLAGS: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BuildType}}"
"\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}"
"\nCPP: ${CMAKE_CXX_COMPILER}"
"\n"
"\n================================================================\n"
)
include(UserChangedWarning)