-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathCMakeLists.txt
48 lines (38 loc) · 1.81 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
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required(VERSION 3.17...3.27)
# Scikit-build-core sets these values for you, or you can just hard-code the
# name and version.
project(
${SKBUILD_PROJECT_NAME}
VERSION ${SKBUILD_PROJECT_VERSION}
DESCRIPTION "C++ bindings for simulation RXC tables"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
# Define CMAKE_INSTALL_xxx: LIBDIR, INCLUDEDIR
include(GNUInstallDirs)
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)
set(SUBPATH ${PROJECT_SOURCE_DIR}/phik/simcore/)
# ##############################################################################
# build ASA159 library #
# ##############################################################################
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
add_library(_asa159 OBJECT ${SUBPATH}/asa159.cpp)
target_include_directories(_asa159 PRIVATE ${SUBPATH})
# ##############################################################################
# EXECUTABLE #
# ##############################################################################
pybind11_add_module(_phik_simulation_core MODULE ${SUBPATH}/bindings.cpp
${SUBPATH}/simulation.hpp $<TARGET_OBJECTS:_asa159>)
target_compile_definitions(_phik_simulation_core
PRIVATE VERSION_INFO=${SKBUILD_PROJECT_VERSION})
target_include_directories(
_phik_simulation_core PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${SUBPATH}>)
if(PHIK_MBUILD)
set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}")
endif()
install(TARGETS _phik_simulation_core LIBRARY DESTINATION "${PROJECT_NAME}/lib")
# Quiet a warning, since this project is only valid with SKBUILD
set(ignoreMe "${SKBUILD}")