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
456d50a7
Commit
456d50a7
authored
May 18, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adopt CMake script file from VAST
parent
b45136ea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
0 deletions
+97
-0
cmake/FindCAF.cmake
cmake/FindCAF.cmake
+97
-0
No files found.
cmake/Find
Libcaf
.cmake
→
cmake/Find
CAF
.cmake
View file @
456d50a7
# Try to find
libcaf headers and library
.
# Try to find
CAF headers and libraries
.
#
# Use this module as follows:
#
# find_package(
Libcaf
)
# find_package(
CAF
)
#
# Variables used by this module (they can change the default behaviour and need
# to be set before calling find_package):
#
# LIBCAF_ROOT_DIR Set this variable to the root installation of
# libcaf if the module has problems finding
# the proper installation path.
# CAF_ROOT_DIR Set this variable either to an installation prefix or to wa
# CAF build directory where to look for the CAF libraries.
#
# Variables defined by this module:
#
#
LIBCAF_FOUND System has libcaf
headers and library
#
LIB
CAF_LIBRARIES List of library files for all components
#
LIB
CAF_INCLUDE_DIRS List of include paths for all components
#
LIB
CAF_LIBRARY_$C Library file for component $C
#
LIB
CAF_INCLUDE_DIR_$C Include path for component $C
#
CAF_FOUND System has CAF
headers and library
# 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
# iterate over user-defined components
foreach
(
comp
${
Libcaf
_FIND_COMPONENTS
}
)
foreach
(
comp
${
CAF
_FIND_COMPONENTS
}
)
# we use uppercase letters only for variable names
string
(
TOUPPER
"
${
comp
}
"
UPPERCOMP
)
if
(
"
${
comp
}
"
STREQUAL
"core"
)
...
...
@@ -28,69 +27,57 @@ foreach (comp ${Libcaf_FIND_COMPONENTS})
else
()
set
(
HDRNAME
"caf/
${
comp
}
/all.hpp"
)
endif
()
# look for headers: give CMake hints where to find non-installed CAF versions
# note that we look for the headers of each component individually: this is
# necessary to support non-installed versions of CAF, i.e., accessing the
# checked out "actor-framework" or "caf" directory structure directly;
# also check whether LIBCAF_ROOT_DIR is a source directory
set
(
HDRHINT
"
${
LIBCAF_ROOT_DIR
}
/libcaf_
${
comp
}
"
)
foreach
(
dir
".."
"../.."
"../../.."
)
foreach
(
subdir
"actor-framework"
"caf"
)
set
(
HDRHINT
${
HDRHINT
}
"
${
dir
}
/
${
subdir
}
/libcaf_
${
comp
}
"
)
endforeach
()
endforeach
()
find_path
(
LIBCAF_INCLUDE_DIR_
${
UPPERCOMP
}
if
(
CAF_ROOT_DIR
)
set
(
header_hints
"
${
CAF_ROOT_DIR
}
/include"
"
${
CAF_ROOT_DIR
}
/../libcaf_
${
comp
}
"
)
endif
()
find_path
(
CAF_INCLUDE_DIR_
${
UPPERCOMP
}
NAMES
${
HDRNAME
}
HINTS
${
LIBCAF_ROOT_DIR
}
/include
${
header_hints
}
/usr/include
/usr/local/include
/opt/local/include
/sw/include
${
CMAKE_INSTALL_PREFIX
}
/include
${
HDRHINT
}
)
mark_as_advanced
(
LIBCAF_INCLUDE_DIR_
${
UPPERCOMP
}
)
if
(
NOT
"
${
LIBCAF_INCLUDE_DIR_
${
UPPERCOMP
}}
"
STREQUAL
"LIB
CAF_INCLUDE_DIR_
${
UPPERCOMP
}
-NOTFOUND"
)
${
CMAKE_INSTALL_PREFIX
}
/include
)
mark_as_advanced
(
CAF_INCLUDE_DIR_
${
UPPERCOMP
}
)
if
(
NOT
"
${
CAF_INCLUDE_DIR_
${
UPPERCOMP
}}
"
STREQUAL
"
CAF_INCLUDE_DIR_
${
UPPERCOMP
}
-NOTFOUND"
)
# mark as found (set back to false in case library cannot be found)
set
(
Libcaf
_
${
comp
}
_FOUND true
)
# add to
LIB
CAF_INCLUDE_DIRS only if path isn't already set
set
(
CAF
_
${
comp
}
_FOUND true
)
# add to CAF_INCLUDE_DIRS only if path isn't already set
set
(
duplicate false
)
foreach
(
p
${
LIB
CAF_INCLUDE_DIRS
}
)
if
(
${
p
}
STREQUAL
${
LIB
CAF_INCLUDE_DIR_
${
UPPERCOMP
}}
)
foreach
(
p
${
CAF_INCLUDE_DIRS
}
)
if
(
${
p
}
STREQUAL
${
CAF_INCLUDE_DIR_
${
UPPERCOMP
}}
)
set
(
duplicate true
)
endif
()
endforeach
()
if
(
NOT duplicate
)
set
(
LIBCAF_INCLUDE_DIRS
${
LIBCAF_INCLUDE_DIRS
}
${
LIB
CAF_INCLUDE_DIR_
${
UPPERCOMP
}}
)
set
(
CAF_INCLUDE_DIRS
${
CAF_INCLUDE_DIRS
}
${
CAF_INCLUDE_DIR_
${
UPPERCOMP
}}
)
endif
()
# look for (.dll|.so|.dylib) file, again giving hints for non-installed CAFs
# skip probe_event as it is header only
if
(
NOT
${
comp
}
STREQUAL
"probe_event"
)
unset
(
LIBHINT
)
foreach
(
dir
".."
"../.."
"../../.."
)
foreach
(
subdir
"actor-framework"
"caf"
)
set
(
LIBHINT
${
LIBHINT
}
"
${
dir
}
/
${
subdir
}
/build/lib"
)
endforeach
()
endforeach
()
message
(
STATUS
"libhint:
${
LIBHINT
}
"
)
find_library
(
LIBCAF_LIBRARY_
${
UPPERCOMP
}
if
(
CAF_ROOT_DIR
)
set
(
library_hints
"
${
CAF_ROOT_DIR
}
/lib"
)
endif
()
find_library
(
CAF_LIBRARY_
${
UPPERCOMP
}
NAMES
"caf_
${
comp
}
"
HINTS
${
LIBCAF_ROOT_DIR
}
/lib
${
LIBCAF_ROOT_DIR
}
/build/lib
${
library_hints
}
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
${
CMAKE_INSTALL_PREFIX
}
/lib
${
LIBHINT
}
)
mark_as_advanced
(
LIBCAF_LIBRARY_
${
UPPERCOMP
}
)
if
(
"
${
LIBCAF_LIBRARY_
${
UPPERCOMP
}}
"
STREQUAL
"LIBCAF_LIBRARY-NOTFOUND"
)
set
(
Libcaf_
${
comp
}
_FOUND false
)
${
CMAKE_INSTALL_PREFIX
}
/lib
)
mark_as_advanced
(
CAF_LIBRARY_
${
UPPERCOMP
}
)
if
(
"
${
CAF_LIBRARY_
${
UPPERCOMP
}}
"
STREQUAL
"CAF_LIBRARY-NOTFOUND"
)
set
(
CAF_
${
comp
}
_FOUND false
)
else
()
set
(
LIBCAF_LIBRARIES
${
LIBCAF_LIBRARIES
}
${
LIB
CAF_LIBRARY_
${
UPPERCOMP
}}
)
set
(
CAF_LIBRARIES
${
CAF_LIBRARIES
}
${
CAF_LIBRARY_
${
UPPERCOMP
}}
)
endif
()
endif
()
endif
()
...
...
@@ -98,12 +85,13 @@ endforeach ()
# let CMake check whether all requested components have been found
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
Libcaf
FOUND_VAR
LIB
CAF_FOUND
REQUIRED_VARS
LIBCAF_LIBRARIES LIB
CAF_INCLUDE_DIRS
find_package_handle_standard_args
(
CAF
FOUND_VAR CAF_FOUND
REQUIRED_VARS
CAF_LIBRARIES
CAF_INCLUDE_DIRS
HANDLE_COMPONENTS
)
# final step to tell CMake we're done
mark_as_advanced
(
LIBCAF_ROOT_DIR
LIBCAF_LIBRARIES
LIBCAF_INCLUDE_DIRS
)
mark_as_advanced
(
CAF_ROOT_DIR
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