Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
CMake
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2,684
Issues
2,684
List
Boards
Labels
Milestones
Merge Requests
18
Merge Requests
18
Packages
Packages
Container Registry
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
CMake
CMake
Commits
cd8a57ae
Commit
cd8a57ae
authored
Nov 03, 2016
by
Brad King
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to build CMake against a system librhash
Create a CMAKE_USE_SYSTEM_LIBRHASH option.
parent
71180fc8
Pipeline
#34577
passed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
6 deletions
+29
-6
CMakeLists.txt
CMakeLists.txt
+18
-4
Utilities/cmThirdParty.h.in
Utilities/cmThirdParty.h.in
+1
-0
Utilities/cm_rhash.h
Utilities/cm_rhash.h
+6
-0
bootstrap
bootstrap
+4
-2
No files found.
CMakeLists.txt
View file @
cd8a57ae
...
...
@@ -104,7 +104,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Allow the user to enable/disable all system utility library options by
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
set
(
UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBUV ZLIB
)
set
(
UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIB
RHASH LIB
UV ZLIB
)
foreach
(
util
${
UTILITIES
}
)
if
(
NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_
${
util
}
AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES
)
...
...
@@ -144,6 +144,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
"
${
CMAKE_USE_SYSTEM_LIBRARY_LIBLZMA
}
"
"NOT CMAKE_USE_SYSTEM_LIBARCHIVE"
ON
)
option
(
CMAKE_USE_SYSTEM_FORM
"Use system-installed libform"
"
${
CMAKE_USE_SYSTEM_LIBRARY_FORM
}
"
)
option
(
CMAKE_USE_SYSTEM_JSONCPP
"Use system-installed jsoncpp"
"
${
CMAKE_USE_SYSTEM_LIBRARY_JSONCPP
}
"
)
option
(
CMAKE_USE_SYSTEM_LIBRHASH
"Use system-installed librhash"
"
${
CMAKE_USE_SYSTEM_LIBRARY_LIBRHASH
}
"
)
option
(
CMAKE_USE_SYSTEM_LIBUV
"Use system-installed libuv"
"
${
CMAKE_USE_SYSTEM_LIBRARY_LIBUV
}
"
)
# For now use system KWIML only if explicitly requested rather
...
...
@@ -298,9 +299,22 @@ macro (CMAKE_BUILD_UTILITIES)
add_subdirectory
(
Utilities/KWIML
)
endif
()
set
(
CMAKE_LIBRHASH_LIBRARIES cmlibrhash
)
add_subdirectory
(
Utilities/cmlibrhash
)
CMAKE_SET_TARGET_FOLDER
(
cmlibrhash
"Utilities/3rdParty"
)
if
(
CMAKE_USE_SYSTEM_LIBRHASH
)
if
(
NOT CMAKE_VERSION VERSION_LESS 3.0
)
find_package
(
LibRHash
)
else
()
message
(
FATAL_ERROR
"CMAKE_USE_SYSTEM_LIBRHASH requires CMake >= 3.0"
)
endif
()
if
(
NOT LibRHash_FOUND
)
message
(
FATAL_ERROR
"CMAKE_USE_SYSTEM_LIBRHASH is ON but LibRHash is not found!"
)
endif
()
set
(
CMAKE_LIBRHASH_LIBRARIES LibRHash::LibRHash
)
else
()
set
(
CMAKE_LIBRHASH_LIBRARIES cmlibrhash
)
add_subdirectory
(
Utilities/cmlibrhash
)
CMAKE_SET_TARGET_FOLDER
(
cmlibrhash
"Utilities/3rdParty"
)
endif
()
#---------------------------------------------------------------------
# Build zlib library for Curl, CMake, and CTest.
...
...
Utilities/cmThirdParty.h.in
View file @
cd8a57ae
...
...
@@ -13,6 +13,7 @@
#cmakedefine CMAKE_USE_SYSTEM_LIBLZMA
#cmakedefine CMAKE_USE_SYSTEM_FORM
#cmakedefine CMAKE_USE_SYSTEM_JSONCPP
#cmakedefine CMAKE_USE_SYSTEM_LIBRHASH
#cmakedefine CMAKE_USE_SYSTEM_LIBUV
#cmakedefine CTEST_USE_XMLRPC
...
...
Utilities/cm_rhash.h
View file @
cd8a57ae
...
...
@@ -3,6 +3,12 @@
#ifndef cm_rhash_h
#define cm_rhash_h
/* Use the LibRHash library configured for CMake. */
#include "cmThirdParty.h"
#ifdef CMAKE_USE_SYSTEM_LIBRHASH
#include <rhash.h>
#else
#include <cmlibrhash/librhash/rhash.h>
#endif
#endif
bootstrap
View file @
cd8a57ae
...
...
@@ -493,6 +493,8 @@ Configuration:
--no-system-liblzma use cmake-provided liblzma library (default)
--system-libarchive use system-installed libarchive library
--no-system-libarchive use cmake-provided libarchive library (default)
--system-librhash use system-installed librhash library
--no-system-librhash use cmake-provided librhash library (default)
--qt-gui build the Qt-based GUI (requires Qt >= 4.2)
--no-qt-gui do not build the Qt-based GUI (default)
...
...
@@ -726,10 +728,10 @@ while test $# != 0; do
--init
=
*
)
cmake_init_file
=
`
cmake_arg
"
$1
"
`
;;
--system-libs
)
cmake_bootstrap_system_libs
=
"
${
cmake_bootstrap_system_libs
}
-DCMAKE_USE_SYSTEM_LIBRARIES=1"
;;
--no-system-libs
)
cmake_bootstrap_system_libs
=
"
${
cmake_bootstrap_system_libs
}
-DCMAKE_USE_SYSTEM_LIBRARIES=0"
;;
--system-bzip2
|
--system-curl
|
--system-expat
|
--system-jsoncpp
|
--system-libarchive
|
--system-zlib
|
--system-liblzma
)
--system-bzip2
|
--system-curl
|
--system-expat
|
--system-jsoncpp
|
--system-libarchive
|
--system-
librhash
|
--system-
zlib
|
--system-liblzma
)
lib
=
`
cmake_arg
"
$1
"
"--system-"
`
cmake_bootstrap_system_libs
=
"
${
cmake_bootstrap_system_libs
}
-DCMAKE_USE_SYSTEM_LIBRARY_
`
cmake_toupper
$lib
`
=1"
;;
--no-system-bzip2
|
--no-system-curl
|
--no-system-expat
|
--no-system-jsoncpp
|
--no-system-libarchive
|
--no-system-zlib
|
--no-system-liblzma
)
--no-system-bzip2
|
--no-system-curl
|
--no-system-expat
|
--no-system-jsoncpp
|
--no-system-libarchive
|
--no-system-
librhash
|
--no-system-
zlib
|
--no-system-liblzma
)
lib
=
`
cmake_arg
"
$1
"
"--no-system-"
`
cmake_bootstrap_system_libs
=
"
${
cmake_bootstrap_system_libs
}
-DCMAKE_USE_SYSTEM_LIBRARY_
`
cmake_toupper
$lib
`
=0"
;;
--qt-gui
)
cmake_bootstrap_qt_gui
=
"1"
;;
...
...
Brad King
@brad.king
Mentioned in commit
de53eb18
·
Nov 10, 2016
Mentioned in commit
de53eb18
Mentioned in commit de53eb18ab48acbc6db6580473d1e83c73d59bc9
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment