-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (26 loc) · 1.32 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
cmake_minimum_required(VERSION 3.1.3)
project(pokertools-cpp VERSION 0.1)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wno-unused-parameter")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
aux_source_directory(src LIB_SOURCES)
file(GLOB LIB_HEADERS include/pokertools-cpp/*.hpp)
include_directories(include)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/test)
add_library(${PROJECT_NAME}-shared SHARED ${LIB_SOURCES} ${LIB_HEADERS})
set_target_properties(${PROJECT_NAME}-shared PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
add_library(${PROJECT_NAME}-static ${LIB_SOURCES} ${LIB_HEADERS})
set_target_properties(${PROJECT_NAME}-static PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
function(add_test_pt TARGET)
add_executable(${TARGET} ${ARGN})
target_link_libraries(${TARGET} pthread)
add_test(${TARGET} ${TARGET})
endfunction()
add_test_pt(test-performance ${LIB_SOURCES} ${LIB_HEADERS} test/performance.cpp)
add_test_pt(test-correctness ${LIB_SOURCES} ${LIB_HEADERS} test/correctness.cpp)
add_test_pt(test-sample-usage ${LIB_SOURCES} ${LIB_HEADERS} test/sample-usage.cpp)