summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Drahoš <drahosp@gmail.com>2010-12-10 13:29:31 +0100
committerVicent Marti <tanoku@gmail.com>2010-12-12 00:20:43 +0200
commitbfe0658ec6ecf67ab53b789f54743113f80ef2ff (patch)
tree931e7fc0f28bd1cc5df4c83b875d2da03a6ee610
parent032db4d01526e9d8421feca7d520a90d6b0ea991 (diff)
downloadlibgit2-bfe0658ec6ecf67ab53b789f54743113f80ef2ff.tar.gz
Update install info and test resource path handling
-rw-r--r--CMakeLists.txt11
-rw-r--r--README.md11
2 files changed, 16 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 61498a6d9..2ef6bfbec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,15 +1,15 @@
# CMake build script for the libgit2 project
-# Peter Drahos 2010
#
-# Building:
+# Building (out of source build):
# > mkdir build && cd build
-# > cmake .. && make -j3
+# > cmake .. [-DSETTINGS=VALUE]
+# > cmake --build .
#
# Testing:
# > ctest -V
#
# Install:
-# > make install
+# > cmake --build . --target install
PROJECT(libgit2 C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
@@ -87,6 +87,9 @@ INSTALL(FILES src/git2.h DESTINATION ${INSTALL_INC} )
# Tests
IF (BUILD_TESTS)
+ SET(TEST_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/tests/resources" CACHE PATH "Path to test resources.")
+ ADD_DEFINITIONS(-DTEST_RESOURCES=\"${TEST_RESOURCES}\")
+
ENABLE_TESTING()
# Find and build all tests
INCLUDE_DIRECTORIES(tests)
diff --git a/README.md b/README.md
index 820e92833..11f0ef464 100644
--- a/README.md
+++ b/README.md
@@ -50,14 +50,21 @@ Optional dependency:
* LibSSL <http://www.openssl.org/>
-On most Unix systems you can build the library using the following commands
+On most systems you can build the library using the following commands
$ mkdir build && cd build
$ cmake ..
- $ make install
+ $ cmake --build .
Alternatively you can point the CMake GUI tool to the CMakeLists.txt file and generate platform specific build project or IDE workspace.
+To install the library you can specify the install prefix by setting:
+
+ $ cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix
+ $ cmake --build . --target install
+
+For more advanced use or questions about CMake please read <http://www.cmake.org/Wiki/CMake_FAQ>.
+
Building libgit2 - Unix systems
==================================