Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Ben Boeckel
VTK
Commits
10f12209
Commit
10f12209
authored
6 years ago
by
Ben Boeckel
Browse files
Options
Downloads
Patches
Plain Diff
FindGL2PS: create imported targets
parent
edff69fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMake/FindGL2PS.cmake
+30
-45
30 additions, 45 deletions
CMake/FindGL2PS.cmake
with
30 additions
and
45 deletions
CMake/FindGL2PS.cmake
+
30
−
45
View file @
10f12209
# - Find GL2PS library
# Find the native GL2PS includes and library
# This module defines
# GL2PS_INCLUDE_DIR, where to find tiff.h, etc.
# GL2PS_LIBRARIES, libraries to link against to use GL2PS.
# GL2PS_FOUND, If false, do not try to use GL2PS.
# also defined, but not for general use are
# GL2PS_LIBRARY, where to find the GL2PS library.
find_path
(
GL2PS_INCLUDE_DIR
NAMES gl2ps.h
DOC
"gl2ps include directories"
)
mark_as_advanced
(
GL2PS_INCLUDE_DIR
)
#=============================================================================
# Copyright 2009 Kitware, Inc.
# Copyright 2009 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
find_library
(
GL2PS_LIBRARY
NAMES gl2ps
DOC
"gl2ps library"
)
mark_as_advanced
(
GL2PS_LIBRARY
)
find_path
(
GL2PS_INCLUDE_DIR gl2ps.h
)
if
(
GL2PS_INCLUDE_DIR
)
file
(
STRINGS
"
${
GL2PS_INCLUDE_DIR
}
/gl2ps.h"
_gl2ps_version_lines REGEX
"#define[
\t
]+GL2PS_(MAJOR|MINOR|PATCH)_VERSION[
\t
]+"
)
string
(
REGEX REPLACE
".*GL2PS_MAJOR_VERSION *
\(
[0-9]*
\)
.*"
"
\\
1"
_gl2ps_version_major
"
${
_gl2ps_version_lines
}
"
)
string
(
REGEX REPLACE
".*GL2PS_MINOR_VERSION *
\(
[0-9]*
\)
.*"
"
\\
1"
_gl2ps_version_minor
"
${
_gl2ps_version_lines
}
"
)
string
(
REGEX REPLACE
".*GL2PS_PATCH_VERSION *
\(
[0-9]*
\)
.*"
"
\\
1"
_gl2ps_version_patch
"
${
_gl2ps_version_lines
}
"
)
set
(
GL2PS_VERSION
"
${
_gl2ps_version_major
}
.
${
_gl2ps_version_minor
}
.
${
_gl2ps_version_patch
}
"
)
unset
(
_gl2ps_version_major
)
unset
(
_gl2ps_version_minor
)
unset
(
_gl2ps_version_patch
)
unset
(
_gl2ps_version_lines
)
endif
()
find_library
(
GL2PS_LIBRARY NAMES gl2ps
)
if
(
GL2PS_INCLUDE_DIR
)
file
(
STRINGS
"
${
GL2PS_INCLUDE_DIR
}
/gl2ps.h"
_GL2PS_H_CONTENTS REGEX
"#define[
\t
]+GL2PS_(MAJOR|MINOR|PATCH)_VERSION[
\t
]+"
)
foreach
(
v MAJOR MINOR PATCH
)
if
(
"
${
_GL2PS_H_CONTENTS
}
"
MATCHES
"#define[
\t
]+GL2PS_
${
v
}
_VERSION[
\t
]+([0-9]+)"
)
set
(
GL2PS_
${
v
}
_VERSION
"
${
CMAKE_MATCH_1
}
"
)
else
()
set
(
GL2PS_
${
v
}
_VERSION 0
)
endif
()
endforeach
()
unset
(
_GL2PS_H_CONTENTS
)
set
(
GL2PS_VERSION
"
${
GL2PS_MAJOR_VERSION
}
.
${
GL2PS_MINOR_VERSION
}
.
${
GL2PS_PATCH_VERSION
}
"
)
endif
()
# handle the QUIETLY and REQUIRED arguments and set GL2PS_FOUND to TRUE if
# all listed variables are TRUE
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
GL2PS
REQUIRED_VARS GL2PS_LIBRARY GL2PS_INCLUDE_DIR
VERSION_VAR GL2PS_VERSION
)
VERSION_VAR GL2PS_VERSION
)
if
(
GL2PS_FOUND
)
set
(
GL2PS_
LIBRARIE
S
${
GL2PS_
LIBRARY
}
)
endif
(
)
if
(
GL2PS_FOUND
)
set
(
GL2PS_
INCLUDE_DIR
S
"
${
GL2PS_
INCLUDE_DIR
}
"
)
set
(
GL2PS_LIBRARIES
"
${
GL2PS_LIBRARY
}
"
)
mark_as_advanced
(
GL2PS_INCLUDE_DIR GL2PS_LIBRARY
)
if
(
NOT TARGET GL2PS::GL2PS
)
add_library
(
GL2PS::GL2PS UNKNOWN IMPORTED
)
set_target_properties
(
GL2PS::GL2PS PROPERTIES
IMPORTED_LOCATION
"
${
GL2PS_LIBRARY
}
"
INTERFACE_INCLUDE_DIRECTORIES
"
${
GL2PS_INCLUDE_DIR
}
"
)
endif
()
endif
()
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