-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
80 lines (57 loc) · 2.18 KB
/
Copy pathCMakeLists.txt
File metadata and controls
80 lines (57 loc) · 2.18 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
# ----------------------------------------------------------------------------
# PyAOgmaNeo
# Copyright(c) 2020-2025 Ogma Intelligent Systems Corp. All rights reserved.
#
# This copy of PyAOgmaNeo is licensed to you under the terms described
# in the PYAOGMANEO_LICENSE.md file included in this distribution.
# ----------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.24)
project(pyaogmaneo)
include(FetchContent)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake/")
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_BUILD_TYPE)
message("CMAKE_BUILD_TYPE not set, setting it to Release")
set(CMAKE_BUILD_TYPE Release)
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
if(USE_SYSTEM_AOGMANEO)
message(STATUS "Using system installation of AOgmaNeo")
find_package(AOgmaNeo)
else()
message(STATUS "Not using system installation of AOgmaNeo, will download from repository")
FetchContent_Declare(
AOgmaNeo
GIT_REPOSITORY https://github.com/ogmacorp/AOgmaNeo.git
GIT_TAG 906c958201b76b0cc34165bd2d0d6b1c6ed98d81
)
FetchContent_MakeAvailable(AOgmaNeo)
endif()
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG origin/master
)
FetchContent_MakeAvailable(pybind11)
include_directories(${AOgmaNeo_SOURCE_DIR}/source)
find_package(OpenMP REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
############################################################################
# Add the pyaogmaneo
set(PYAOGMANEO_INCLUDE_DIR "source/pyaogmaneo;")
include_directories(${PYAOGMANEO_INCLUDE_DIR})
set(PYAOGMANEO_SRC
"source/pyaogmaneo/py_module.cpp"
"source/pyaogmaneo/py_helpers.cpp"
"source/pyaogmaneo/py_hierarchy.cpp"
"source/pyaogmaneo/py_image_encoder.cpp"
)
pybind11_add_module(pyaogmaneo ${PYAOGMANEO_SRC})
if(USE_SYSTEM_AOGMANEO)
message(STATUS ${AOGMANEO_LIBRARIES})
target_link_libraries(pyaogmaneo PUBLIC ${AOGMANEO_LIBRARIES} ${OpenMP_CXX_FLAGS})
else()
target_link_libraries(pyaogmaneo PUBLIC AOgmaNeo ${OpenMP_CXX_FLAGS})
endif()