CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(KazBase)

FILE(GLOB_RECURSE KAZBASE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/kazbase/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kazbase/depends/*.c)

SET(CMAKE_C_FLAGS "-DHAVE_CONFIG_H")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread -g")

FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(PCRE REQUIRED libpcre)

LINK_LIBRARIES(${PCRE_LIBRARIES})

ADD_LIBRARY(kazbase SHARED ${KAZBASE_SOURCES})

ADD_SUBDIRECTORY(tests)

INSTALL(DIRECTORY kazbase/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/kazbase FILES_MATCHING REGEX ".*\\.(hpp|h)$")
INSTALL(FILES ${CMAKE_SOURCE_DIR}/KAZBASEConfig.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/kazbase)
INSTALL(TARGETS kazbase DESTINATION lib)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(KazBase)

FILE(GLOB_RECURSE KAZBASE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/kazbase/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kazbase/depends/*.c)

SET(CMAKE_C_FLAGS "-DHAVE_CONFIG_H")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -pthread -g")

FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(PCRE REQUIRED libpcre)

LINK_LIBRARIES(${PCRE_LIBRARIES})

ADD_LIBRARY(kazbase SHARED ${KAZBASE_SOURCES})

ADD_SUBDIRECTORY(tests)

INSTALL(DIRECTORY kazbase/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/kazbase FILES_MATCHING REGEX ".*\\.(hpp|h)$")
INSTALL(FILES ${CMAKE_SOURCE_DIR}/KAZBASEConfig.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/kazbase)
INSTALL(TARGETS kazbase DESTINATION lib)

Use c++1y rather than c++14 for backwards compatibilty
Use c++1y rather than c++14 for backwards compatibilty
