Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libxslt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
libraries
libxslt
Commits
55cdd2b62eab
Commit
55cdd2b62eab
authored
4 years ago
by
Markus Rickert
Browse files
Options
Downloads
Patches
Plain Diff
Require dependencies based on enabled CMake options
parent
9e8a665921f7
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+32
-24
32 additions, 24 deletions
CMakeLists.txt
FindGcrypt.cmake
+40
-0
40 additions, 0 deletions
FindGcrypt.cmake
libxslt-config.cmake.in
+5
-2
5 additions, 2 deletions
libxslt-config.cmake.in
with
77 additions
and
26 deletions
CMakeLists.txt
+
32
−
24
View file @
55cdd2b6
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
project
(
libxslt1 C
)
project
(
libxslt1 C
)
list
(
APPEND CMAKE_MODULE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
)
include
(
CheckCSourceCompiles
)
include
(
CheckCSourceCompiles
)
include
(
CheckFunctionExists
)
include
(
CheckFunctionExists
)
include
(
CheckIncludeFiles
)
include
(
CheckIncludeFiles
)
...
@@ -29,10 +31,6 @@
...
@@ -29,10 +31,6 @@
set
(
LIBEXSLT_VERSION
${
LIBEXSLT_DOTTED_VERSION
}
)
set
(
LIBEXSLT_VERSION
${
LIBEXSLT_DOTTED_VERSION
}
)
find_package
(
LibXml2 CONFIG REQUIRED
)
find_package
(
LibXml2 CONFIG REQUIRED
)
find_package
(
Python2 COMPONENTS Interpreter Development
)
find_package
(
Threads
)
check_library_exists
(
grypt gcry_control
"gcrypt.h"
HAVE_GCRYPT
)
option
(
BUILD_SHARED_LIBS
"Build shared libraries"
ON
)
option
(
BUILD_SHARED_LIBS
"Build shared libraries"
ON
)
option
(
LIBXSLT_WITH_DEBUGGER
"Add the debugging support"
ON
)
option
(
LIBXSLT_WITH_DEBUGGER
"Add the debugging support"
ON
)
...
@@ -36,13 +34,7 @@
...
@@ -36,13 +34,7 @@
option
(
BUILD_SHARED_LIBS
"Build shared libraries"
ON
)
option
(
BUILD_SHARED_LIBS
"Build shared libraries"
ON
)
option
(
LIBXSLT_WITH_DEBUGGER
"Add the debugging support"
ON
)
option
(
LIBXSLT_WITH_DEBUGGER
"Add the debugging support"
ON
)
option
(
LIBXSLT_WITH_CRYPTO
"Add crypto support to exslt"
OFF
)
if
(
HAVE_GCRYPT
)
option
(
LIBXSLT_WITH_CRYPTO
"Add crypto support to exslt"
ON
)
else
()
set
(
LIBXSLT_WITH_CRYPTO OFF
)
endif
()
option
(
LIBXSLT_WITH_MEM_DEBUG
"Add the memory debugging module"
OFF
)
option
(
LIBXSLT_WITH_MEM_DEBUG
"Add the memory debugging module"
OFF
)
option
(
LIBXSLT_WITH_MODULES
"Add the module support"
ON
)
option
(
LIBXSLT_WITH_MODULES
"Add the module support"
ON
)
option
(
LIBXSLT_WITH_PROFILER
"Add the profiling support"
ON
)
option
(
LIBXSLT_WITH_PROFILER
"Add the profiling support"
ON
)
...
@@ -46,4 +38,8 @@
...
@@ -46,4 +38,8 @@
option
(
LIBXSLT_WITH_MEM_DEBUG
"Add the memory debugging module"
OFF
)
option
(
LIBXSLT_WITH_MEM_DEBUG
"Add the memory debugging module"
OFF
)
option
(
LIBXSLT_WITH_MODULES
"Add the module support"
ON
)
option
(
LIBXSLT_WITH_MODULES
"Add the module support"
ON
)
option
(
LIBXSLT_WITH_PROFILER
"Add the profiling support"
ON
)
option
(
LIBXSLT_WITH_PROFILER
"Add the profiling support"
ON
)
option
(
LIBXSLT_WITH_PYTHON
"Build Python bindings"
ON
)
option
(
LIBXSLT_WITH_THREADS
"Add multithread support"
ON
)
set
(
LIBXSLT_WITH_TRIO OFF
)
option
(
LIBXSLT_WITH_XSLT_DEBUG
"Add the debugging code"
ON
)
...
@@ -49,8 +45,5 @@
...
@@ -49,8 +45,5 @@
if
(
Python2_FOUND
)
if
(
LIBXSLT_WITH_CRYPTO
)
option
(
LIBXSLT_WITH_PYTHON
"Build Python bindings"
ON
)
find_package
(
Gcrypt REQUIRED
)
set
(
LIBXSLT_PYTHON_INSTALL_DIR
${
Python2_SITEARCH
}
CACHE PATH
"Python bindings install directory"
)
else
()
set
(
LIBXSLT_WITH_PYTHON OFF
)
endif
()
endif
()
...
@@ -55,7 +48,13 @@
...
@@ -55,7 +48,13 @@
endif
()
endif
()
set
(
LIBXSLT_WITH_TRIO OFF
)
if
(
LIBXSLT_WITH_PYTHON
)
option
(
LIBXSLT_WITH_XSLT_DEBUG
"Add the debugging code"
ON
)
find_package
(
Python2 COMPONENTS Interpreter Development REQUIRED
)
set
(
LIBXSLT_PYTHON_INSTALL_DIR
${
Python2_SITEARCH
}
CACHE PATH
"Python bindings install directory"
)
endif
()
if
(
LIBXSLT_WITH_THREADS
)
find_package
(
Threads REQUIRED
)
endif
()
foreach
(
VARIABLE IN ITEMS WITH_CRYPTO WITH_DEBUGGER WITH_MEM_DEBUG WITH_MODULES WITH_PROFILER WITH_PYTHON WITH_TRIO WITH_XSLT_DEBUG
)
foreach
(
VARIABLE IN ITEMS WITH_CRYPTO WITH_DEBUGGER WITH_MEM_DEBUG WITH_MODULES WITH_PROFILER WITH_PYTHON WITH_TRIO WITH_XSLT_DEBUG
)
if
(
LIBXSLT_
${
VARIABLE
}
)
if
(
LIBXSLT_
${
VARIABLE
}
)
...
@@ -67,7 +66,11 @@
...
@@ -67,7 +66,11 @@
set
(
MODULE_EXTENSION
"
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
)
set
(
MODULE_EXTENSION
"
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
)
if
(
Threads_FOUND
)
if
(
LIBXSLT_WITH_CRYPTO
)
list
(
APPEND CMAKE_REQUIRED_LIBRARIES Gcrypt::Gcrypt
)
endif
()
if
(
LIBXSLT_WITH_THREADS
)
list
(
APPEND CMAKE_REQUIRED_LIBRARIES Threads::Threads
)
list
(
APPEND CMAKE_REQUIRED_LIBRARIES Threads::Threads
)
endif
()
endif
()
...
@@ -86,6 +89,7 @@
...
@@ -86,6 +89,7 @@
check_function_exists
(
fprintf HAVE_FPRINTF
)
check_function_exists
(
fprintf HAVE_FPRINTF
)
check_include_files
(
fp_class.h HAVE_FP_CLASS_H
)
check_include_files
(
fp_class.h HAVE_FP_CLASS_H
)
check_function_exists
(
ftime HAVE_FTIME
)
check_function_exists
(
ftime HAVE_FTIME
)
check_library_exists
(
gcrypt gcry_control
"gcrypt.h"
HAVE_GCRYPT
)
check_function_exists
(
gettimeofday HAVE_GETTIMEOFDAY
)
check_function_exists
(
gettimeofday HAVE_GETTIMEOFDAY
)
check_function_exists
(
gmtime HAVE_GMTIME
)
check_function_exists
(
gmtime HAVE_GMTIME
)
check_function_exists
(
gmtime_r HAVE_GMTIME_R
)
check_function_exists
(
gmtime_r HAVE_GMTIME_R
)
...
@@ -212,7 +216,7 @@
...
@@ -212,7 +216,7 @@
)
)
if
(
LIBXSLT_WITH_CRYPTO
)
if
(
LIBXSLT_WITH_CRYPTO
)
target_link_libraries
(
LibXslt PRIVATE
g
crypt
)
target_link_libraries
(
LibXslt PRIVATE
Gcrypt::G
crypt
)
endif
()
endif
()
target_link_libraries
(
LibXslt PUBLIC LibXml2::LibXml2
)
target_link_libraries
(
LibXslt PUBLIC LibXml2::LibXml2
)
...
@@ -221,7 +225,7 @@
...
@@ -221,7 +225,7 @@
target_link_libraries
(
LibXslt PRIVATE m
)
target_link_libraries
(
LibXslt PRIVATE m
)
endif
()
endif
()
if
(
Threads_FOUND
)
if
(
LIBXSLT_WITH_THREADS
)
target_link_libraries
(
LibXslt PRIVATE Threads::Threads
)
target_link_libraries
(
LibXslt PRIVATE Threads::Threads
)
endif
()
endif
()
...
@@ -300,8 +304,8 @@
...
@@ -300,8 +304,8 @@
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/
${
CMAKE_INSTALL_INCLUDEDIR
}
>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/
${
CMAKE_INSTALL_INCLUDEDIR
}
>
)
)
if
(
LIBXSLT_WITH_
G
CRYPT
)
if
(
LIBXSLT_WITH_CRYPT
O
)
target_link_libraries
(
LibExslt PRIVATE
g
crypt
)
target_link_libraries
(
LibExslt PRIVATE
Gcrypt::G
crypt
)
endif
()
endif
()
target_link_libraries
(
LibExslt PUBLIC LibXslt LibXml2::LibXml2
)
target_link_libraries
(
LibExslt PUBLIC LibXslt LibXml2::LibXml2
)
...
@@ -310,7 +314,7 @@
...
@@ -310,7 +314,7 @@
target_link_libraries
(
LibExslt PRIVATE m
)
target_link_libraries
(
LibExslt PRIVATE m
)
endif
()
endif
()
if
(
Threads_FOUND
)
if
(
LIBXSLT_WITH_THREADS
)
target_link_libraries
(
LibExslt PRIVATE Threads::Threads
)
target_link_libraries
(
LibExslt PRIVATE Threads::Threads
)
endif
()
endif
()
...
@@ -419,6 +423,10 @@
...
@@ -419,6 +423,10 @@
install
(
FILES doc/xsltproc.1 DESTINATION
${
CMAKE_INSTALL_MANDIR
}
/man1 COMPONENT documentation
)
install
(
FILES doc/xsltproc.1 DESTINATION
${
CMAKE_INSTALL_MANDIR
}
/man1 COMPONENT documentation
)
install
(
DIRECTORY doc/ DESTINATION
${
CMAKE_INSTALL_DATADIR
}
/doc/libxslt COMPONENT documentation PATTERN Makefile.* EXCLUDE
)
install
(
DIRECTORY doc/ DESTINATION
${
CMAKE_INSTALL_DATADIR
}
/doc/libxslt COMPONENT documentation PATTERN Makefile.* EXCLUDE
)
if
(
LIBXSLT_WITH_CRYPTO
)
install
(
FILES FindGcrypt.cmake DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/libxslt-
${
VERSION
}
COMPONENT development
)
endif
()
configure_package_config_file
(
configure_package_config_file
(
libxslt-config.cmake.in libxslt-config.cmake
libxslt-config.cmake.in libxslt-config.cmake
INSTALL_DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/libxslt-
${
VERSION
}
INSTALL_DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/libxslt-
${
VERSION
}
...
...
This diff is collapsed.
Click to expand it.
FindGcrypt.cmake
0 → 100644
+
40
−
0
View file @
55cdd2b6
include
(
FindPackageHandleStandardArgs
)
include
(
SelectLibraryConfigurations
)
find_path
(
GCRYPT_INCLUDE_DIRS NAMES gcrypt.h
)
mark_as_advanced
(
GCRYPT_INCLUDE_DIRS
)
find_library
(
GCRYPT_LIBRARY_DEBUG NAMES gcryptd
)
find_library
(
GCRYPT_LIBRARY_RELEASE NAMES gcrypt
)
select_library_configurations
(
GCRYPT
)
if
(
GCRYPT_INCLUDE_DIRS AND EXISTS
"
${
GCRYPT_INCLUDE_DIRS
}
/gcrypt.h"
)
file
(
STRINGS
"
${
GCRYPT_INCLUDE_DIRS
}
/gcrypt.h"
_GCRYPT_VERSION_DEFINE REGEX
"#define[
\t
]+GCRYPT_VERSION[
\t
]+
\"
[^
\"
]*
\"
.*"
)
string
(
REGEX REPLACE
"#define[
\t
]+GCRYPT_VERSION[
\t
]+
\"
([^
\"
]*)
\"
.*"
"
\\
1"
GCRYPT_VERSION
"
${
_GCRYPT_VERSION_DEFINE
}
"
)
unset
(
_GCRYPT_VERSION_DEFINE
)
endif
()
find_package_handle_standard_args
(
Gcrypt
FOUND_VAR GCRYPT_FOUND
REQUIRED_VARS GCRYPT_INCLUDE_DIRS GCRYPT_LIBRARIES
VERSION_VAR GCRYPT_VERSION
)
if
(
GCRYPT_FOUND AND NOT TARGET Gcrypt::Gcrypt
)
add_library
(
Gcrypt::Gcrypt UNKNOWN IMPORTED
)
if
(
GCRYPT_LIBRARY_RELEASE
)
set_property
(
TARGET Gcrypt::Gcrypt APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE
)
set_target_properties
(
Gcrypt::Gcrypt PROPERTIES IMPORTED_LOCATION_RELEASE
"
${
GCRYPT_LIBRARY_RELEASE
}
"
)
endif
()
if
(
GCRYPT_LIBRARY_DEBUG
)
set_property
(
TARGET Gcrypt::Gcrypt APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG
)
set_target_properties
(
Gcrypt::Gcrypt PROPERTIES IMPORTED_LOCATION_DEBUG
"
${
GCRYPT_LIBRARY_DEBUG
}
"
)
endif
()
set_target_properties
(
Gcrypt::Gcrypt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES
"
${
GCRYPT_INCLUDE_DIRS
}
"
)
endif
()
This diff is collapsed.
Click to expand it.
libxslt-config.cmake.in
+
5
−
2
View file @
55cdd2b6
...
@@ -57,8 +57,11 @@
...
@@ -57,8 +57,11 @@
endif()
endif()
if(@LIBXSLT_WITH_CRYPTO@)
if(@LIBXSLT_WITH_CRYPTO@)
list(APPEND LIBXSLT_LIBRARIES gcrypt)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
list(APPEND LIBXSLT_EXSLT_LIBRARIES gcrypt)
find_dependency(Gcrypt)
list(APPEND LIBXSLT_INCLUDE_DIRS ${GCRYPT_INCLUDE_DIRS})
list(APPEND LIBXSLT_LIBRARIES ${GCRYPT_LIBRARIES})
list(APPEND LIBXSLT_EXSLT_LIBRARIES ${GCRYPT_LIBRARIES})
endif()
endif()
if(UNIX)
if(UNIX)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment