File: CMakeLists.txt

package info (click to toggle)
pentobi 29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,892 kB
  • sloc: cpp: 25,719; javascript: 875; xml: 40; makefile: 13; sh: 6
file content (68 lines) | stat: -rw-r--r-- 1,976 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 3.22)

project(pentobi CXX)
set(PENTOBI_VERSION_MAJOR 29)
set(PENTOBI_VERSION_MINOR 0)
set(PENTOBI_IS_RELEASE TRUE)
set(PENTOBI_VERSION ${PENTOBI_VERSION_MAJOR}.${PENTOBI_VERSION_MINOR})
if(NOT PENTOBI_IS_RELEASE)
    string(APPEND PENTOBI_VERSION "-dev")
endif()

include(GNUInstallDirs)

option(PENTOBI_BUILD_GUI "Build GUI" ON)
option(PENTOBI_BUILD_GTP "Build GTP interface" OFF)
option(BUILD_TESTING "Build tests" OFF)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS "No build type selected, default to Release")
  set(CMAKE_BUILD_TYPE Release)
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(BUILD_TESTING)
  enable_testing()
endif()

if(UNIX)
  add_custom_target(dist
    COMMAND git archive --prefix=pentobi-${PENTOBI_VERSION}/ HEAD
    | xz -e > ${CMAKE_BINARY_DIR}/pentobi-${PENTOBI_VERSION}.tar.xz
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif()

find_package(Threads)
add_subdirectory(libboardgame_base)
add_subdirectory(libboardgame_mcts)
add_subdirectory(libpentobi_base)
add_subdirectory(libpentobi_mcts)
if(BUILD_TESTING)
    add_subdirectory(libboardgame_test)
endif()
if(PENTOBI_BUILD_GTP)
    add_subdirectory(libboardgame_gtp)
    add_subdirectory(libpentobi_gtp)
    add_subdirectory(pentobi_gtp)
    if(UNIX)
        add_subdirectory(twogtp)
    else()
        message(STATUS "Not building twogtp, needs POSIX")
    endif()
    add_subdirectory(learn_tool)
endif()
if(PENTOBI_BUILD_GUI)
    find_package(Gettext 0.19.6 REQUIRED)
    find_program(ITSTOOL itstool REQUIRED)
    find_program(RSVG_CONVERT rsvg-convert REQUIRED)
    set(CMAKE_AUTORCC ON)
    find_package(Qt6 REQUIRED COMPONENTS
        Concurrent LinguistTools QuickControls2 Xml)
    if(ANDROID AND Qt6Core_VERSION VERSION_GREATER_EQUAL "6.10.0")
        find_package(Qt6 REQUIRED COMPONENTS CorePrivate)
    endif()
    qt_standard_project_setup(REQUIRES 6.9)
    add_subdirectory(pentobi)
endif()