Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
morse_cmake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
solverstack
morse_cmake
Commits
301ce0a5
Commit
301ce0a5
authored
6 years ago
by
PRUVOST Florent
Browse files
Options
Downloads
Patches
Plain Diff
use existing file
parent
cc9041de
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/find/FindInit.cmake
+1
-0
1 addition, 0 deletions
modules/find/FindInit.cmake
modules/find/LibrariesAbsolutePath.cmake
+0
-72
0 additions, 72 deletions
modules/find/LibrariesAbsolutePath.cmake
with
1 addition
and
72 deletions
modules/find/FindInit.cmake
+
1
−
0
View file @
301ce0a5
...
...
@@ -35,6 +35,7 @@ include(FindHeadersAndLibs)
# To transform relative path into absolute for a list of libraries
include
(
LibrariesAbsolutePath
)
include
(
FindPkgconfigLibrariesAbsolutePath
)
# Some macros to print status when search for headers and libs
include
(
PrintFindStatus
)
...
...
This diff is collapsed.
Click to expand it.
modules/find/LibrariesAbsolutePath.cmake
+
0
−
72
View file @
301ce0a5
...
...
@@ -63,78 +63,6 @@ macro(LIBRARIES_ABSOLUTE_PATH lib_list hints_paths)
endforeach
()
endmacro
()
# Transform relative path into absolute path for libraries found with the
# pkg_search_module cmake macro
# _prefix: the name of the CMake variable used when pkg_search_module was called
# e.g. for pkg_search_module(BLAS blas) _prefix would be BLAS
macro
(
FIND_PKGCONFIG_LIBRARIES_ABSOLUTE_PATH _prefix
)
if
(
WIN32
)
string
(
REPLACE
":"
";"
_lib_env
"$ENV{LIB}"
)
elseif
(
APPLE
)
string
(
REPLACE
":"
";"
_lib_env
"$ENV{DYLD_LIBRARY_PATH}"
)
else
()
string
(
REPLACE
":"
";"
_lib_env
"$ENV{LD_LIBRARY_PATH}"
)
endif
()
list
(
APPEND _lib_env
"
${
CMAKE_C_IMPLICIT_LINK_DIRECTORIES
}
"
)
# non static case
set
(
${
_prefix
}
_LIBRARIES_COPY
"
${${
_prefix
}
_LIBRARIES
}
"
)
set
(
${
_prefix
}
_LIBRARIES
""
)
foreach
(
_library
${${
_prefix
}
_LIBRARIES_COPY
}
)
if
(
EXISTS
"
${
_library
}
"
)
list
(
APPEND
${
_prefix
}
_LIBRARIES
${
_library
}
)
else
()
get_filename_component
(
_ext
"
${
_library
}
"
EXT
)
set
(
_lib_extensions
".so"
".a"
".dyld"
".dll"
)
list
(
FIND _lib_extensions
"
${
_ext
}
"
_index
)
if
(
${
_index
}
GREATER -1
)
get_filename_component
(
_library
"
${
_library
}
"
NAME_WE
)
endif
()
find_library
(
_library_path NAMES
${
_library
}
HINTS
${${
_prefix
}
_LIBDIR
}
${${
_prefix
}
_LIBRARY_DIRS
}
${
_lib_env
}
)
if
(
_library_path
)
list
(
APPEND
${
_prefix
}
_LIBRARIES
${
_library_path
}
)
else
()
message
(
FATAL_ERROR
"Dependency of
${
_prefix
}
'
${
_library
}
' NOT FOUND"
)
endif
()
unset
(
_library_path CACHE
)
endif
()
endforeach
()
set
(
${
_prefix
}
_LIBRARIES
"
${${
_prefix
}
_LIBRARIES
}
"
CACHE INTERNAL
""
FORCE
)
# static case
set
(
${
_prefix
}
_STATIC_LIBRARIES_COPY
"
${${
_prefix
}
_STATIC_LIBRARIES
}
"
)
set
(
${
_prefix
}
_STATIC_LIBRARIES
""
)
foreach
(
_library
${${
_prefix
}
_STATIC_LIBRARIES_COPY
}
)
if
(
EXISTS
"
${
_library
}
"
)
list
(
APPEND
${
_prefix
}
_STATIC_LIBRARIES
${
_library
}
)
else
()
get_filename_component
(
_ext
"
${
_library
}
"
EXT
)
set
(
_lib_extensions
".so"
".a"
".dyld"
".dll"
)
list
(
FIND _lib_extensions
"
${
_ext
}
"
_index
)
if
(
${
_index
}
GREATER -1
)
get_filename_component
(
_library
"
${
_library
}
"
NAME_WE
)
endif
()
# try static first
set
(
default_find_library_suffixes
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
find_library
(
_library_path NAMES
${
_library
}
HINTS
${${
_prefix
}
_STATIC_LIBDIR
}
${${
_prefix
}
_STATIC_LIBRARY_DIRS
}
${
_lib_env
}
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
default_find_library_suffixes
}
)
# if not found try dynamic
if
(
NOT _library_path
)
find_library
(
_library_path NAMES
${
_library
}
HINTS
${${
_prefix
}
_STATIC_LIBDIR
}
${${
_prefix
}
_STATIC_LIBRARY_DIRS
}
${
_lib_env
}
)
endif
()
if
(
_library_path
)
list
(
APPEND
${
_prefix
}
_STATIC_LIBRARIES
${
_library_path
}
)
else
()
message
(
FATAL_ERROR
"Dependency of
${
_prefix
}
'
${
_library
}
' NOT FOUND"
)
endif
()
unset
(
_library_path CACHE
)
endif
()
endforeach
()
set
(
${
_prefix
}
_STATIC_LIBRARIES
"
${${
_prefix
}
_STATIC_LIBRARIES
}
"
CACHE INTERNAL
""
FORCE
)
endmacro
()
##
## @end file LibrariesAbsolutePath.cmake
##
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