-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (28 loc) · 1.1 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
cmake_minimum_required(VERSION 3.13)
project(amulet_test1 LANGUAGES CXX)
set(SRC_INSTALL_DIR "." CACHE PATH "The path to the src directory to install into.")
# Set C++20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Set platform variables
if (WIN32)
# set windows 7 as the minimum version
add_definitions(-D_WIN32_WINNT=0x0601)
elseif(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
endif()
# Add pybind11
add_definitions(-DPYBIND11_DETAILED_ERROR_MESSAGES)
find_package(pybind11 CONFIG REQUIRED)
# Add implementation
add_library(amulet_test1 SHARED)
target_compile_definitions(amulet_test1 PRIVATE ExportAmuletTest1)
target_include_directories(amulet_test1 PUBLIC src)
target_sources(amulet_test1 PRIVATE src/amulet_test1/test1.cpp)
# Add python extension
pybind11_add_module(_amulet_test1 src/amulet_test1/__init_amulet_test1.cpp)
target_link_libraries( _amulet_test1 PRIVATE amulet_test1 )
# Install
install(TARGETS amulet_test1 DESTINATION "${SRC_INSTALL_DIR}/amulet_test1/bin")
install(TARGETS _amulet_test1 DESTINATION "${SRC_INSTALL_DIR}/amulet_test1")