-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
29 lines (25 loc) · 1.33 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
# This is the root file for CMake, which is used to define the native part of
# the project. It is completely independent of the Python-part and can actually
# be used just to build a C++-library.
cmake_minimum_required(VERSION 3.23)
option(CXX "enable C++ compilation" ON)
if(CXX)
enable_language(CXX)
endif()
project(pyutils24 CXX)
set(CMAKE_CXX_STANDARD 17) # Using C++-17 (most features with good support at
# 2022)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) # The code needs to be compiled as PIC
# to build the shared lib for python.
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# CPM Dependencies ~~~~~~~~~~~~~~~~ CPM allows us to include some simple
# dependencies without much fuss. Great default, for everything more
# complicated, uses conan. Why not always use conan? CPM works without any
# interaction (conan needs to be called externally). CPM also has no problems
# with install PyBind11 (which conan has at the time). If the dependency has
# complicated dependencies on its own or is slow to compile, better use conan.
# Check out https://github.com/cpm-cmake/CPM.cmake
include(./cmake/CPM.cmake) # Package manager for simple requirements.
# cpmaddpackage("gh:fmtlib/fmt#9.1.0") # fmt for nice strings
# Define the rest of the project ~~~~~~~~~~~~~~~
add_subdirectory(src)