Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
40c788a3
Commit
40c788a3
authored
Jan 25, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/add-version-to-findcaf'
parents
8b0721e7
e4a9b7d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
5 deletions
+27
-5
cmake/FindCAF.cmake
cmake/FindCAF.cmake
+27
-5
No files found.
cmake/FindCAF.cmake
View file @
40c788a3
...
...
@@ -13,10 +13,9 @@
# Variables defined by this module:
#
# CAF_FOUND System has CAF headers and library
# CAF_VERSION Found CAF release number
# CAF_LIBRARIES List of library files for all components
# CAF_INCLUDE_DIRS List of include paths for all components
# CAF_LIBRARY_$C Library file for component $C
# CAF_INCLUDE_DIR_$C Include path for component $C
if
(
CAF_FIND_COMPONENTS STREQUAL
""
)
message
(
FATAL_ERROR
"FindCAF requires at least one COMPONENT."
)
...
...
@@ -49,7 +48,8 @@ foreach (comp ${CAF_FIND_COMPONENTS})
/usr/local/include
/opt/local/include
/sw/include
${
CMAKE_INSTALL_PREFIX
}
/include
)
${
CMAKE_INSTALL_PREFIX
}
/include
${
CMAKE_INSTALL_PREFIX
}
/
${
CMAKE_INSTALL_INCLUDEDIR
}
)
mark_as_advanced
(
CAF_INCLUDE_DIR_
${
UPPERCOMP
}
)
if
(
NOT
"
${
CAF_INCLUDE_DIR_
${
UPPERCOMP
}}
"
STREQUAL
"CAF_INCLUDE_DIR_
${
UPPERCOMP
}
-NOTFOUND"
)
...
...
@@ -66,6 +66,7 @@ foreach (comp ${CAF_FIND_COMPONENTS})
/usr/local/include
/opt/local/include
/sw/include
${
CMAKE_INSTALL_PREFIX
}
/include
${
CMAKE_INSTALL_PREFIX
}
/
${
CMAKE_INSTALL_INCLUDEDIR
}
)
if
(
"
${
caf_build_header_path
}
"
STREQUAL
"caf_build_header_path-NOTFOUND"
)
message
(
WARNING
"Found all.hpp for CAF core, but not build_config.hpp"
)
...
...
@@ -91,6 +92,7 @@ foreach (comp ${CAF_FIND_COMPONENTS})
/usr/local/lib
/opt/local/lib
/sw/lib
${
CMAKE_INSTALL_PREFIX
}
/lib
${
CMAKE_INSTALL_PREFIX
}
/
${
CMAKE_INSTALL_LIBDIR
}
${
CMAKE_INSTALL_PREFIX
}
/
${
CMAKE_INSTALL_LIBDIR
}
/
${
CMAKE_BUILD_TYPE
}
)
mark_as_advanced
(
CAF_LIBRARY_
${
UPPERCOMP
}
)
...
...
@@ -108,15 +110,35 @@ if (DEFINED CAF_INCLUDE_DIRS)
list
(
REMOVE_DUPLICATES CAF_INCLUDE_DIRS
)
endif
()
if
(
NOT CAF_INCLUDE_DIR_CORE STREQUAL
"CAF_INCLUDE_DIR_CORE-NOTFOUND"
)
# read content of config.hpp
file
(
READ
"
${
CAF_INCLUDE_DIR_CORE
}
/caf/config.hpp"
CONFIG_HPP
)
# get line containing the version
string
(
REGEX MATCH
"#define CAF_VERSION [0-9]+"
VERSION_LINE
"
${
CONFIG_HPP
}
"
)
# extract version number from line
string
(
REGEX MATCH
"[0-9]+"
VERSION_INT
"
${
VERSION_LINE
}
"
)
# calculate major, minor, and patch version
math
(
EXPR CAF_VERSION_MAJOR
"
${
VERSION_INT
}
/ 10000"
)
math
(
EXPR CAF_VERSION_MINOR
"(
${
VERSION_INT
}
/ 100) % 100"
)
math
(
EXPR CAF_VERSION_PATCH
"
${
VERSION_INT
}
% 100"
)
# create full version string
set
(
CAF_VERSION
"
${
CAF_VERSION_MAJOR
}
.
${
CAF_VERSION_MINOR
}
.
${
CAF_VERSION_PATCH
}
"
)
if
(
NOT CAF_VERSION
)
unset
(
CAF_VERSION
)
message
(
WARNING
"Unable to determine CAF version"
)
endif
()
endif
()
# let CMake check whether all requested components have been found
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
CAF
FOUND_VAR CAF_FOUND
REQUIRED_VARS CAF_LIBRARIES CAF_INCLUDE_DIRS
REQUIRED_VARS CAF_
VERSION CAF_
LIBRARIES CAF_INCLUDE_DIRS
HANDLE_COMPONENTS
)
# final step to tell CMake we're done
mark_as_advanced
(
CAF_ROOT_DIR
CAF_VERSION
CAF_LIBRARIES
CAF_INCLUDE_DIRS
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment