Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Netlib f2c
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
netlib
Netlib f2c
Commits
7c6a2c11
Verified
Commit
7c6a2c11
authored
Mar 25, 2024
by
Tim Kaune
Browse files
Options
Downloads
Patches
Plain Diff
Use CMakePackageConfigHelpers for package config file
This makes the CMake package relocatable
parent
16625e24
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
packaging/CMakeLists.txt
+10
-4
10 additions, 4 deletions
packaging/CMakeLists.txt
packaging/NetlibF2CConfig.cmake.in
+10
-1
10 additions, 1 deletion
packaging/NetlibF2CConfig.cmake.in
with
20 additions
and
5 deletions
packaging/CMakeLists.txt
+
10
−
4
View file @
7c6a2c11
...
...
@@ -20,8 +20,13 @@ License along with this program. If not, see
include
(
CMakePackageConfigHelpers
)
if
(
NOT DEFINED NetlibF2C_INSTALL_CMAKEDIR
)
set
(
NetlibF2C_INSTALL_CMAKEDIR
"
${
CMAKE_INSTALL_LIBDIR
}
/cmake/
${
PROJECT_NAME
}
"
CACHE STRING
"Path to Netlib LibF2C CMake files"
)
set
(
NetlibF2C_INSTALL_CMAKEDIR
"
${
CMAKE_INSTALL_LIBDIR
}
/cmake/
${
PROJECT_NAME
}
"
CACHE
STRING
"Path to Netlib LibF2C CMake files"
)
endif
()
if
(
BUILD_SHARED_LIBS
)
...
...
@@ -100,10 +105,11 @@ if (DEFINED LoadStaticSharedTargets_SOURCE_DIR)
cmake_path
(
APPEND CMAKE_INSTALL_PREFIX
"
${
LoadStaticSharedTargets_INSTALL_CMAKEDIR
}
"
OUTPUT_VARIABLE LoadStaticSharedTargets_DIR
)
endif
()
configure_file
(
configure_
package_config_
file
(
"NetlibF2CConfig.cmake.in"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/NetlibF2CConfig.cmake"
@ONLY
INSTALL_DESTINATION
"
${
NetlibF2C_INSTALL_CMAKEDIR
}
"
PATH_VARS LoadStaticSharedTargets_DIR
)
install
(
...
...
This diff is collapsed.
Click to expand it.
packaging/NetlibF2CConfig.cmake.in
+
10
−
1
View file @
7c6a2c11
...
...
@@ -23,6 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]
@PACKAGE_INIT@
cmake_minimum_required(VERSION @CMAKE_MINIMUM_REQUIRED_VERSION@)
set(CMAKE_MAXIMUM_SUPPORTED_VERSION @CMAKE_MAXIMUM_SUPPORTED_VERSION@)
...
...
@@ -31,9 +33,14 @@ set(CMAKE_MAXIMUM_SUPPORTED_VERSION @CMAKE_MAXIMUM_SUPPORTED_VERSION@)
@HANDLE_POLICIES_SCRIPT@
# end HANDLE_POLICIES_SCRIPT
set_and_check(
LoadStaticSharedTargets_DIR
"@PACKAGE_LoadStaticSharedTargets_DIR@"
)
set(
LoadStaticSharedTargets_DIR
"
@
LoadStaticSharedTargets_DIR
@
"
"
${
LoadStaticSharedTargets_DIR
}
"
CACHE STRING
"The directory containing a CMake configuration file for LoadStaticSharedTargets."
)
...
...
@@ -50,3 +57,5 @@ load_static_shared_targets(
"${CMAKE_CURRENT_LIST_DIR}/NetlibF2C_Targets-executable-shared.cmake"
"${CMAKE_CURRENT_LIST_DIR}/NetlibF2C_Targets-library-shared.cmake"
)
check_required_components(NetlibF2C)
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