2017-11-12 11:49:13 +00:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
2016-12-03 07:51:00 +00:00
|
|
|
project(XCDAT)
|
|
|
|
|
2017-11-12 11:49:13 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2016-12-03 07:51:00 +00:00
|
|
|
|
2017-07-12 06:48:49 +00:00
|
|
|
if (NOT CMAKE_BUILD_TYPE)
|
2016-12-03 07:51:00 +00:00
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
2017-07-12 06:48:49 +00:00
|
|
|
endif ()
|
2016-12-03 07:51:00 +00:00
|
|
|
|
2017-07-12 06:48:49 +00:00
|
|
|
configure_file(
|
|
|
|
${XCDAT_SOURCE_DIR}/xcdat_config.hpp.in
|
2017-11-12 11:49:13 +00:00
|
|
|
${XCDAT_SOURCE_DIR}/include/xcdat/xcdat_config.hpp
|
2017-07-12 06:48:49 +00:00
|
|
|
)
|
2017-03-30 04:21:46 +00:00
|
|
|
|
2017-11-17 14:34:45 +00:00
|
|
|
message(STATUS "XCDAT_SOURCE_DIR is ${XCDAT_SOURCE_DIR}")
|
|
|
|
|
2017-07-12 06:48:49 +00:00
|
|
|
option(XCDAT_X64
|
2017-11-12 11:49:13 +00:00
|
|
|
"Use 64-bit integers for node representation."
|
2017-07-12 06:48:49 +00:00
|
|
|
OFF)
|
|
|
|
|
|
|
|
option(XCDAT_USE_POPCNT
|
|
|
|
"Use popcount intrinsic. Available on x86-64 since SSE4.2."
|
|
|
|
OFF)
|
|
|
|
|
|
|
|
if (XCDAT_USE_POPCNT)
|
|
|
|
if (UNIX)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2")
|
|
|
|
endif ()
|
|
|
|
endif ()
|
2017-03-29 06:01:06 +00:00
|
|
|
|
2016-12-03 07:51:00 +00:00
|
|
|
message(STATUS "BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
|
2017-07-12 06:48:49 +00:00
|
|
|
message(STATUS "CXX_FLAGS are ${CMAKE_CXX_FLAGS}")
|
|
|
|
message(STATUS "CXX_FLAGS_DEBUG are ${CMAKE_CXX_FLAGS_DEBUG}")
|
|
|
|
message(STATUS "CXX_FLAGS_RELEASE are ${CMAKE_CXX_FLAGS_RELEASE}")
|
|
|
|
message(STATUS "XCDAT_X64 is ${XCDAT_X64}")
|
|
|
|
message(STATUS "XCDAT_USE_POPCNT is ${XCDAT_USE_POPCNT}")
|
|
|
|
|
2017-11-12 11:49:13 +00:00
|
|
|
file(GLOB HEADER_FILES include/xcdat/*.hpp)
|
2017-11-18 04:32:20 +00:00
|
|
|
file(GLOB SOURCE_FILES src/*.cpp)
|
2017-07-12 06:48:49 +00:00
|
|
|
|
2017-11-12 11:49:13 +00:00
|
|
|
include_directories(include)
|
2017-07-12 06:48:49 +00:00
|
|
|
add_library(xcdat STATIC ${HEADER_FILES} ${SOURCE_FILES})
|
|
|
|
|
2017-11-12 14:20:38 +00:00
|
|
|
add_subdirectory(tool)
|
2017-11-17 14:34:45 +00:00
|
|
|
add_subdirectory(sample)
|
2016-12-03 07:51:00 +00:00
|
|
|
|
|
|
|
enable_testing()
|
2017-11-12 11:49:13 +00:00
|
|
|
add_subdirectory(test)
|
2017-07-12 06:48:49 +00:00
|
|
|
|
2017-11-12 11:49:13 +00:00
|
|
|
install(FILES include/xcdat.hpp DESTINATION include)
|
|
|
|
install(FILES ${HEADER_FILES} DESTINATION include/xcdat)
|
2017-11-17 14:34:45 +00:00
|
|
|
|
|
|
|
install(TARGETS xcdat
|
|
|
|
EXPORT xcdat-targets
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
RUNTIME DESTINATION bin)
|
|
|
|
|
|
|
|
install(EXPORT xcdat-targets
|
|
|
|
FILE xcdat-config.cmake
|
|
|
|
DESTINATION lib/cmake/xcdat)
|