Crow/CMakeLists.txt

59 lines
1.8 KiB
CMake
Raw Normal View History

2014-08-06 16:18:33 +00:00
cmake_minimum_required(VERSION 2.8)
project (crow_all)
2016-11-19 11:02:04 +00:00
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
2014-08-14 23:22:02 +00:00
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
find_package(Tcmalloc)
find_package(Threads)
find_package(OpenSSL)
if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
endif()
2014-08-06 16:18:33 +00:00
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
2014-08-06 16:18:33 +00:00
if (MSVC)
set(Boost_USE_STATIC_LIBS "On")
find_package( Boost 1.52 COMPONENTS system thread regex REQUIRED )
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++1y -pedantic -Wextra")
find_package( Boost 1.52 COMPONENTS system thread REQUIRED )
endif()
2014-08-06 19:46:28 +00:00
include_directories( ${Boost_INCLUDE_DIR} )
2014-08-06 16:18:33 +00:00
set(PROJECT_INCLUDE_DIR
${PROJECT_SOURCE_DIR}/include
)
include_directories("${PROJECT_INCLUDE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}")
#add_subdirectory(src)
2014-08-06 16:18:33 +00:00
add_subdirectory(examples)
if (MSVC)
else()
add_subdirectory(tests)
2014-08-06 19:46:28 +00:00
enable_testing()
add_test(NAME crow_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tests/unittest)
add_test(NAME template_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tests/template/test.py WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests/template)
2014-08-07 16:14:27 +00:00
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/amalgamate)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/amalgamate/crow_all.h
COMMAND python ${PROJECT_SOURCE_DIR}/amalgamate/merge_all.py ${PROJECT_SOURCE_DIR}/include
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/amalgamate/crow_all.h ${PROJECT_SOURCE_DIR}/amalgamate
2014-08-07 16:14:27 +00:00
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/amalgamate
DEPENDS ${PROJECT_SOURCE_DIR}/include/*.h
2014-08-07 16:14:27 +00:00
)
add_custom_target(amalgamation ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/amalgamate/crow_all.h)
endif()