From 8ca3b21e389fe83fd4eba2655316f4f6b63d9e72 Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Wed, 23 Oct 2019 23:37:08 +0300 Subject: cmake: restore project --- CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 430c7ee4..08a1c069 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,4 +22,41 @@ project(${PROJECT_NAME} set(${PROJECT_NAME}_MAKE_INSTALL ON CACHE BOOL "Set to OFF to disable install rules (default is ON)") +set(${PROJECT_NAME}_BUILD_EXAMPLES OFF CACHE BOOL + "Set to ON to build examples (default is OFF)") + +# Check type size +include(CheckTypeSize) +check_type_size("int" SIZEOF_INT) +check_type_size("long" SIZEOF_LONG) +check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG) +check_type_size("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG) +check_type_size("void *" SIZEOF_VOID_P) + +# Check system headers +include(CheckIncludeFile) +check_include_file(sys/mman.h HAVE_SYS_MMAN_H) +check_include_file(sys/wait.h HAVE_SYS_WAIT_H) +check_include_file(unistd.h HAVE_UNISTD_H) + +# Prepare settings +if("${CMAKE_BUILD_TYPE}" MATCHES "[Dd][Ee][Bb]") + set(DEBUG 1) +endif() +set(VERSION "${PROJECT_VERSION}") +set(PUBDATE "${PROJECT_PUBDATE}") + +# Common compile definitions +set(common_COMPILE_DEFINITIONS PREFIX="${CMAKE_INSTALL_PREFIX}") + add_subdirectory(src) + +add_subdirectory(colm) +add_library(colm::libcolm ALIAS libcolm) +add_executable(colm::colm ALIAS colm) + +add_subdirectory(ragel) + +if(${PROJECT_NAME}_BUILD_EXAMPLES) + add_subdirectory(examples) +endif() -- cgit v1.2.1