We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a09708a commit c195f66Copy full SHA for c195f66
1 file changed
CMakeLists.txt
@@ -1,8 +1,18 @@
1
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.10)
2
project(pystring LANGUAGES CXX VERSION 1.1.4)
3
4
option (BUILD_SHARED_LIBS "Build shared libraries (set to OFF to build static libs)" ON)
5
6
+# If the user hasn't configured cmake with an explicit
7
+# -DCMAKE_INSTALL_PREFIX=..., then set it to safely install into ./dist, to
8
+# help prevent the user from accidentally writing over /usr/local or whatever.
9
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
10
+ AND PROJECT_IS_TOP_LEVEL)
11
+ set (CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/dist" CACHE PATH
12
+ "Installation location" FORCE)
13
+endif()
14
+message (STATUS "Installation path will be ${CMAKE_INSTALL_PREFIX}")
15
+
16
add_library(pystring
17
pystring.cpp
18
pystring.h
0 commit comments