mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
binpac: Minor style changes.
This commit is contained in:
parent
32db4e4447
commit
8366dd6bcb
2 changed files with 20 additions and 29 deletions
|
@ -1,12 +1,10 @@
|
|||
##
|
||||
########################################################################
|
||||
## CMake Configuration
|
||||
##
|
||||
|
||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
|
||||
# Prohibit in-source builds.
|
||||
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" source_build)
|
||||
if (source_build)
|
||||
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
message(FATAL_ERROR "In-source builds are not allowed. Please use "
|
||||
"./configure to choose a build directory and "
|
||||
"initialize the build configuration.")
|
||||
|
@ -28,12 +26,13 @@ include(${build_options_file})
|
|||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
##
|
||||
## Project Configuration
|
||||
##
|
||||
########################################################################
|
||||
## Project/Build Configuration
|
||||
|
||||
project(BinPAC)
|
||||
|
||||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" BINPAC_VERSION LIMIT_COUNT 1)
|
||||
|
||||
if (ENABLE_DEBUG AND ENABLE_RELEASE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo)
|
||||
elseif (ENABLE_DEBUG AND NOT ENABLE_RELEASE)
|
||||
|
@ -57,34 +56,28 @@ if (NOT EXTRA_COMPILE_FLAGS)
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILE_FLAGS}")
|
||||
endif ()
|
||||
|
||||
##
|
||||
########################################################################
|
||||
## Dependency Configuration
|
||||
##
|
||||
|
||||
find_package(FLEX REQUIRED)
|
||||
find_package(BISON REQUIRED)
|
||||
|
||||
##
|
||||
## Configuration Checks/Tests
|
||||
##
|
||||
|
||||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" BINPAC_VERSION LIMIT_COUNT 1)
|
||||
########################################################################
|
||||
## System Introspection
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
##
|
||||
## Recuse on sub-directories
|
||||
##
|
||||
########################################################################
|
||||
## Recurse on sub-directories
|
||||
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(src)
|
||||
|
||||
##
|
||||
########################################################################
|
||||
## Build Summary
|
||||
##
|
||||
|
||||
if (BinPAC_SKIP_INSTALL)
|
||||
set(binpac_install_summary "Install skipped")
|
||||
|
|
|
@ -9,10 +9,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/binpac.h.in
|
|||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(binpac_lib_SRCS
|
||||
binpac_buffer.cc
|
||||
binpac_bytestring.cc
|
||||
set(binpac_headers
|
||||
${CMAKE_CURRENT_BINARY_DIR}/binpac.h
|
||||
binpac_analyzer.h
|
||||
binpac_buffer.h
|
||||
|
@ -21,6 +18,12 @@ set(binpac_lib_SRCS
|
|||
binpac_regex.h
|
||||
)
|
||||
|
||||
set(binpac_lib_SRCS
|
||||
binpac_buffer.cc
|
||||
binpac_bytestring.cc
|
||||
${binpac_headers}
|
||||
)
|
||||
|
||||
add_library(binpac_lib STATIC ${binpac_lib_SRCS})
|
||||
|
||||
set_target_properties(binpac_lib PROPERTIES OUTPUT_NAME binpac)
|
||||
|
@ -28,12 +31,7 @@ set_target_properties(binpac_lib PROPERTIES OUTPUT_NAME binpac)
|
|||
if (NOT BinPAC_SKIP_INSTALL)
|
||||
install(TARGETS binpac_lib DESTINATION lib)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/binpac.h
|
||||
binpac_analyzer.h
|
||||
binpac_buffer.h
|
||||
binpac_bytestring.h
|
||||
binpac_exception.h
|
||||
binpac_regex.h
|
||||
${binpac_headers}
|
||||
DESTINATION
|
||||
include
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue