diff options
author | Vicent Martà <vicent@github.com> | 2012-10-19 17:06:51 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2012-10-19 17:06:51 -0700 |
commit | c497a63bd6ac0f07b06b18e4891771fdbcd31dd6 (patch) | |
tree | aa2ef5c1594e33a88197155040d3be2d80f820ed | |
parent | 11c2a9c67ddfa38489efb7f9d4ac52f3c59e691a (diff) | |
parent | 88e0fc05d6ae625b43cc5a6cd61d12624fb93b89 (diff) | |
download | libgit2-c497a63bd6ac0f07b06b18e4891771fdbcd31dd6.tar.gz |
Merge pull request #1001 from veeti/build-fixes
Changes to CMake for packaging
-rw-r--r-- | CMakeLists.txt | 17 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | libgit2.pc.in | 2 |
3 files changed, 9 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 52929062d..08e7b47af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,9 +66,9 @@ ELSE (ZLIB_FOUND) ENDIF() # Installation paths -SET(INSTALL_BIN bin CACHE PATH "Where to install binaries to.") +SET(BIN_INSTALL_DIR bin CACHE PATH "Where to install binaries to.") SET(LIB_INSTALL_DIR lib CACHE PATH "Where to install libraries to.") -SET(INSTALL_INC include CACHE PATH "Where to install headers to.") +SET(INCLUDE_INSTALL_DIR include CACHE PATH "Where to install headers to.") # Build options OPTION (BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON) @@ -93,8 +93,8 @@ IF (MSVC) # Precompiled headers ELSE () + SET(CMAKE_C_FLAGS_DEBUG "-O0 -g ${CMAKE_C_FLAGS}") SET(CMAKE_C_FLAGS "-O2 -g -D_GNU_SOURCE -Wall -Wextra -Wno-missing-field-initializers -Wstrict-aliasing=2 -Wstrict-prototypes -Wmissing-prototypes ${CMAKE_C_FLAGS}") - SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") IF (MINGW) # MinGW always does PIC and complains if we tell it to STRING(REGEX REPLACE "-fPIC" "" CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}") ELSE () @@ -163,20 +163,15 @@ IF (MSVC) SET_SOURCE_FILES_PROPERTIES(src/win32/precompiled.c COMPILE_FLAGS "/Ycprecompiled.h") ENDIF () -# Backward compatibility with INSTALL_LIB variable -if (INSTALL_LIB) - set(LIB_INSTALL_DIR "${INSTALL_LIB}") -ENDIF() - # Install INSTALL(TARGETS git2 - RUNTIME DESTINATION ${INSTALL_BIN} + RUNTIME DESTINATION ${BIN_INSTALL_DIR} LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} ) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) -INSTALL(DIRECTORY include/git2 DESTINATION ${INSTALL_INC} ) -INSTALL(FILES include/git2.h DESTINATION ${INSTALL_INC} ) +INSTALL(DIRECTORY include/git2 DESTINATION ${INCLUDE_INSTALL_DIR} ) +INSTALL(FILES include/git2.h DESTINATION ${INCLUDE_INSTALL_DIR} ) # Tests IF (BUILD_CLAR) @@ -66,9 +66,9 @@ For more advanced use or questions about CMake please read <http://www.cmake.org The following CMake variables are declared: -- `INSTALL_BIN`: Where to install binaries to. +- `BIN_INSTALL_DIR`: Where to install binaries to. - `LIB_INSTALL_DIR`: Where to install libraries to. -- `INSTALL_INC`: Where to install headers to. +- `INCLUDE_INSTALL_DIR`: Where to install headers to. - `BUILD_SHARED_LIBS`: Build libgit2 as a Shared Library (defaults to ON) - `BUILD_CLAR`: Build [Clar](https://github.com/tanoku/clar)-based test suite (defaults to ON) - `THREADSAFE`: Build libgit2 with threading support (defaults to OFF) diff --git a/libgit2.pc.in b/libgit2.pc.in index ddc03f36b..52ad901f7 100644 --- a/libgit2.pc.in +++ b/libgit2.pc.in @@ -1,5 +1,5 @@ libdir=@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@ -includedir=@CMAKE_INSTALL_PREFIX@/@INSTALL_INC@ +includedir=@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@ Name: libgit2 Description: The git library, take 2 |