This repository has been archived by the owner on Nov 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
68 lines (54 loc) · 2.07 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# -------------------------------------------------------------------------
# Copyright (C) 2019 BMW AG
# -------------------------------------------------------------------------
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# -------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.10)
# Version
SET(RP_MAJOR_VERSION 24)
SET(RP_MINOR_VERSION 0)
SET(RP_PATCH_VERSION 1)
# Project setup
PROJECT(RamsesPython
LANGUAGES CXX
VERSION ${RP_MAJOR_VERSION}.${RP_MINOR_VERSION}.${RP_PATCH_VERSION}
DESCRIPTION "RAMSES python bindings"
HOMEPAGE_URL "https://github.com/GENIVI/ramses-python"
)
OPTION(ramses-python_ENABLE_TESTS "Enable tests" OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# Temporary workaround to prevent ramses installation
# Fix ramses to be able to disable installation
set(CMAKE_INSTALL_PREFIX_BEFORE_RAMSES ${CMAKE_INSTALL_PREFIX})
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install)
add_subdirectory(external)
set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX_BEFORE_RAMSES})
file(GLOB src
src/*.cpp
src/include/ramses-python/*.h
)
pybind11_add_module(RamsesPython ${src})
target_include_directories(RamsesPython PRIVATE src/include)
add_definitions(-DRAMSES_LINK_STATIC)
set(ramses_dependencies
ramses-client-api
ramses-client
ramses-framework-api
ramses-framework)
target_link_libraries(RamsesPython PRIVATE ${ramses_dependencies})
install(TARGETS RamsesPython LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX})
if(ramses-python_ENABLE_TESTS)
file(GLOB_RECURSE test_files
LIST_DIRECTORIES FALSE
CONFIGURE_DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/test/*
)
foreach(test_file ${test_files})
file(RELATIVE_PATH relativePath ${CMAKE_CURRENT_SOURCE_DIR}/test ${test_file})
configure_file(test/${relativePath} ${CMAKE_CURRENT_BINARY_DIR}/${relativePath} COPYONLY)
endforeach()
endif()