forked from mamba-org/mamba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
56 lines (42 loc) · 1.47 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
# Copyright (c) 2019, QuantStack and Mamba Contributors
#
# Distributed under the terms of the BSD 3-Clause License.
#
# The full license is in the file LICENSE, distributed with this software.
cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0025 NEW) # Introduced in cmake 3.0
cmake_policy(SET CMP0077 NEW) # Introduced in cmake 3.13
project(mamba-package)
include(GNUInstallDirs)
# Source files
# ============
set(
MAMBA_PACKAGE_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/package.cpp
)
set(MAMBA_PACKAGE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/package.hpp)
# Dependencies
# ============
if(NOT TARGET mamba::libmamba)
find_package(libmamba REQUIRED)
endif()
# Build definition
# ================
add_executable(mamba-package ${MAMBA_PACKAGE_SRCS} ${MAMBA_PACKAGE_HEADERS})
mamba_target_add_compile_warnings(mamba-package WARNING_AS_ERROR ${MAMBA_WARNING_AS_ERROR})
target_link_libraries(mamba-package PRIVATE mamba::libmamba)
set_target_properties(mamba-package PROPERTIES CXX_STANDARD 17)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/etc/profile.d/mamba.sh.in"
"${CMAKE_CURRENT_BINARY_DIR}/etc/profile.d/mamba.sh"
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/etc/profile.d/mamba.sh
DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/profile.d/
)
install(
TARGETS mamba-package
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)