Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-google-double-conversion
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-google-double-conversion
Commits
e13e72e1
Commit
e13e72e1
authored
7 years ago
by
Isaac Hier
Browse files
Options
Downloads
Patches
Plain Diff
Use template for CMake installation.
parent
aa2df660
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+69
-32
69 additions, 32 deletions
CMakeLists.txt
cmake/Config.cmake.in
+0
-0
0 additions, 0 deletions
cmake/Config.cmake.in
with
69 additions
and
32 deletions
CMakeLists.txt
+
69
−
32
View file @
e13e72e1
cmake_minimum_required
(
VERSION 3.0
)
project
(
double-conversion VERSION
2
.0.
1
)
project
(
double-conversion VERSION
3
.0.
0
)
set
(
headers
double-conversion/bignum.h
...
...
@@ -28,11 +28,7 @@ target_include_directories(
$<INSTALL_INTERFACE:include>
)
# pick a version #
set
(
double-conversion_SOVERSION_MAJOR 1
)
set
(
double-conversion_SOVERSION_MINOR 0
)
set
(
double-conversion_SOVERSION_PATCH 0
)
set
(
double-conversion_SOVERSION
${
double-conversion_SOVERSION_MAJOR
}
.
${
double-conversion_SOVERSION_MINOR
}
.
${
double-conversion_SOVERSION_PATCH
}
)
set_property
(
TARGET double-conversion PROPERTY SOVERSION
${
double-conversion_SOVERSION
}
)
set_property
(
TARGET double-conversion PROPERTY SOVERSION
${
PROJECT_VERSION
}
)
# set up testing if requested
option
(
BUILD_TESTING
"Build test programs"
OFF
)
...
...
@@ -42,34 +38,75 @@ if(BUILD_TESTING)
add_subdirectory
(
test
)
endif
()
include
(
GNUInstallDirs
)
install
(
TARGETS double-conversion EXPORT double-conversionTargets
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
)
install
(
FILES
${
headers
}
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/double-conversion
)
####
# Installation (https://github.com/forexample/package-example)
# Layout. This works for all platforms:
# * <prefix>/lib/cmake/<PROJECT-NAME>
# * <prefix>/lib/
# * <prefix>/include/
set
(
config_install_dir
"lib/cmake/
${
PROJECT_NAME
}
"
)
set
(
include_install_dir
"include"
)
set
(
generated_dir
"
${
CMAKE_CURRENT_BINARY_DIR
}
/generated"
)
# Configuration
set
(
version_config
"
${
generated_dir
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake"
)
set
(
project_config
"
${
generated_dir
}
/
${
PROJECT_NAME
}
Config.cmake"
)
set
(
targets_export_name
"
${
PROJECT_NAME
}
Targets"
)
set
(
namespace
"
${
PROJECT_NAME
}
::"
)
# Include module with function 'write_basic_package_version_file'
include
(
CMakePackageConfigHelpers
)
configure_package_config_file
(
cmake/double-conversionConfig.cmake.in
"
${
CMAKE_CURRENT_BINARY_DIR
}
/double-conversion/double-conversionConfig.cmake"
INSTALL_DESTINATION
"
${
LIB_INSTALL_DIR
}
/double-conversion/cmake"
)
# Configure '<PROJECT-NAME>ConfigVersion.cmake'
# Note: PROJECT_VERSION is used as a VERSION
write_basic_package_version_file
(
"
${
PROJECT_BINARY_DIR
}
/double-conversion/double-conversionConfigVersion.cmake"
VERSION
${
PROJECT_VERSION
}
COMPATIBILITY SameMajorVersion
)
"
${
version_config
}
"
COMPATIBILITY SameMajorVersion
)
# Configure '<PROJECT-NAME>Config.cmake'
# Use variables:
# * targets_export_name
# * PROJECT_NAME
configure_package_config_file
(
"cmake/Config.cmake.in"
"
${
project_config
}
"
INSTALL_DESTINATION
"
${
config_install_dir
}
"
)
# Targets:
# * <prefix>/lib/libdouble-conversion.a
# * header location after install: <prefix>/include/double-conversion/*.h
# * headers can be included by C++ code `#include <double-conversion/*.h>`
install
(
TARGETS double-conversion
EXPORT
"
${
targets_export_name
}
"
LIBRARY DESTINATION
"lib"
ARCHIVE DESTINATION
"lib"
RUNTIME DESTINATION
"bin"
INCLUDES DESTINATION
"
${
include_install_dir
}
"
)
# Headers:
# * double-conversion/*.h -> <prefix>/include/double-conversion/*.h
install
(
FILES
${
headers
}
DESTINATION
"
${
include_install_dir
}
/double-conversion"
)
export
(
EXPORT double-conversionTargets
FILE
"
${
CMAKE_CURRENT_BINARY_DIR
}
/double-conversion/double-conversionTargets.cmake"
NAMESPACE double-conversion::
)
# Config
# * <prefix>/lib/cmake/double-conversion/double-conversionConfig.cmake
# * <prefix>/lib/cmake/double-conversion/double-conversionConfigVersion.cmake
install
(
FILES
"
${
project_config
}
"
"
${
version_config
}
"
DESTINATION
"
${
config_install_dir
}
"
)
set
(
ConfigPackageLocation lib/cmake/double-conversion
)
install
(
EXPORT double-conversionTargets
FILE double-conversionTargets.cmake
NAMESPACE double-conversion::
DESTINATION
${
ConfigPackageLocation
}
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/double-conversion/double-conversionConfig.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/double-conversion/double-conversionConfigVersion.cmake"
DESTINATION
${
ConfigPackageLocation
}
COMPONENT Devel
)
# Config
# * <prefix>/lib/cmake/double-conversion/double-conversionTargets.cmake
install
(
EXPORT
"
${
targets_export_name
}
"
NAMESPACE
"
${
namespace
}
"
DESTINATION
"
${
config_install_dir
}
"
)
This diff is collapsed.
Click to expand it.
cmake/
double-conversion
Config.cmake.in
→
cmake/Config.cmake.in
+
0
−
0
View file @
e13e72e1
File moved
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