Merge branch 'wiiuse-update' of git://github.com/STK-helper/stk-code into STK-helper-wiiuse-update

This commit is contained in:
hiker 2019-01-03 17:30:44 +11:00
commit 082d64c3d8
315 changed files with 43256 additions and 7214 deletions

View File

@ -270,7 +270,7 @@ if(USE_WIIUSE)
if(WIIUSE_BUILD)
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/wiiuse")
endif()
include_directories("${PROJECT_SOURCE_DIR}/lib/wiiuse")
include_directories("${PROJECT_SOURCE_DIR}/lib/wiiuse/src")
endif()
# Set include paths

94
lib/wiiuse/.clang-format Normal file
View File

@ -0,0 +1,94 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: true
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 110
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...

2
lib/wiiuse/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
build
.cquery_cached_index

15
lib/wiiuse/.travis.yml Normal file
View File

@ -0,0 +1,15 @@
os:
- linux
- osx
language: c
compiler:
- clang
- gcc
sudo: required
dist: trusty
install: . scripts/ci/$TRAVIS_OS_NAME/install.sh
script: . scripts/ci/common/script.sh

482
lib/wiiuse/CHANGELOG.mkd Normal file
View File

@ -0,0 +1,482 @@
WiiUse Changelog
================
De-facto official fork, located at <http://github.com/wiiuse/wiiuse>
Original project (0.12 and earlier):
- <http://sourceforge.net/projects/wiiuse/>
- Now-defunct web sites:
- wiiuse.net:
most recent archive from 2011
<https://web.archive.org/web/20110107085956/http://wiiuse.net/>
- wiiuse.sourceforge.net:
most recent archive from 2010 (looks identical on homepage to 2011 snapshot above)
<https://web.archive.org/web/20100216015311/http://wiiuse.sourceforge.net/>
v0.15.4 -- 28-Nov-2018
--------------------
Fixed:
- Windows build - verified to work on VS Community 2017 from fresh install.
Changed:
- Removed `WCONST` macro of questionable value -
it made some struct members "const" for consuming software,
but non-const within the library.
Made it too complex to maintain.
Shouldn't really affect usage (doesn't change layout, etc.),
but noted separately because it is technically a (very minor) API change.
- Removed broken links to old project web sites.
v0.15.3 -- 25-Nov-2018
--------------------
Fixed:
- Fixed forgotten version number
- Fixed library installation prefix on 64bit systems
v0.15.2 -- 25-Nov-2018
--------------------
Fixed the L2CAP channel setup on Linux, now we use only the
interrupt/data channel (0x13) and not the control channel (0x11). This
finally fixes the RVL-CNT-01-TR (gen 2) Wiimote. The control channel
is still kept open, in case something needs it in the future.
Cleaned the indentation by running the code through clang-format.
v0.15.1 -- 20-Nov-2018
--------------------
"Brown paper bag" release - missed some build-related pull requests
before tagging 0.15.
v0.15 -- 20-Nov-2018
--------------------
**Roll-up release of accumulated changes - library has been "stable" now
for some time**
Added:
- Callback API with constant-size wiimote_callback_data_t.
Added to more easily support a ctypes python binding, generated
by and included with RPythonic <http://code.google.com/p/rpythonic/>
Thanks to hartsantler for this feature.
- Ability to build as a static library - must define WIIUSE_STATIC in
client app as well as choosing the appropriate option when building
WiiUse. The default is still a shared library (dll/so). Merged from
paulburton and added to build system.
- Initial MotionPlus support. Thanks to admiral0 for the initial pull
request merging from fwiine, and to Jan Ciger Reviatech SAS for building
on it with fwiine and WiiC code as well as additional code. Try it out
in the example by pressing 1 to start and 2 to stop.
- Full Mac support using Apple's native Bluetooth stack, based on [wiic](http://wiic.sourceforge.net/).
Fixed:
- Properly disable rumbling when told to. Thanks to Jeff Baker from
[Inv3rsion, LLC.](http://www.inv3rsion.com/)
- Builds properly now on mingw (both cross-compile and native).
- Improved reliability on Windows when running an app twice without dis-connecting
the Wiimote (came as a part of the MotionPlus support.)
- Build system fixes.
Changed:
- Improved header includes using feedback from (include-what-you-use)[iwyu]
- Additional internal function `wiiuse_millisleep()` to reduce the number
of `ifdef`s scattered through the code.
- Provide endianness-conversion and buffer/unbuffer functions, rather than
a jumble of function-style macros and raw type punning. This should
fix all aliasing warnings.
- Cleaned up README and CHANGELOG.
- Migrated repo to its own organization on GitHUb.
[iwyu]:http://code.google.com/p/include-what-you-use/
v0.14 -- 2 May 2011
-------------------
Added:
- Support for redirecting or disabling messages: function
`wiiuse_set_output` in `wiiuse.h`. The preprocessor symbol
`WIIUSE_HAS_OUTPUT_REDIRECTION` indicates the presence of this feature.
Thanks to Johannes Zarl for this handy feature!
- Doxyfile and "doc" target to the build system, to easily make use of
the documentation already in the code, along with doc cleanups and
improvements. (rp)
- Added balance board code to example (Paul Burton, rp)
Fixed:
- Off-by-two overflow in IR dot ordering - thanks to Karl Semich (xloem on GitHub)
- Documentation typo fix - thanks to Johannes Zarl
- Check malloc results. (rp)
- Initialize an array entirely. (rp)
- Fixed reading of balance board data. (rp)
Changed:
- Cleaned up README. (rp)
- Removed references to the LGPL/noncommercial license, since it's
confusing and not useful in a practical sense. See, e.g.,
<http://lists.fedoraproject.org/pipermail/legal/2010-November/001470.html>
- Renamed bundled workaround stdint.h header for Visual Studio, which
we still have to use on MSVC 2010 for some unknown reason. (rp)
v0.13.1 -- 11 November 2010
---------------------------
Fixed:
- Fix crashers due to unchecked pointer use.
- [Windows] Fix crashers due to unchecked pointer use.
v0.13 -- 11 November 2010
-------------------------
Added:
- Support for Wii Balance Board ("wiiboard"): your code can
`#ifdef EXP_WII_BOARD` (support based in part on code from TU-Delft)
- CMake-based cross-platform build system
- Version defines in `wiiuse.h`
Fixed:
- [Linux] Bluez issue with not initializing structure on newer kernels
- Use `stdint.h` types for guaranteed type size independent of platform
- Bundle a suitable `stdint.h` for MSVC builds
- Setting IR to off before handshake complete actually respected now.
(fix via Harald <Gotterdammerung@web.de>)
Changed:
- Old makefiles and Visual Studio projects removed.
- CMake allows easy building of binary packages with a uniform
directory structure: .dll/.exe in bin, .lib/.so in lib, .h in
include.
v0.12 -- 2 Apr 2008
-------------------
Added:
- API function `wiiuse_set_ir_sensitivity()`
- Macro `WIIUSE_GET_IR_SENSITIVITY()`
- Event type `WIIUSE_READ_DATA`
- Event type `WIIUSE_UNEXPECTED_DISCONNECT`
Fixed:
- [Linux] Ability to try to `select()` nothing
- [Linux] Changed Makefile to include debug output when compiling in debug mode
Changed:
- `wiiuse_set_nunchuk_orient_threshold()` now takes a`wiimote_t` pointer
- `wiiuse_set_nunchuk_accel_threshold()` now takes a `wiimote_t` pointer
- `wiiuse_read_data()` generates an event `WIIUSE_READ_DATA` rather than
executing a callback
v0.11 -- 25 Feb 2008
--------------------
Added:
- API function `wiiuse_set_nunchuk_orient_threshold()`
- API function `wiiuse_set_nunchuk_accel_threshold()`
- Event type `WIIUSE_NUNCHUK_INSERTED`
- Event type `WIIUSE_NUNCHUK_REMOVED`
- Event type `WIIUSE_CLASSIC_CTRL_INSERTED`
- Event type `WIIUSE_CLASSIC_CTRL_REMOVED`
- Event type `WIIUSE_GUITAR_HERO_3_CTRL_INSERTED`
- Event type `WIIUSE_GUITAR_HERO_3_CTRL_REMOVED`
Fixed:
- Added some missing function prototypes to wiiuse.h
- [Linux] Fixed Makefile to link libmath and libbluetooth
- Status event is set when a status report comes in
- Orientation threshold not being saved in lstate
v0.10 -- 11 Feb 2008
--------------------
Added:
- Real dynamic linking (by noisehole)
- Changed from callback to SDL style
- Guitar Hero 3 controller support
- API function `wiiuse_set_accel_threshold()`
- API function `wiiuse_version()`
- Macro `WIIUSE_USING_SPEAKER()`
- Macro `WIIUSE_IS_LED_SET(wm, num)`
- `wiiuse_init()` now autogenerates unids
- `orient_t::a_roll/a_pitch`
- `wiiuse_resync()`
- `wiiuse_cleanup()`
- `wiiuse_set_timeout()`
Fixed:
- [Windows] Fixed bug where it did not detect expansions on startup
- Renamed `INFO/WARNING/DEBUG` macros to `WIIUSE_*` (by noisehole)
- Updated Makefiles (by noisehole)
- Fixed incorrect roll/pitch when smoothing was enabled
- Fixed nunchuk and classic controller flooding events when significant changes occurred
- Fixed bug where IR was not correct on roll if IR was enabled before handshake
Removed:
- `wiiuse_startup()`, no longer needed
v0.9 -- 3 Nov 2007
------------------
Fixed:
- Can now use `include/wiiuse.h` in C++ projects.
- HOME button works again.
- IR now functions after expansion is connected or removed.
v0.8 -- 27 Oct 2007
-------------------
Changed:
- Bumped API version to 8
- Exported all API functions for usage with non-C/C++ languages.
- Changed event callback to only trigger if a significant state change
occurs.
Added:
- `wiimote_t::lstate` structure
Fixed:
- Bug 1820140 - Buffer overflow in `io_nix.c`. Thanks proppy.
v0.7 -- 19 Oct 2007
-------------------
Changed:
- Bumped API version to 7
- Renamed Linux build from `wii.so` to `wiiuse.so`
- Changed version representation from float to const char*.
Added:
- [Windows] BlueSoleil support.
- [Windows] Bluetooth stack auto-detection (WinXP SP2, Bluesoleil,
Widdcomm tested).
- [Windows] API function `wiiuse_set_bluetooth_stack()`.
- Calculates yaw if IR tracking is enabled.
Fixed:
- [Windows] Problem where a connection is made to a wiimote that does
not exist.
- [Windows] Issue that occurred while using multiple wiimotes.
v0.6 -- 16 Oct 2007
-------------------
Changed:
- Bumped API version to 0.6.
- Ported to Microsoft Windows.
- Improved IR tracking.
- Default IR virtual screen resolutions changed depending on 16:9 or 4:3.
Added:
- `src/msvc/` and `api/msvc/` - Microsoft Visual C++ 6.0 project files.
v0.5 -- 13 Oct 2007
-------------------
Changed:
- Bumped API version to 0.5.
- Greatly improved IR tracking.
- Renamed function `wiiuse_set_ir_correction()` to `wiiuse_set_ir_position()`.
Added:
- API function `wiiuse_set_aspect_ratio()`
Fixed:
- When rolling around 180 degree rotation smoothing would not be seemless.
v0.4 -- 08 Oct 2007
-------------------
Changed:
- Bumped API version to 0.4.
- Greatly improved classic controller joystick functionality.
- Changed all functions named `wiimote_*()` to `wiiuse_*()`
- Renamed many macros from `WIIMOTE_*` to `WIIUSE_*`
Added:
- IR support
- New `WIIMOTE_CONTINUOUS` flag to set continuous reporting
- Macro `IS_JUST_PRESSED()`
- Macro `WIIUSE_USING_ACC()`
- Macro `WIIUSE_USING_EXP()`
- Macro `WIIUSE_USING_IR()`
- API function `wiiuse_set_ir()`
- API function `wiiuse_set_ir_vres()`
- API function `wiiuse_set_ir_correction()`
- `gfx/` - A small OpenGL example that renders IR data
Fixed:
- Sometimes classic controller would only report infinite angle and magnitude for joysticks.
v0.3 -- 10 Sept 2007
--------------------
Changed:
- Moved license to GPLv3.
- Bumped API version to 0.3.
Added:
- Support for Classic Controller
- Smoothing for roll and pitch values of the wiimote and nunchuk.
- API: `wiimote_set_flags()` to set or disable wiimote options.
- API: `wiimote_set_smooth_alpha()` to set smoothing alpha value.
Fixed:
- When the wiimote accelerates the roll or pitch is unreliable and was
set to 0. It now remains at previous tilt value.
- If no event callback was specified then no events would be processed
internally.
v0.2 -- 25 Aug 2007
-------------------
Changed:
- Bumped API version to 0.2.
Added:
- Nunchuk support.
- Ability to write to flash memory.
Fixed:
- Roll and pitch rotation now ranges from -180 to 180 degrees
(previously -90 to 90).
- Bug when reading data from flash memory would read wrong address.
v0.1 -- 23 Feb 2007
-------------------
- Initial release

View File

@ -1,86 +1,142 @@
# CMakeLists.txt - wiiuse
# 2009-2011 Ryan Pavlik <rpavlik@iastate.edu>
# http://academic.cleardefinition.com/
# Iowa State University HCI Graduate Program/VRAC
cmake_minimum_required(VERSION 2.8.1)
cmake_minimum_required(VERSION 2.8.0)
# libbluetooth is required on Unix platforms
if(UNIX AND (NOT APPLE))
include(FindPkgConfig)
pkg_check_modules(BLUETOOTH bluez)
if(NOT BLUETOOTH_FOUND)
message(FATAL_ERROR "Bluetooth library not found. "
"Either install libbluetooth or disable wiiuse support with -DUSE_WIIUSE=0")
endif()
# Set package properties
project(WiiUse)
###
# Set up options
###
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(SUBPROJECT YES)
endif()
set(WIIUSE_SOURCES
classic.c
dynamics.c
events.c
guitar_hero_3.c
io.c
ir.c
motion_plus.c
nunchuk.c
os_nix.c
os_win.c
util.c
wiiboard.c
wiiuse.c
)
include("./ParseVersion.cmake")
message(STATUS "Configuring WiiUse version ${CPACK_PACKAGE_VERSION}")
if(APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64 -F/Library/Frameworks")
set(WIIUSE_SOURCES ${WIIUSE_SOURCES}
os_mac/os_mac_find.m
os_mac/os_mac_interface.m
os_mac/os_mac.m
)
option(BUILD_EXAMPLE "Should we build the example app?" YES)
option(BUILD_EXAMPLE_SDL "Should we build the SDL-based example app?" YES)
option(BUILD_WIIUSE_SHARED_LIB "Should we build as a shared library (dll/so)?" YES)
option(INSTALL_EXAMPLES "Should we install the example apps?" YES)
option(CPACK_MONOLITHIC_INSTALL "Only produce a single component installer, rather than multi-component." NO)
###
# Perform build configuration of dependencies
###
# Locally-developed modules dist'ed with this app - always have this first.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(UseBackportedModules)
include(DoxygenTargets)
if(BUILD_WIIUSE_SHARED_LIB)
set(WIIUSE_LIB_TYPE SHARED)
else()
set(WIIUSE_LIB_TYPE STATIC)
add_definitions(-DWIIUSE_STATIC)
endif()
if(NOT WIN32 AND NOT APPLE)
set(LINUX YES)
find_package(Bluez REQUIRED)
include_directories(${BLUEZ_INCLUDE_DIRS})
include("GNUInstallDirs")
else()
set(LINUX NO)
set(CMAKE_INSTALL_LIBDIR "lib")
endif()
if(WIN32)
add_definitions("/DWIIUSE_STATIC")
add_library(wiiuse STATIC ${WIIUSE_SOURCES})
else()
add_library(wiiuse ${WIIUSE_SOURCES})
find_package(WinHID REQUIRED)
include_directories(${WINHID_INCLUDE_DIRS})
if(MSVC)
# Minimum requirement is WinXP
add_definitions(-D_WIN32_WINNT=0x0501)
endif()
endif()
if(MSVC)
if(MSVC90)
set(WIIUSE_VS_INCLUDE_DIR "C:\\Program\ Files\ (x86)\\Microsoft\ Visual\ Studio\ 9.0\\VC\\include"
CACHE STRING "VS 9.0 include directory, see lib/wiiuse/README for details")
elseif(MSVC10)
set(WIIUSE_VS_INCLUDE_DIR "C:\\Program\ Files\ (x86)\\Microsoft\ Visual\ Studio\ 10.0\\VC\\include"
CACHE STRING "VS 10.0 include directory, see lib/wiiuse/README for details")
endif()
mark_as_advanced(WIIUSE_VS_INCLUDE_DIR)
if(MSVC90 OR MSVC10)
# VS 9 does not have the windows device driver kit
# So the driver must be installed additionally. Also,
# in order to avoid a compilation error, you have to
# specify the visual studio include path FIRST (google
# it, known issue). So in this case add appropriate
# variables that can be set.
set(WIIUSE_WINDDK_ROOT "C:/WinDDK" CACHE
STRING "Install directory of Windows Driver Kits")
mark_as_advanced(WIIUSE_WINDDK_ROOT)
include_directories(${WIIUSE_VS_INCLUDE_DIR} ${WIIUSE_WINDDK_ROOT}/inc/api)
endif()
add_library(setupapi.lib STATIC IMPORTED)
add_library(hid.lib STATIC IMPORTED)
set_target_properties(setupapi.lib PROPERTIES
IMPORTED_LOCATION ${WIIUSE_WINDDK_ROOT}/lib/win7/i386/setupapi.lib)
set_target_properties(hid.lib PROPERTIES
IMPORTED_LOCATION ${WIIUSE_WINDDK_ROOT}/lib/win7/i386/hid.lib)
# This doesn't work for me with VS 11, which apparently finds its own
# copy of the libs
if(MSVC90 OR MSVC10)
set_target_properties(wiiuse PROPERTIES STATIC_LIBRARY_FLAGS
"${WIIUSE_WINDDK_ROOT}/lib/win7/i386/setupapi.lib ${WIIUSE_WINDDK_ROOT}/lib/win7/i386/hid.lib")
else()
set_target_properties(wiiuse PROPERTIES STATIC_LIBRARY_FLAGS "setupapi.lib hid.lib")
endif()
elseif(MINGW)
target_link_libraries(wiiuse hid setupapi)
endif()
###
# Build the project
###
# The lib is in the "src" subdirectory
add_subdirectory(src)
if(NOT SUBPROJECT)
# Example apps
if(BUILD_EXAMPLE)
add_subdirectory(example)
endif()
if(BUILD_EXAMPLE_SDL)
add_subdirectory(example-sdl)
endif()
endif()
if(SUBPROJECT)
set(WIIUSE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src" PARENT_SCOPE)
set(WIIUSE_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src" PARENT_SCOPE)
set(WIIUSE_LIBRARY wiiuse PARENT_SCOPE)
set(WIIUSE_LIBRARIES wiiuse PARENT_SCOPE)
set(WIIUSE_FOUND ON PARENT_SCOPE)
endif()
if(NOT SUBPROJECT)
###
# Set packaging options (for CPack)
###
if(WIN32)
set(DOC_DIR .)
else()
set(DOC_DIR share/doc/wiiuse)
endif()
# Documentation
add_doxygen(Doxyfile
INSTALL_DESTINATION ${DOC_DIR}
INSTALL_COMPONENT docs
NO_PDF)
install(FILES
CHANGELOG.mkd
LICENSE
README.mkd
DESTINATION ${DOC_DIR} COMPONENT docs)
if(INSTALL_EXAMPLES)
install(FILES example/example.c
DESTINATION ${DOC_DIR}/example COMPONENT examples)
install(FILES example-sdl/sdl.c
DESTINATION ${DOC_DIR}/example-sdl COMPONENT examples)
endif()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.mkd")
include(GetCompilerInfoString)
get_compiler_info_string(_compiler)
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-${_compiler}")
# Include the packaging system now that we have it all set up
include(CPack)
cpack_add_component(docs HIDDEN)
cpack_add_component(development
DISPLAY_NAME "Development Files")
cpack_add_component(examples
DISPLAY_NAME "Examples")
cpack_add_component(runtime
DISPLAY_NAME "Runtime Library"
REQUIRED)
endif()

1691
lib/wiiuse/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

620
lib/wiiuse/LICENSE Normal file
View File

@ -0,0 +1,620 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

View File

@ -0,0 +1,28 @@
set(_version_file "${CMAKE_CURRENT_SOURCE_DIR}/src/wiiuse.h")
if(EXISTS "${_version_file}")
file(READ "${_version_file}" _version_contents)
endif()
if("${_version_contents}" MATCHES "WIIUSE_MAJOR ([0-9]+)")
set(CPACK_PACKAGE_VERSION_MAJOR "${CMAKE_MATCH_1}")
else()
set(CPACK_PACKAGE_VERSION_MAJOR "0")
message("Could not parse major version from wiiuse.h")
endif()
if("${_version_contents}" MATCHES "WIIUSE_MINOR ([0-9]+)")
set(CPACK_PACKAGE_VERSION_MINOR "${CMAKE_MATCH_1}")
else()
set(CPACK_PACKAGE_VERSION_MINOR "13")
message("Could not parse minor version from wiiuse.h")
endif()
if("${_version_contents}" MATCHES "WIIUSE_MICRO ([0-9]+)")
set(CPACK_PACKAGE_VERSION_MICRO "${CMAKE_MATCH_1}")
else()
set(CPACK_PACKAGE_VERSION_MICRO "0")
message("Could not parse micro version from wiiuse.h")
endif()
set(CPACK_PACKAGE_VERSION
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_MICRO}")

View File

@ -1,18 +0,0 @@
Windows
=======
Compiling the wiiuse library requires installation of
the windows driver development kit (DDT).
While the wiiuse project is part of the windows STK solution,
it is not compiled by default, instead the lib is
linked from the dependency package (and output of the
wiiuse project is in the dependency directory as well).
Reason is that compiling this lib needs two hardcoded
paths to be set, which are not portable (see properties
of the wiiuse project, then Configuration, C/C++,
General: Additional Include Directories):
first the standard VS include path (!!), THEN the
include path for the windows DDK. Without those
settings in this order wiiuse can not be compiled
(known problems when compiling ddk code with
Visual Studio - google it). Also the path to the ddk
must be set as additional library directory.

301
lib/wiiuse/README.mkd Normal file
View File

@ -0,0 +1,301 @@
# WiiUse README
Semi-Official Fork, located at <http://github.com/wiiuse/wiiuse>
Issue/bug tracker: <https://github.com/wiiuse/wiiuse/issues>
Mailing list: <wiiuse@librelist.com> - just email to subscribe. See
<http://librelist.com/browser/wiiuse/> for archives and
<http://librelist.com/> for more information.
Changelog: <https://github.com/wiiuse/wiiuse/blob/master/CHANGELOG.mkd>
[![Build Status](https://travis-ci.com/wiiuse/wiiuse.svg?branch=master)](https://travis-ci.com/wiiuse/wiiuse/master)
**NOTE**: This library sees little change not because it is dead,
but because it is effectively "complete".
That being said, if you think there are changes that it could use,
and are willing to step up to assist with maintenance,
please file an issue.
## About
Wiiuse is a library written in C that connects with several Nintendo
Wii remotes. Supports motion sensing, IR tracking, nunchuk, classic
controller, Balance Board, and the Guitar Hero 3 controller. Single
threaded and nonblocking makes a light weight and clean API.
Distributed under the GPL 3+.
This is a friendly fork, prompted by apparent non-maintained status
of upstream project but proliferation of ad-hoc forks without
project infrastructure. Balance board support has been merged from
[TU-Delft][1] cross-referenced with other similar implementations in
embedded forks of WiiUse in other applications. Additional community
contributions have since been merged. Hopefully GitHub will help the
community maintain this project more seamlessly now.
Patches and improvements are greatly appreciated - the easiest way
to submit them is to fork the repository on GitHub and make the
changes, then submit a pull request. The "fork and edit this file"
button on the web interface should make this even simpler.
[1]: http://graphics.tudelft.nl/Projects/WiiBalanceBoard
## Authors
Mostly-absentee (but delegating!) Fork Maintainer: Ryan Pavlik <ryan.pavlik@gmail.com> or <abiryan@ryand.net>
Original Author: Michael Laforest < para > < thepara (--AT--) g m a i l [--DOT--] com >
Additional Contributors:
- Jan Ciger - Reviatech SAS <https://github.com/janoc> <jan.ciger@reviatech.com> (effective co-maintainer)
- dhewg
- Christopher Sawczuk @ TU-Delft (initial Balance Board support)
- Paul Burton <https://github.com/paulburton/wiiuse>
- Karl Semich <https://github.com/xloem>
- Johannes Zarl <johannes.zarl@jku.at>
- hartsantler <http://code.google.com/p/rpythonic/>
- admiral0 and fwiine project <http://sourceforge.net/projects/fwiine/files/wiiuse/0.13/>
- Jeff Baker/Inv3rsion, LLC. <http://www.inv3rsion.com/>
- Gabriele Randelli and the WiiC project <http://wiic.sourceforge.net/>
- Juan Sebastian Casallas <https://github.com/jscasallas/wiiuse>
- Lysann Schlegel <https://github.com/lysannkessler/wiiuse>
- Franklin Ta <https://github.com/fta2012>
- Thomas Geissl <https://github.com/thomasgeissl>
- Mattes D <https://github.com/madmaxoft>
- Chadwick Boulay <https://github.com/cboulay>
- Florian Baumgartl <https://github.com/Baumgartl>
## License
> This program is free software: you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> the Free Software Foundation, either version 3 of the License, or
> (at your option) any later version.
>
> This program is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> along with this program. If not, see <http://www.gnu.org/licenses/>.
## Audience
This project is intended for developers who wish to include support
for the Nintendo Wii remote with their third party application.
## Supported Hardware
### Official Nintendo controllers:
- Wiimotes:
- Gen 1.0 - Original Wiimote without Motion Plus (Bluetooth name: RVL-CNT-01)
- Gen 1.5 - Same as gen 1 but has integrated Motion Plus (Bluetooth name: RVL-CNT-01)
- Gen 2.0 - New Wiimote (since about 2011), has integrated Motion
Plus and different firmware (Bluetooth name: RVL-CNT-01-TR)
- Wii Balance Board (Bluetooth name: RVL-WBC-01)
- Expansions:
- Nunchuk
- Classic controller
- Guitar controller
- Motion Plus dongle (for the gen 1 Wiimote)
### Clones and 3rdparty devices
3rdparty controllers (wiimotes, nunchuks etc.) may or may not work -
some manufacturers take major liberties with the protocols so it is
impossible to guarantee functionality. However, most will probably
just work.
## Platforms and Dependencies
Wiiuse currently operates on Linux, Windows and Mac. You will need:
### For Linux
- The kernel must support Bluetooth
- The BlueZ Bluetooth drivers must be installed
- If compiling, you'll need the BlueZ dev files (Debian/Ubuntu package
`libbluetooth-dev`)
### For Windows
- Bluetooth driver (tested with Microsoft's stack with Windows XP SP2 thru Windows 10)
### For Mac
- Mac OS X 10.2 or newer (to have the Mac OS X Bluetooth protocol stack)
### For all platforms
- If compiling, [CMake](http://cmake.org) is needed to generate a makefile/project
## Compiling
You need SDL and OpenGL installed to compile the (optional) SDL example.
### Linux & Mac
mkdir build
cd build
ccmake .. [-DCMAKE_INSTALL_PREFIX=/usr/local] [-DCMAKE_BUILD_TYPE=Release] [-DBUILD_EXAMPLE_SDL=NO]
OR
cmake-gui ..
make [target]
If `target` is omitted then everything is compiled.
Where `target` can be any of the following:
- *wiiuse* - Compiles `libwiiuse.so`
- *wiiuseexample* - Compiles `wiiuse-example`
- *wiiuseexample-sdl* - Compiles `wiiuse-sdl`
- *doc* - Generates doxygen-based API documentation in HTML and PDF
format in `docs-generated`
For a system-wide install, become root (or run with `sudo`) and:
make install
- `libwiiuse.so` is installed to `CMAKE_INSTALL_PREFIX/lib`
- `wiiuse-example` and `wiiuse-sdl` are installed to `CMAKE_INSTALL_PREFIX/bin`
### Windows
The CMake GUI can be used to generate a Visual Studio solution.
You may need to install the Windows SDK (in recent versions) or
DDK (driver development kit - for old Windows SDK only) to compile
wiiuse.
With Visual Studio Community 2017, this is very easy to build now:
if you have chosen to install the "desktop C++" tools,
you'll automatically have what you need.
## Using the Library
To use the library in your own program you must first compile wiiuse as
a module. Include `include/wiiuse.h` in any file that uses wiiuse.
For Linux you must link `libwiiuse.so` ( `-lwiiuse` ). For Windows you
must link `wiiuse.lib`. When your program runs it will need
`wiiuse.dll`.
## Known Issues
On Windows using more than one wiimote (usually more than two wiimotes)
may cause significant latency.
If you are going to use Motion+, make sure to call `wiiuse_poll` or `wiiuse_update`
in a loop for some 10-15 seconds before enabling it. Ideally you should be checking
the status of any expansion (nunchuk) you may have connected as well.
Otherwise the extra expansion may not initialize correctly - the initialization
and calibration takes some time.
### Mac OS X
Wiiuse can only connect to a device if it is in discoverable mode. Enable discoverable
mode by pressing the button on the inside of the battery cover.
Wiiuse may not be able to connect to the device if it has been paired to the
operating system. Unpair it by opening Bluetooth Preferences (Apple > System
Preferences > Bluetooth), selecting the device (e.g., "Nintendo RVL-CNT-01"), and
pressing the X next to the device (alternatively: right-click and select "Remove"). It is
not enough to simply disconnect it.
Enable discoverable mode and try again.
## Acknowledgements by Michael Laforest (Original Author)
<http://wiibrew.org/>
> This site and their users have contributed an immense amount of
> information about the wiimote and its technical details. I could
> not have written this program without the vast amounts of
> reverse engineered information that was researched by them.
Nintendo
> Of course Nintendo for designing and manufacturing the Wii and Wii remote.
BlueZ
> Easy and intuitive Bluetooth stack for Linux.
Thanks to Brent for letting me borrow his Guitar Hero 3 controller.
## Known Forks/Derivative Versions
The last "old upstream" version of WiiUse was 0.12. A number of projects
forked or embedded that version or earlier, making their own improvements.
A (probably incomplete) list follows, split between those whose improvements
are completed integrated into this new mainline version, and those whose
improvements have not yet been ported/merged into this version. An eventual
goal is to integrate all appropriate improvements (under the GPL 3+) back
into this mainline community-maintained "master fork" - contributions are
greatly appreciated.
### Forks that have been fully integrated
- [TU Delft's version with Balance Board support](http://graphics.tudelft.nl/Projects/WiiBalanceBoard)
- Added balance board support only.
- Integrated into mainline 0.13.
### Forks not yet fully integrated
- [libogc/WPAD/DevKitPro](http://wiibrew.org/wiki/Libogc)
- Started before the disappearance of the original upstream
- Focused on Wiimote use with Wii hardware
- Functions renamed, copyright statements removed
- Additional functionality unknown?
- git-svn mirror found here: <https://github.com/xloem/libogc-wiiuse>
- [fwiine](http://sourceforge.net/projects/fwiine/files/wiiuse/0.13/)
- Created an 0.13 version with some very preliminary MotionPlus support.
- Integrated into branch `fwiine-motionplus`, not yet merged pending
alternate MotionPlus merge from WiiC by Jan Ciger.
- [DolphinEmu](https://github.com/dolphin-emu/dolphin)
- used to have a WiiUse fork labeled version 0.13.0 (no relation to 0.13 in this current project)
- Embedded, converted to C++, drastically changed over time,
mostly unrecognizable, and then removed before 3.0.
- Added Mac support.
- Added code to handle finding and pairing wiimotes on windows.
- A mostly intact version is here:
<https://github.com/dolphin-emu/dolphin/tree/2.0/Externals/WiiUseSrc>
- Last code state before removal is here:
<https://github.com/dolphin-emu/dolphin/tree/b038df64bfad478c4e2605985809f58f351ec11c/Source/Core/wiiuse>
- Their new replacement is <https://github.com/dolphin-emu/dolphin/tree/master/Source/Core/Core/HW/WiimoteReal>
- [paulburton on github](https://github.com/paulburton/wiiuse)
- Added balance board support - skipped in favor of the TU Delft version.
- Added static library support - not yet added to the mainline.
- [KzMz on github)](https://github.com/KzMz/wiiuse_fork)
- Started work on speaker support.
- [WiiC](https://github.com/grandelli/WiiC)
- Dramatically changed, C++ API added.
- MotionPlus support added.
- Added Mac support.
## Other Links
- Thread about MotionPlus: <http://forum.wiibrew.org/read.php?11,32585,32922>
- Possible alternative using the Linux kernel support for the Wiimote
and the standard Linux input system: <https://github.com/dvdhrm/xwiimote>
Original project (0.12 and earlier):
- <http://sourceforge.net/projects/wiiuse/>
- Now-defunct web sites:
- wiiuse.net:
most recent archive from 2011
<https://web.archive.org/web/20110107085956/http://wiiuse.net/>
- wiiuse.sourceforge.net:
most recent archive from 2010 (looks identical on homepage to 2011 snapshot above)
<https://web.archive.org/web/20100216015311/http://wiiuse.sourceforge.net/>

8
lib/wiiuse/RELEASE.md Normal file
View File

@ -0,0 +1,8 @@
# Release Checklist
This project unfortunately has a several-step release process,
and it's easy to miss one of the steps.
- Update `CHANGELOG.mkd`
- Ensure contributor list in `README.mkd` is accurate/up to date.
- Bump version in wiiuse.h

View File

@ -1,175 +0,0 @@
/*
* wiiuse
*
* Written By:
* Michael Laforest < para >
* Email: < thepara (--AT--) g m a i l [--DOT--] com >
*
* Copyright 2006-2007
*
* This file is part of wiiuse.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* $Header$
*
*/
/**
* @file
* @brief Classic controller expansion device.
*/
#include "classic.h"
#include "dynamics.h" /* for calc_joystick_state */
#include "events.h" /* for handshake_expansion */
#include <stdlib.h> /* for malloc */
#include <string.h> /* for memset */
static void classic_ctrl_pressed_buttons(struct classic_ctrl_t* cc, short now);
/**
* @brief Handle the handshake data from the classic controller.
*
* @param cc A pointer to a classic_ctrl_t structure.
* @param data The data read in from the device.
* @param len The length of the data block, in bytes.
*
* @return Returns 1 if handshake was successful, 0 if not.
*/
#define HANDSHAKE_BYTES_USED 12
int classic_ctrl_handshake(struct wiimote_t* wm, struct classic_ctrl_t* cc, byte* data, unsigned short len) {
cc->btns = 0;
cc->btns_held = 0;
cc->btns_released = 0;
cc->r_shoulder = 0;
cc->l_shoulder = 0;
if (data[0] == 0xFF || len < HANDSHAKE_BYTES_USED) {
/*
* Sometimes the data returned here is not correct.
* This might happen because the wiimote is lagging
* behind our initialization sequence.
* To fix this just request the handshake again.
*
* Other times it's just the first 16 bytes are 0xFF,
* but since the next 16 bytes are the same, just use
* those.
*/
if (len < 17 || len < HANDSHAKE_BYTES_USED + 16 || data[16] == 0xFF) {
/* get the calibration data */
byte* handshake_buf = (byte *)malloc(EXP_HANDSHAKE_LEN * sizeof(byte));
WIIUSE_DEBUG("Classic controller handshake appears invalid, trying again.");
wiiuse_read_data_cb(wm, handshake_expansion, handshake_buf, WM_EXP_MEM_CALIBR, EXP_HANDSHAKE_LEN);
return 0;
} else {
data += 16;
}
}
/* joystick stuff */
cc->ljs.max.x = data[0] / 4;
cc->ljs.min.x = data[1] / 4;
cc->ljs.center.x = data[2] / 4;
cc->ljs.max.y = data[3] / 4;
cc->ljs.min.y = data[4] / 4;
cc->ljs.center.y = data[5] / 4;
cc->rjs.max.x = data[6] / 8;
cc->rjs.min.x = data[7] / 8;
cc->rjs.center.x = data[8] / 8;
cc->rjs.max.y = data[9] / 8;
cc->rjs.min.y = data[10] / 8;
cc->rjs.center.y = data[11] / 8;
/* handshake done */
wm->exp.type = EXP_CLASSIC;
#ifdef WIIUSE_WIN32
wm->timeout = WIIMOTE_DEFAULT_TIMEOUT;
#endif
return 1;
}
/**
* @brief The classic controller disconnected.
*
* @param cc A pointer to a classic_ctrl_t structure.
*/
void classic_ctrl_disconnected(struct classic_ctrl_t* cc) {
memset(cc, 0, sizeof(struct classic_ctrl_t));
}
/**
* @brief Handle classic controller event.
*
* @param cc A pointer to a classic_ctrl_t structure.
* @param msg The message specified in the event packet.
*/
void classic_ctrl_event(struct classic_ctrl_t* cc, byte* msg) {
int lx, ly, rx, ry;
byte l, r;
classic_ctrl_pressed_buttons(cc, from_big_endian_uint16_t(msg + 4));
/* left/right buttons */
l = (((msg[2] & 0x60) >> 2) | ((msg[3] & 0xE0) >> 5));
r = (msg[3] & 0x1F);
/*
* TODO - LR range hardcoded from 0x00 to 0x1F.
* This is probably in the calibration somewhere.
*/
cc->r_shoulder = ((float)r / 0x1F);
cc->l_shoulder = ((float)l / 0x1F);
/* calculate joystick orientation */
lx = (msg[0] & 0x3F);
ly = (msg[1] & 0x3F);
rx = ((msg[0] & 0xC0) >> 3) | ((msg[1] & 0xC0) >> 5) | ((msg[2] & 0x80) >> 7);
ry = (msg[2] & 0x1F);
calc_joystick_state(&cc->ljs, (float)lx, (float)ly);
calc_joystick_state(&cc->rjs, (float)rx, (float)ry);
}
/**
* @brief Find what buttons are pressed.
*
* @param cc A pointer to a classic_ctrl_t structure.
* @param msg The message byte specified in the event packet.
*/
static void classic_ctrl_pressed_buttons(struct classic_ctrl_t* cc, short now) {
/* message is inverted (0 is active, 1 is inactive) */
now = ~now & CLASSIC_CTRL_BUTTON_ALL;
/* pressed now & were pressed, then held */
cc->btns_held = (now & cc->btns);
/* were pressed or were held & not pressed now, then released */
cc->btns_released = ((cc->btns | cc->btns_held) & ~now);
/* buttons pressed now */
cc->btns = now;
}

10
lib/wiiuse/cmake/.gitattributes vendored Normal file
View File

@ -0,0 +1,10 @@
# Auto detect text files and perform LF normalization
* text=auto
*.sh text eol=lf
# cmake launcher templates
*.sh.in text eol=lf
*.cmd.in text eol=crlf
*vcproj.user.in text eol=crlf
*vcxproj.user.in text eol=crlf

View File

@ -0,0 +1,34 @@
# - Dummy module containing information about these modules for the HELP file
# This file documents a snapshot of the cmake-modules available from
# http://github.com/rpavlik/cmake-modules/
# The latest version of these modules can always be found there.
# Additionally, you can find instructions on how to integrate these modules
# into your own project either in the README.markdown file in this directory,
# or on the GitHub page listed above (scroll to the bottom to see the README
# rendered attractively).
#
# In short: Modules of the form "FindSomeName.cmake" are considered to be
# "find modules", and are intended to be used indirectly by calling find_package,
# not by calling include. Thus, you'll want to do something like:
# find_package(SomeName)
# They define a number of variables allowing you to use whatever software
# they search for, such as include directories and libraries. A few also
# define some functions for your use.
#
# All other modules provide functionality, either immediately upon including
# them, or by defining functions that perform some task of varying utility
# that you can use any time after including them. Note that if a module
# has the filename, for example, cmake/BoostTestTargets.cmake, you only
# need to call:
# include(BoostTestTargets)
#
# For more information, see the documentation for individual modules, the
# cmake-modules github page, and/or the upstream CMake documentation at
# http://www.cmake.org/cmake/help/cmake-2-8-docs.html
#
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

View File

@ -0,0 +1,258 @@
# - Add tests using boost::test
#
# Add this line to your test files in place of including a basic boost test header:
# #include <BoostTestTargetConfig.h>
#
# If you cannot do that and must use the included form for a given test,
# include the line
# // OVERRIDE_BOOST_TEST_INCLUDED_WARNING
# in the same file with the boost test include.
#
# include(BoostTestTargets)
# add_boost_test(<testdriver_name> SOURCES <source1> [<more sources...>]
# [FAIL_REGULAR_EXPRESSION <additional fail regex>]
# [LAUNCHER <generic launcher script>]
# [LIBRARIES <library> [<library>...]]
# [RESOURCES <resource> [<resource>...]]
# [TESTS <testcasename> [<testcasename>...]])
#
# If for some reason you need access to the executable target created,
# it can be found in ${${testdriver_name}_TARGET_NAME} as specified when
# you called add_boost_test
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Requires:
# GetForceIncludeDefinitions
# CopyResourcesToBuildTree
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__add_boost_test)
return()
endif()
set(__add_boost_test YES)
set(BOOST_TEST_TARGET_PREFIX "boosttest")
if(NOT Boost_FOUND)
find_package(Boost 1.34.0 QUIET)
endif()
if("${Boost_VERSION}0" LESS "1034000")
set(_shared_msg
"NOTE: boost::test-based targets and tests cannot "
"be added: boost >= 1.34.0 required but not found. "
"(found: '${Boost_VERSION}'; want >=103400) ")
if(BUILD_TESTING)
message(FATAL_ERROR
${_shared_msg}
"You may disable BUILD_TESTING to continue without the "
"tests.")
else()
message(STATUS
${_shared_msg}
"BUILD_TESTING disabled, so continuing anyway.")
endif()
endif()
include(GetForceIncludeDefinitions)
include(CopyResourcesToBuildTree)
if(Boost_FOUND AND NOT "${Boost_VERSION}0" LESS "1034000")
set(_boosttesttargets_libs)
set(_boostConfig "BoostTestTargetsIncluded.h")
if(NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY)
find_package(Boost 1.34.0 QUIET COMPONENTS unit_test_framework)
endif()
if(Boost_UNIT_TEST_FRAMEWORK_LIBRARY)
set(_boosttesttargets_libs "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
if(Boost_USE_STATIC_LIBS)
set(_boostConfig "BoostTestTargetsStatic.h")
else()
if(NOT APPLE)
set(_boostConfig "BoostTestTargetsDynamic.h")
endif()
endif()
endif()
get_filename_component(_moddir ${CMAKE_CURRENT_LIST_FILE} PATH)
configure_file("${_moddir}/${_boostConfig}"
"${CMAKE_CURRENT_BINARY_DIR}/BoostTestTargetConfig.h"
COPYONLY)
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
endif()
function(add_boost_test _name)
if(NOT BUILD_TESTING)
return()
endif()
# parse arguments
set(_nowhere)
set(_curdest _nowhere)
set(_val_args
SOURCES
FAIL_REGULAR_EXPRESSION
LAUNCHER
LIBRARIES
RESOURCES
TESTS)
set(_bool_args
USE_COMPILED_LIBRARY)
foreach(_arg ${_val_args} ${_bool_args})
set(${_arg})
endforeach()
foreach(_element ${ARGN})
list(FIND _val_args "${_element}" _val_arg_find)
list(FIND _bool_args "${_element}" _bool_arg_find)
if("${_val_arg_find}" GREATER "-1")
set(_curdest "${_element}")
elseif("${_bool_arg_find}" GREATER "-1")
set("${_element}" ON)
set(_curdest _nowhere)
else()
list(APPEND ${_curdest} "${_element}")
endif()
endforeach()
if(_nowhere)
message(FATAL_ERROR "Syntax error in use of add_boost_test!")
endif()
if(NOT SOURCES)
message(FATAL_ERROR
"Syntax error in use of add_boost_test: at least one source file required!")
endif()
if(Boost_FOUND AND NOT "${Boost_VERSION}0" LESS "1034000")
include_directories(${Boost_INCLUDE_DIRS})
set(includeType)
foreach(src ${SOURCES})
file(READ ${src} thefile)
if("${thefile}" MATCHES ".*BoostTestTargetConfig.h.*")
set(includeType CONFIGURED)
set(includeFileLoc ${src})
break()
elseif("${thefile}" MATCHES ".*boost/test/included/unit_test.hpp.*")
set(includeType INCLUDED)
set(includeFileLoc ${src})
set(_boosttesttargets_libs) # clear this out - linking would be a bad idea
if(NOT
"${thefile}"
MATCHES
".*OVERRIDE_BOOST_TEST_INCLUDED_WARNING.*")
message("Please replace the include line in ${src} with this alternate include line instead:")
message(" \#include <BoostTestTargetConfig.h>")
message("Once you've saved your changes, re-run CMake. (See BoostTestTargets.cmake for more info)")
endif()
break()
endif()
endforeach()
if(NOT _boostTestTargetsNagged${_name} STREQUAL "${includeType}")
if("${includeType}" STREQUAL "CONFIGURED")
message(STATUS
"Test '${_name}' uses the CMake-configurable form of the boost test framework - congrats! (Including File: ${includeFileLoc})")
elseif("${includeType}" STREQUAL "INCLUDED")
message("In test '${_name}': ${includeFileLoc} uses the 'included' form of the boost unit test framework.")
else()
message("In test '${_name}': Didn't detect the CMake-configurable boost test include.")
message("Please replace your existing boost test include in that test with the following:")
message(" \#include <BoostTestTargetConfig.h>")
message("Once you've saved your changes, re-run CMake. (See BoostTestTargets.cmake for more info)")
endif()
endif()
set(_boostTestTargetsNagged${_name}
"${includeType}"
CACHE
INTERNAL
""
FORCE)
if(RESOURCES)
list(APPEND SOURCES ${RESOURCES})
endif()
# Generate a unique target name, using the relative binary dir
# and provided name. (transform all / into _ and remove all other
# non-alphabet characters)
file(RELATIVE_PATH
targetpath
"${CMAKE_BINARY_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}")
string(REGEX REPLACE "[^A-Za-z/_]" "" targetpath "${targetpath}")
string(REPLACE "/" "_" targetpath "${targetpath}")
set(_target_name ${BOOST_TEST_TARGET_PREFIX}-${targetpath}-${_name})
set(${_name}_TARGET_NAME "${_target_name}" PARENT_SCOPE)
# Build the test.
add_executable(${_target_name} ${SOURCES})
list(APPEND LIBRARIES ${_boosttesttargets_libs})
if(LIBRARIES)
target_link_libraries(${_target_name} ${LIBRARIES})
endif()
if(RESOURCES)
set_property(TARGET ${_target_name} PROPERTY RESOURCE ${RESOURCES})
copy_resources_to_build_tree(${_target_name})
endif()
if(NOT Boost_TEST_FLAGS)
# set(Boost_TEST_FLAGS --catch_system_error=yes --output_format=XML)
set(Boost_TEST_FLAGS --catch_system_error=yes)
endif()
# TODO: Figure out why only recent boost handles individual test running properly
if(LAUNCHER)
set(_test_command ${LAUNCHER} "\$<TARGET_FILE:${_target_name}>")
else()
set(_test_command ${_target_name})
endif()
if(TESTS AND ( "${Boost_VERSION}" VERSION_GREATER "103799" ))
foreach(_test ${TESTS})
add_test(
${_name}-${_test}
${_test_command} --run_test=${_test} ${Boost_TEST_FLAGS}
)
if(FAIL_REGULAR_EXPRESSION)
set_tests_properties(${_name}-${_test}
PROPERTIES
FAIL_REGULAR_EXPRESSION
"${FAIL_REGULAR_EXPRESSION}")
endif()
endforeach()
else()
add_test(
${_name}-boost_test
${_test_command} ${Boost_TEST_FLAGS}
)
if(FAIL_REGULAR_EXPRESSION)
set_tests_properties(${_name}-boost_test
PROPERTIES
FAIL_REGULAR_EXPRESSION
"${FAIL_REGULAR_EXPRESSION}")
endif()
endif()
# CppCheck the test if we can.
if(COMMAND add_cppcheck)
add_cppcheck(${_target_name} STYLE UNUSED_FUNCTIONS)
endif()
endif()
endfunction()

View File

@ -0,0 +1,9 @@
// Small header computed by CMake to set up boost test.
// include AFTER #define BOOST_TEST_MODULE whatever
// but before any other boost test includes.
// Using the Boost UTF dynamic library
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>

View File

@ -0,0 +1,7 @@
// Small header computed by CMake to set up boost test.
// include AFTER #define BOOST_TEST_MODULE whatever
// but before any other boost test includes.
// Using the Boost UTF included framework
#include <boost/test/included/unit_test.hpp>

View File

@ -0,0 +1,7 @@
// Small header computed by CMake to set up boost test.
// include AFTER #define BOOST_TEST_MODULE whatever
// but before any other boost test includes.
// Using the Boost UTF static library
#include <boost/test/unit_test.hpp>

View File

@ -0,0 +1,95 @@
# - Provide access to the OpenSceneGraph runtime files for bundling in
# an installation or package.
#
# Sets these variables:
# - OSGDB_PLUGINS_RELEASE
# - OSGDB_PLUGINS_DEBUG
# - OSGWRAPPER_PLUGINS_RELEASE
# - OSGWRAPPER_PLUGINS_DEBUG
# - OSG_RUNTIME_LIBRARY_DIR
# - OSG_PATH_TO_PLUGINS
#
# Creates this function:
# - install_osg_plugins( {varNameForOutputFilenames} )
#
# Requires these CMake modules:
# no additional modules required
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
function(_osgbundle_split_debug_versions releasevar debugvar)
set(release)
set(debug)
foreach(fn ${ARGN})
get_filename_component(name "${fn}" NAME_WE)
if("${name}" MATCHES "d$")
list(APPEND debug "${fn}")
else()
list(APPEND release "${fn}")
endif()
endforeach()
set(${releasevar} ${release} PARENT_SCOPE)
set(${debugvar} ${debug} PARENT_SCOPE)
endfunction()
function(_osgbundle_find_plugins varprefix filenameprefix)
file(GLOB
all
"${OSG_RUNTIME_LIBRARY_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}/${filenameprefix}*${CMAKE_SHARED_LIBRARY_SUFFIX}")
_osgbundle_split_debug_versions(${varprefix}_PLUGINS_RELEASE
${varprefix}_PLUGINS_DEBUG
${all})
set(${varprefix}_PLUGINS_RELEASE
"${${varprefix}_PLUGINS_RELEASE}"
PARENT_SCOPE)
set(${varprefix}_PLUGINS_DEBUG
"${${varprefix}_PLUGINS_DEBUG}"
PARENT_SCOPE)
endfunction()
if(OPENSCENEGRAPH_FOUND)
if(WIN32)
get_filename_component(_osglibdir "${OSG_LIBRARY}" PATH)
get_filename_component(_osgroot "${_osglibdir}/.." ABSOLUTE)
set(OSG_RUNTIME_LIBRARY_DIR "${_osgroot}/bin")
set(OSG_PATH_TO_PLUGINS "bin/osgPlugins-${OPENSCENEGRAPH_VERSION}/")
else()
get_filename_component(_osglibdir "${OSG_LIBRARY}" PATH)
set(OSG_RUNTIME_LIBRARY_DIR "${_osglibdir}")
set(OSG_PATH_TO_PLUGINS "lib/osgPlugins-${OPENSCENEGRAPH_VERSION}/")
endif()
# Find the osgDB plugins
_osgbundle_find_plugins(OSGDB osgdb)
_osgbundle_find_plugins(OSGWRAPPER osgwrapper)
endif()
function(install_osg_plugins var)
set(INSTALLEDPLUGINS)
foreach(plugin ${OSGDB_PLUGINS_RELEASE} ${OSGWRAPPER_PLUGINS_RELEASE})
install(FILES "${plugin}"
DESTINATION "${OSG_PATH_TO_PLUGINS}"
CONFIGURATIONS Release RelWithDebInfo MinSizeRel)
get_filename_component(name "${plugin}" NAME)
list(APPEND INSTALLEDPLUGINS "${OSG_PATH_TO_PLUGINS}/${name}")
endforeach()
foreach(plugin ${OSGDB_PLUGINS_DEBUG} ${OSGWRAPPER_PLUGINS_DEBUG})
install(FILES
"${plugin}"
DESTINATION
"${OSG_PATH_TO_PLUGINS}"
CONFIGURATIONS
Debug)
#get_filename_component(name "${plugin}" NAME)
#list(APPEND INSTALLEDPLUGINS "${OSG_PATH_TO_PLUGINS}/${name}")
endforeach()
set(${var} ${INSTALLEDPLUGINS} PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,118 @@
# - Include the OpenSceneGraph runtime files in an installation or built package.
#
# OSGRUNTIME_BUNDLE - Set to "yes" to enable this behavior
# OSGRUNTIME_zlib1dll - Must be set to the location of zlib1.dll on Windows
# OSGRUNTIME_zlib1ddll - Can be set to the location of zlib1d.dll (debug) on Windows.
# If set, will be installed.
#
# Requires these CMake modules:
# no additional modules required
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
function(_osgbundle_split_debug_versions releasevar debugvar)
set(release)
set(debug)
foreach(fn ${ARGN})
get_filename_component(name "${fn}" NAME_WE)
if(${name} MATCHES "d$")
list(APPEND debug "${fn}")
else()
list(APPEND release "${fn}")
endif()
endforeach()
set(${releasevar} ${release} PARENT_SCOPE)
set(${debugvar} ${debug} PARENT_SCOPE)
endfunction()
function(_osgbundle_find_plugins varprefix filenameprefix)
file(GLOB
all
"${OSG_RUNTIME_LIBRARY_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}/${filenameprefix}*${CMAKE_SHARED_LIBRARY_SUFFIX}")
_osgbundle_split_debug_versions(${varprefix}_PLUGINS_RELEASE
${varprefix}_PLUGINS_DEBUG
${all})
endfunction()
if(OPENSCENEGRAPH_FOUND)
if(WIN32)
get_filename_component(_osglibdir "${OSG_LIBRARY}" PATH)
get_filename_component(_osgroot "${_osglibdir}/.." ABSOLUTE)
set(OSG_RUNTIME_LIBRARY_DIR "${_osgroot}/bin")
find_file(OSGBUNDLE_zlib1dll
zlib1.dll
PATHS
"${_osgroot}/bin"
"${_osgroot}/lib")
find_file(OSGBUNDLE_zlib1ddll
zlib1d.dll
PATHS
"${_osgroot}/bin"
"${_osgroot}/lib")
mark_as_advanced(OSGBUNDLE_zlib1dll OSGBUNDLE_zlib1ddll)
set(_osgbundle_required OSGBUNDLE_zlib1dll)
set(_osgbundle_platformOK on)
else()
get_filename_component(_osglibdir "${OSG_LIBRARY}" PATH)
set(OSG_RUNTIME_LIBRARY_DIR "${_osglibdir}")
set(_osgbundle_platformOK on)
endif()
# Find the osgDB plugins
_osgbundle_find_plugins(OSGDB osgdb)
_osgbundle_find_plugins(OSGWRAPPER osgwrapper)
endif()
if(_osgbundle_platformOK)
set(_osgbundle_caninstall on)
foreach(_var ${_osgbundle_required})
if(NOT ${_var})
# If we are missing a single required file, cut out now.
set(_osgbundle_caninstall off)
option(OSGRUNTIME_BUNDLE
"Install a local copy of the OpenSceneGraph runtime files with the project."
off)
endif()
endforeach()
if(_osgbundle_caninstall)
option(OSGRUNTIME_BUNDLE
"Install a local copy of the OpenSceneGraph runtime files with the project."
on)
endif()
endif()
mark_as_advanced(OSGRUNTIME_BUNDLE)
if(OSGRUNTIME_BUNDLE AND OPENSCENEGRAPH_FOUND AND _osgbundle_caninstall)
if(WIN32)
set(DESTINATION bin)
install(FILES "${OSGBUNDLE_zlib1dll}"
DESTINATION ${DESTINATION})
if(OSGBUNDLE_zlib1ddll)
install(FILES "${OSGBUNDLE_zlib1ddll}"
DESTINATION ${DESTINATION})
endif()
else()
set(DESTINATION lib)
endif()
install(DIRECTORY "${_osgroot}/bin/" "${_osgroot}/lib/"
DESTINATION ${DESTINATION}
FILES_MATCHING
# Runtime files
PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()

View File

@ -0,0 +1,99 @@
# - Include the VR Juggler runtime files in an installation or built package.
#
# VRJUGGLERRUNTIME_BUNDLE
# VRJUGGLERRUNTIME_BUNDLE_DEBUG - set to yes to include debug dll's as well
#
# Requires these CMake modules:
# FindVRJuggler22 and its dependencies
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(WIN32)
option(VRJUGGLERRUNTIME_BUNDLE
"Install a local copy of the VR Juggler runtime files with the project."
on)
option(VRJUGGLERRUNTIME_BUNDLE_DEBUG
"Install the VR Juggler debug runtime files as well."
off)
mark_as_advanced(VRJUGGLERRUNTIME_BUNDLE_DEBUG)
else()
# TODO - how to handle when not on Windows?
#option(VRJUGGLERRUNTIME_BUNDLE "Install a local copy of the VR Juggler runtime files with the project." off)
endif()
mark_as_advanced(VRJUGGLERRUNTIME_BUNDLE VRJUGGLERRUNTIME_BUNDLE_DEBUG)
if(VRJUGGLERRUNTIME_BUNDLE AND VRJUGGLER22_FOUND)
if(WIN32)
get_filename_component(_vrjlibdir "${VRJ22_LIBRARY_RELEASE}" PATH)
get_filename_component(_vrjroot "${_vrjlibdir}/../" ABSOLUTE)
# TODO - make sure gadgeteer and sonix can find their DSO's at runtime...
foreach(_dir bin lib)
if(VRJUGGLERRUNTIME_BUNDLE_DEBUG)
install(DIRECTORY "${_vrjroot}/${_dir}/"
DESTINATION bin
PATTERN "*.lib" EXCLUDE # exclude static and link libraries
PATTERN "*.exe" EXCLUDE # exclude unneeded executables
PATTERN "*.py" EXCLUDE # exclude unneeded python executables
PATTERN "*.pyc" EXCLUDE # exclude unneeded python executables
)
else()
install(DIRECTORY ${_vrjroot}/${_dir}/
DESTINATION bin
PATTERN "*.lib" EXCLUDE # exclude static and link libraries
PATTERN "*.exe" EXCLUDE # exclude unneeded executables
PATTERN "*.py" EXCLUDE # exclude unneeded python executables
PATTERN "*.pyc" EXCLUDE # exclude unneeded python executables
PATTERN "*d.dll" EXCLUDE # exclude debug dll's
PATTERN "*-gd-*.dll" EXCLUDE # exclude Boost debug dll's
)
endif()
endforeach()
install(DIRECTORY ${_vrjroot}/share/
DESTINATION share
FILES_MATCHING
# Runtime files
PATTERN "*.dll"
PATTERN "*.jar"
# Data files
PATTERN "*.wav"
PATTERN "*.xml"
PATTERN "*.xsl"
PATTERN "*.xsd"
PATTERN "*.flt"
PATTERN "*.dat"
PATTERN "*.table"
# Config files
PATTERN "*.jdef"
PATTERN "*.jconf"
PATTERN "*.cfg"
PATTERN "hosts.allow"
# Other Files
PATTERN "*.txt"
PATTERN "COPYING*"
PATTERN "ChangeLog"
)
endif()
endif()

View File

@ -0,0 +1,96 @@
# - Include the VR Juggler runtime files in an installation or built package.
#
# VRJUGGLERRUNTIME_BUNDLE
# VRJUGGLERRUNTIME_BUNDLE_DEBUG - set to yes to include debug dll's as well
#
# Requires these CMake modules:
# FindVRJuggler22 and its dependencies
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
# Updated for VR Juggler 3.0 by:
# Brandon Newendorp <brandon@newendorp.com>
if(WIN32)
option(VRJUGGLERRUNTIME_BUNDLE
"Install a local copy of the VR Juggler runtime files with the project."
on)
option(VRJUGGLERRUNTIME_BUNDLE_DEBUG
"Install the VR Juggler debug runtime files as well."
off)
mark_as_advanced(VRJUGGLERRUNTIME_BUNDLE_DEBUG)
else()
# TODO - how to handle when not on Windows?
#option(VRJUGGLERRUNTIME_BUNDLE "Install a local copy of the VR Juggler runtime files with the project." off)
endif()
mark_as_advanced(VRJUGGLERRUNTIME_BUNDLE VRJUGGLERRUNTIME_BUNDLE_DEBUG)
if(VRJUGGLERRUNTIME_BUNDLE AND VRJUGGLER22_FOUND)
if(WIN32)
get_filename_component(_vrjlibdir "${VRJ22_LIBRARY_RELEASE}" PATH)
get_filename_component(_vrjroot "${_vrjlibdir}/../" ABSOLUTE)
# TODO - make sure gadgeteer and sonix can find their DSO's at runtime...
foreach(_dir bin lib)
if(VRJUGGLERRUNTIME_BUNDLE_DEBUG)
install(DIRECTORY "${_vrjroot}/${_dir}/"
DESTINATION bin
PATTERN "*.lib" EXCLUDE # exclude static and link libraries
PATTERN "*.exe" EXCLUDE # exclude unneeded executables
PATTERN "*.py" EXCLUDE # exclude unneeded python executables
PATTERN "*.pyc" EXCLUDE # exclude unneeded python executables
)
else()
install(DIRECTORY ${_vrjroot}/${_dir}/
DESTINATION bin
PATTERN "*.lib" EXCLUDE # exclude static and link libraries
PATTERN "*.exe" EXCLUDE # exclude unneeded executables
PATTERN "*.py" EXCLUDE # exclude unneeded python executables
PATTERN "*.pyc" EXCLUDE # exclude unneeded python executables
PATTERN "*d.dll" EXCLUDE # exclude debug dll's
PATTERN "*-gd-*.dll" EXCLUDE # exclude Boost debug dll's
)
endif()
endforeach()
install(DIRECTORY ${_vrjroot}/share/
DESTINATION share
FILES_MATCHING
# Runtime files
PATTERN "*.dll"
PATTERN "*.jar"
# Data files
PATTERN "*.wav"
PATTERN "*.xml"
PATTERN "*.xsl"
PATTERN "*.xsd"
PATTERN "*.flt"
PATTERN "*.dat"
PATTERN "*.table"
# Config files
PATTERN "*.jdef"
PATTERN "*.jconf"
PATTERN "*.cfg"
PATTERN "hosts.allow"
# Other Files
PATTERN "*.txt"
PATTERN "COPYING*"
PATTERN "ChangeLog"
)
endif()
endif()

View File

@ -0,0 +1,73 @@
# - Script to check if the signature for a mac HID callback uses UInt32 or uint32_t
# Requires that the associated CPP file be present: CheckMacHIDAPI.cpp.
#
# MACOSX_HID_UINT32T, set according to the results of our test.
#
# Use add_definitions(-DMACOSX_HID_UINT32T=${MACOSX_HID_UINT32T}) in your
# listfile and the following prototype for the function you'd like to
# register using setInterruptReportHandlerCallback:
# void ReaderReportCallback(
# void *target,
# IOReturn result,
# void *refcon,
# void *sender,
# MACOSX_HID_UINT32T size
# )
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(APPLE)
if(NOT MACOSX_HID_UINT32T)
get_filename_component(_moddir ${CMAKE_CURRENT_LIST_FILE} PATH)
try_compile(_HID_uint32t
${CMAKE_BINARY_DIR}
${_moddir}/CheckMacHIDAPI.cpp
OUTPUT_VARIABLE
_HID_uint32t_OUTPUT
COMPILE_DEFINITIONS
-DMACOSX_HID_UINT32T=uint32_t)
message(STATUS
"Checking uint32_t in HID callback signature... ${_HID_uint32t}")
try_compile(_HID_UInt32
${CMAKE_BINARY_DIR}
${_moddir}/CheckMacHIDAPI.cpp
OUTPUT_VARIABLE
_HID_UInt32_OUTPUT
COMPILE_DEFINITIONS
-DMACOSX_HID_UINT32T=UInt32)
message(STATUS
"Checking UInt32 in HID callback signature... ${_HID_UInt32}")
if(_HID_uint32t)
set(MACOSX_HID_UINT32T
"uint32_t"
CACHE
STRING
"The 32-bit uint type desired in the callback set by setInterruptReportHandlerCallback")
mark_as_advanced(MACOSX_HID_UINT32T)
elseif(_HID_UInt32)
set(MACOSX_HID_UINT32T
"UInt32"
CACHE
STRING
"The 32-bit uint type desired in the callback set by setInterruptReportHandlerCallback")
mark_as_advanced(MACOSX_HID_UINT32T)
else()
message(SEND_ERROR
"ERROR: Could not detect appropriate Mac HID uint32 type!")
endif()
endif()
endif()

View File

@ -0,0 +1,45 @@
/**
* \file CheckMacHIDAPI.cpp
* \brief C++ source file used by CMake module CheckMacHIDAPI.cmake
*
* \author
* Ryan Pavlik, 2009-2010
* <rpavlik@iastate.edu>
* http://academic.cleardefinition.com/
*
* \author
* Based on code extracted from VRPN 07.22 for use as a minimal test case
*
* Attempts to compile a difficult bit of code against the Mac
* HID API, as two different types have been required in the callback
* function (UInt32 and uint32_t) and testing is the best way to know
* which one is correct for a given system.
*
*/
#if defined(__APPLE__)
#include <stdio.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/hid/IOHIDLib.h>
#include <IOKit/hid/IOHIDKeys.h>
#include <CoreFoundation/CoreFoundation.h>
void ReaderReportCallback(
void *target, IOReturn result, void *refcon, void *sender, MACOSX_HID_UINT32T size
)
{}
#endif
int main(int argc, char* argv[]) {
#if defined(__APPLE__)
io_object_t _ioObject;
IOHIDDeviceInterface122 **_interface;
unsigned char _buffer[512];
IOReturn result = (*_interface)->setInterruptReportHandlerCallback(_interface,
_buffer, 512,
ReaderReportCallback,
NULL, 0);
#endif
return 0;
}

View File

@ -0,0 +1,47 @@
# - Utility function for Find modules considering multiple possible versions
#
# Requires these CMake modules:
# no additional modules required
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__check_version)
return()
endif()
set(__check_version YES)
function(check_version var packagename version)
# By default, we say that the version is good enough
set(_result TRUE)
# Was a version requested? If so, what is our test condition?
if(${packagename}_FIND_VERSION)
if(${packagename}_FIND_VERSION_EXACT)
# Yes, an exact == version was requested - check it.
if(NOT "${version}" VERSION_EQUAL "${${packagename}_FIND_VERSION}")
# version is not an exact match
set(_result FALSE)
endif()
else()
# Yes, a minimum >= version was requested - check it.
if("${version}" VERSION_LESS "${${packagename}_FIND_VERSION}")
# version is lower than requested
set(_result FALSE)
endif()
endif()
endif()
# Return _result
set(${var} ${_result} PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,48 @@
# - Removes duplicate entries and non-directories from a provided list
#
# clean_directory_list(<listvar> [<additional list items>...])
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__clean_directory_list)
return()
endif()
set(__clean_directory_list YES)
function(clean_directory_list _var)
# combine variable's current value with additional list items
set(_in ${${_var}} ${ARGN})
if(_in)
# Initial list cleaning
list(REMOVE_DUPLICATES _in)
# Grab the absolute path of each actual directory
set(_out)
foreach(_dir ${_in})
if(IS_DIRECTORY "${_dir}")
get_filename_component(_dir "${_dir}" ABSOLUTE)
file(TO_CMAKE_PATH "${_dir}" _dir)
list(APPEND _out "${_dir}")
endif()
endforeach()
if(_out)
# Clean up the output list now
list(REMOVE_DUPLICATES _out)
endif()
# return _out
set(${_var} "${_out}" PARENT_SCOPE)
endif()
endfunction()

View File

@ -0,0 +1,72 @@
# - A smarter replacement for list(REMOVE_DUPLICATES) for library lists
#
# Note that, in the case of cyclic link dependencies, you _do_ actually need
# a library in a list multiple times. So, only use this function when you know
# that the dependency graph is acyclic.
#
# clean_library_list(<listvar> [<additional list items>...]) - where
# listvar is the name of a destination variable, and also possibly a source, and
# it is followed by any number (including 0) of additional libraries to append
# to the list before processing.
#
# Removes duplicates from the list, leaving only the last instance, while
# preserving the meaning of the "optimized", "debug", and "general" labeling.
# (Libraries listed as general are listed in the result instead as optimized and
# debug)
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__clean_library_list)
return()
endif()
set(__clean_library_list YES)
function(clean_library_list _var)
# combine variable's current value with additional list items
set(_work ${${_var}} ${ARGN})
if(_work)
# Turn each of optimized, debug, and general into flags
# prefixed on their respective library (combining list items)
string(REGEX REPLACE "optimized;" "1CLL%O%" _work "${_work}")
string(REGEX REPLACE "debug;" "1CLL%D%" _work "${_work}")
string(REGEX REPLACE "general;" "1CLL%G%" _work "${_work}")
# Any library that doesn't have a prefix is general, and a general
# library is both debug and optimized so stdize it
set(_std)
foreach(_lib ${_work})
if(NOT "${_lib}" MATCHES "^1CLL%.%")
list(APPEND _std "1CLL%D%${_lib}" "1CLL%O%${_lib}")
elseif("${_lib}" MATCHES "^1CLL%G%")
string(REPLACE "1CLL%G%" "" _justlib "${_lib}")
list(APPEND _std "1CLL%D%${_justlib}" "1CLL%O%${_justlib}")
else()
list(APPEND _std "${_lib}")
endif()
endforeach()
# REMOVE_DUPLICATES leaves the first - so we reverse before and after
# to keep the last, instead
list(REVERSE _std)
list(REMOVE_DUPLICATES _std)
list(REVERSE _std)
# Split list items back out again: turn prefixes into the
# library type flags.
string(REGEX REPLACE "1CLL%D%" "debug;" _std "${_std}")
string(REGEX REPLACE "1CLL%O%" "optimized;" _std "${_std}")
# Return _std
set(${_var} ${_std} PARENT_SCOPE)
endif()
endfunction()

View File

@ -0,0 +1,19 @@
# will always be the actual version one
# Wrapped in a macro because it's got a return before we want.
macro(_gcvf_version)
@GCVF_PREVIOUS_FILE@
endmacro()
_gcvf_version()
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "@CMAKE_SYSTEM_NAME@")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (@CMAKE_SYSTEM_NAME@)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()
if(ANDROID AND NOT ("${ANDROID_ABI}" STREQUAL "@ANDROID_ABI@"))
set(PACKAGE_VERSION "${PACKAGE_VERSION} (Android @ANDROID_ABI@)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()

View File

@ -0,0 +1,29 @@
@GCVF_PREVIOUS_FILE@
if(MSVC)
if(NOT "${MSVC_VERSION}" STREQUAL "@MSVC_VERSION@")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (@GCVF_WIN_CXXLAYOUT@)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()
endif()
macro(_gcvf_compute_cxxabi _var _compilerid _compilerver)
set(${_var})
if("${_compilerid}" STREQUAL "GNU" AND NOT ("${_compilerver}" STREQUAL ""))
if("${_compilerver}" VER_LESS 5.0)
# This is pre-gcc5, not compatible with post-gcc5
set(${_var} "g++ < 5.0")
else()
set(${_var} "g++ >= 5.0")
endif()
endif()
endmacro()
_gcvr_compute_cxxabi(_installed_cxx "@CMAKE_CXX_COMPILER_ID@" "@CMAKE_CXX_COMPILER_VERSION@")
_gcvr_compute_cxxabi(_current_cxx "${CMAKE_CXX_COMPILER_ID}" "${CMAKE_CXX_COMPILER_VERSION}")
# if(NOT "${_installed_cxx}" STREQUAL "${_current_cxx}")
# set(PACKAGE_VERSION "${PACKAGE_VERSION} (${_installed_cxx})")
# set(PACKAGE_VERSION_UNSUITABLE TRUE)
# return()
# endif()

View File

@ -0,0 +1,16 @@
@GCVF_PREVIOUS_FILE@
set(GCVF_WIN_CXXLAYOUT)
if(MSVC)
set(GCVF_WIN_CXXLAYOUT "MSVC")
elseif(MINGW)
set(GCVF_WIN_CXXLAYOUT "MinGW")
elseif(WIN32)
set(GCVF_WIN_CXXLAYOUT "other")
endif()
if(NOT "@GCVF_WIN_CXXLAYOUT@" STREQUAL "${GCVF_WIN_CXXLAYOUT}")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (@GCVF_WIN_CXXLAYOUT@)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()

View File

@ -0,0 +1,16 @@
@GCVF_PREVIOUS_FILE@
if(NOT ("${CMAKE_C_COMPILER_ABI}" STREQUAL "") AND NOT ("@CMAKE_C_COMPILER_ABI@" STREQUAL ""))
if(NOT "${CMAKE_C_COMPILER_ABI}" STREQUAL "@CMAKE_C_COMPILER_ABI@")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (@CMAKE_C_COMPILER_ABI@)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()
endif()
if(NOT "${CMAKE_C_COMPILER_TARGET}" STREQUAL "@CMAKE_C_COMPILER_TARGET@")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (@CMAKE_C_COMPILER_TARGET@)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()
# todo anything for a C ABI beyond just "basic"?

View File

@ -0,0 +1,32 @@
# - Copy shared libraries from imported targets to the target build directory
# on Windows during post-build. Install them in all cases.
#
# copy_imported_targets(<target_name> [<imported target name> ...])
#
# install_imported_target(<imported target name> <arguments to pass to install(FILES))
#
# Likely requires CMake 2.8.12 or newer to work well.
#
# Original Author:
# 2015 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
#
# Copyright Sensics, Inc. 2015.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
function(copy_imported_targets _target)
foreach(_dep ${ARGN})
if(WIN32)
add_custom_command(TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${_dep}> $<TARGET_FILE_DIR:${_target}>
COMMENT "Copying required DLL for dependency ${_dep}"
VERBATIM)
endif()
endforeach()
endfunction()
function(install_imported_target _dep)
install(FILES $<TARGET_FILE:${_dep}> ${ARGN})
endfunction()

View File

@ -0,0 +1,83 @@
# - Copy the resources your app needs to the build tree.
#
# copy_resources_to_build_tree(<target_name>)
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__copy_resources_to_build_tree)
return()
endif()
set(__copy_resources_to_build_tree YES)
function(copy_resources_to_build_tree _target)
get_target_property(_resources ${_target} RESOURCE)
if(NOT _resources)
# Bail if no resources
message(STATUS
"Told to copy resources for target ${_target}, but "
"no resources are set!")
return()
endif()
get_target_property(_path ${_target} LOCATION)
get_filename_component(_path "${_path}" PATH)
if(NOT MSVC AND NOT "${CMAKE_GENERATOR}" MATCHES "Makefiles")
foreach(_config ${CMAKE_CONFIGURATION_TYPES})
get_target_property(_path${_config} ${_target} LOCATION_${_config})
get_filename_component(_path${_config} "${_path${_config}}" PATH)
add_custom_command(TARGET ${_target}
POST_BUILD
COMMAND
${CMAKE_COMMAND}
ARGS -E make_directory "${_path${_config}}/"
COMMENT "Creating directory ${_path${_config}}/")
endforeach()
endif()
foreach(_res ${_resources})
if(NOT IS_ABSOLUTE "${_res}")
get_filename_component(_res "${_res}" ABSOLUTE)
endif()
get_filename_component(_name "${_res}" NAME)
if(MSVC)
# Working dir is solution file dir, not exe file dir.
add_custom_command(TARGET ${_target}
POST_BUILD
COMMAND
${CMAKE_COMMAND}
ARGS -E copy "${_res}" "${CMAKE_BINARY_DIR}/"
COMMENT "Copying ${_name} to ${CMAKE_BINARY_DIR}/ for MSVC")
else()
if("${CMAKE_GENERATOR}" MATCHES "Makefiles")
add_custom_command(TARGET ${_target}
POST_BUILD
COMMAND
${CMAKE_COMMAND}
ARGS -E copy "${_res}" "${_path}/"
COMMENT "Copying ${_name} to ${_path}/")
else()
foreach(_config ${CMAKE_CONFIGURATION_TYPES})
add_custom_command(TARGET ${_target}
POST_BUILD
COMMAND
${CMAKE_COMMAND}
ARGS -E copy "${_res}" "${_path${_config}}"
COMMENT "Copying ${_name} to ${_path${_config}}")
endforeach()
endif()
endif()
endforeach()
endfunction()

View File

@ -0,0 +1,241 @@
# - Run cppcheck on c++ source files as a custom target and a test
#
# include(CppcheckTargets)
# add_cppcheck(<target-name> [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR] [FORCE] [FAIL_ON_WARNINGS]) -
# Create a target to check a target's sources with cppcheck and the indicated options
# add_cppcheck_sources(<target-name> [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR] [FORCE] [FAIL_ON_WARNINGS]) -
# Create a target to check standalone sources with cppcheck and the indicated options
#
# Requires these CMake modules:
# Findcppcheck
#
# Requires CMake 2.8 or newer (uses VERSION_LESS)
#
# Original Author:
# 2009-2010 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Copyright Anthony Pesch 2014
# Copyright Stefan Eilemann 2014
# Copyright Nicholas Brown 2015
# Copyright Ryan Pavlik 2017
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__add_cppcheck)
return()
endif()
set(__add_cppcheck YES)
if(NOT CPPCHECK_FOUND)
find_package(cppcheck QUIET)
endif()
if(NOT CPPCHECK_FOUND)
add_custom_target(all_cppcheck
COMMENT "cppcheck executable not found")
set_target_properties(all_cppcheck PROPERTIES EXCLUDE_FROM_ALL TRUE)
elseif(CPPCHECK_VERSION VERSION_LESS 1.53.0)
add_custom_target(all_cppcheck
COMMENT "Need at least cppcheck 1.53, found ${CPPCHECK_VERSION}")
set_target_properties(all_cppcheck PROPERTIES EXCLUDE_FROM_ALL TRUE)
set(CPPCHECK_FOUND)
endif()
if(NOT TARGET all_cppcheck)
add_custom_target(all_cppcheck)
endif()
function(add_cppcheck_sources _targetname)
if(CPPCHECK_FOUND)
set(_cppcheck_args -I ${CMAKE_SOURCE_DIR} ${CPPCHECK_EXTRA_ARGS})
set(_input ${ARGN})
list(FIND _input UNUSED_FUNCTIONS _unused_func)
if("${_unused_func}" GREATER "-1")
list(APPEND _cppcheck_args ${CPPCHECK_UNUSEDFUNC_ARG})
list(REMOVE_AT _input ${_unused_func})
endif()
list(FIND _input STYLE _style)
if("${_style}" GREATER "-1")
list(APPEND _cppcheck_args ${CPPCHECK_STYLE_ARG})
list(REMOVE_AT _input ${_style})
endif()
list(FIND _input POSSIBLE_ERROR _poss_err)
if("${_poss_err}" GREATER "-1")
list(APPEND _cppcheck_args ${CPPCHECK_POSSIBLEERROR_ARG})
list(REMOVE_AT _input ${_poss_err})
endif()
list(FIND _input FORCE _force)
if("${_force}" GREATER "-1")
list(APPEND _cppcheck_args "--force")
list(REMOVE_AT _input ${_force})
endif()
list(FIND _input FAIL_ON_WARNINGS _fail_on_warn)
if("${_fail_on_warn}" GREATER "-1")
list(APPEND
CPPCHECK_FAIL_REGULAR_EXPRESSION
${CPPCHECK_WARN_REGULAR_EXPRESSION})
list(REMOVE_AT _input ${_fail_on_warn})
endif()
set(_files)
foreach(_source ${_input})
get_source_file_property(_cppcheck_loc "${_source}" LOCATION)
if(_cppcheck_loc)
# This file has a source file property, carry on.
get_source_file_property(_cppcheck_lang "${_source}" LANGUAGE)
if(("${_cppcheck_lang}" STREQUAL "C") OR ("${_cppcheck_lang}" STREQUAL "CXX"))
list(APPEND _files "${_cppcheck_loc}")
endif()
else()
# This file doesn't have source file properties - figure it out.
get_filename_component(_cppcheck_loc "${_source}" ABSOLUTE)
if(EXISTS "${_cppcheck_loc}")
list(APPEND _files "${_cppcheck_loc}")
else()
message(FATAL_ERROR
"Adding CPPCHECK for file target ${_targetname}: "
"File ${_source} does not exist or needs a corrected path location "
"since we think its absolute path is ${_cppcheck_loc}")
endif()
endif()
endforeach()
if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0")
# Older than CMake 2.8.0
add_test(${_targetname}_cppcheck_test
"${CPPCHECK_EXECUTABLE}"
${CPPCHECK_TEMPLATE_ARG}
${_cppcheck_args}
${_files})
else()
# CMake 2.8.0 and newer
add_test(NAME
${_targetname}_cppcheck_test
COMMAND
"${CPPCHECK_EXECUTABLE}"
${CPPCHECK_TEMPLATE_ARG}
${_cppcheck_args}
${_files})
endif()
set_tests_properties(${_targetname}_cppcheck_test
PROPERTIES
FAIL_REGULAR_EXPRESSION
"${CPPCHECK_FAIL_REGULAR_EXPRESSION}")
add_custom_target(${_targetname}_cppcheck
COMMAND
${CPPCHECK_EXECUTABLE}
${CPPCHECK_QUIET_ARG}
${CPPCHECK_TEMPLATE_ARG}
${_cppcheck_args}
${_files}
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT
"${_targetname}_cppcheck: Running cppcheck on target ${_targetname}..."
VERBATIM)
add_dependencies(cppcheck ${_targetname}_cppcheck)
endif()
endfunction()
function(add_cppcheck _name)
if(NOT TARGET ${_name})
message(FATAL_ERROR
"add_cppcheck given a target name that does not exist: '${_name}' !")
endif()
if(CPPCHECK_FOUND)
set(_cppcheck_args -I ${CMAKE_SOURCE_DIR} ${CPPCHECK_EXTRA_ARGS})
list(FIND ARGN UNUSED_FUNCTIONS _unused_func)
if("${_unused_func}" GREATER "-1")
list(APPEND _cppcheck_args ${CPPCHECK_UNUSEDFUNC_ARG})
endif()
list(FIND ARGN STYLE _style)
if("${_style}" GREATER "-1")
list(APPEND _cppcheck_args ${CPPCHECK_STYLE_ARG})
endif()
list(FIND ARGN POSSIBLE_ERROR _poss_err)
if("${_poss_err}" GREATER "-1")
list(APPEND _cppcheck_args ${CPPCHECK_POSSIBLEERROR_ARG})
endif()
list(FIND ARGN FORCE _force)
if("${_force}" GREATER "-1")
list(APPEND _cppcheck_args "--force")
endif()
list(FIND _input FAIL_ON_WARNINGS _fail_on_warn)
if("${_fail_on_warn}" GREATER "-1")
list(APPEND
CPPCHECK_FAIL_REGULAR_EXPRESSION
${CPPCHECK_WARN_REGULAR_EXPRESSION})
list(REMOVE_AT _input ${_unused_func})
endif()
get_target_property(_cppcheck_includes "${_name}" INCLUDE_DIRECTORIES)
set(_includes)
foreach(_include ${_cppcheck_includes})
list(APPEND _includes "-I${_include}")
endforeach()
get_target_property(_cppcheck_sources "${_name}" SOURCES)
set(_files)
foreach(_source ${_cppcheck_sources})
get_source_file_property(_cppcheck_lang "${_source}" LANGUAGE)
get_source_file_property(_cppcheck_loc "${_source}" LOCATION)
if(("${_cppcheck_lang}" STREQUAL "C") OR ("${_cppcheck_lang}" STREQUAL "CXX"))
list(APPEND _files "${_cppcheck_loc}")
endif()
endforeach()
if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0")
# Older than CMake 2.8.0
add_test(${_name}_cppcheck_test
"${CPPCHECK_EXECUTABLE}"
${CPPCHECK_TEMPLATE_ARG}
${_cppcheck_args}
${_files})
else()
# CMake 2.8.0 and newer
add_test(NAME
${_name}_cppcheck_test
COMMAND
"${CPPCHECK_EXECUTABLE}"
${CPPCHECK_TEMPLATE_ARG}
${_cppcheck_args}
${_files})
endif()
set_tests_properties(${_name}_cppcheck_test
PROPERTIES
FAIL_REGULAR_EXPRESSION
"${CPPCHECK_FAIL_REGULAR_EXPRESSION}")
add_custom_target(${_name}_cppcheck
COMMAND
${CPPCHECK_EXECUTABLE}
${CPPCHECK_QUIET_ARG}
${CPPCHECK_TEMPLATE_ARG}
${_cppcheck_args}
${_includes}
${_files}
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT
"${_name}_cppcheck: Running cppcheck on target ${_name}..."
VERBATIM)
add_dependencies(all_cppcheck ${_name}_cppcheck)
endif()
endfunction()

View File

@ -0,0 +1,205 @@
# - Create ctest -S scripts to use to run dashboard builds
#
# include(CreateDashboardScripts)
# create_dashboard_scripts([<initialcachetemplatefilename>])
#
# If you need additional settings to persist from the "parent" CMake instance
# to the initial cache created by the dashboard script,
# you may pass a filename which will be configured into the initial cache.
#
# In the resulting DASHBOARDSCRIPT_BASE_DIRECTORY, an end-user
# may optionally create a file named
# CustomInitialCache.${DASHBOARDSCRIPT_SCRIPT_NAME}
# (by default, CustomInitialCache.go.cmake) containing set commands that use
# the CACHE option, to set up additional site-local cache variable values.
#
# Requires these CMake modules:
# GetCompilerInfoString
#
# Requires CMake 2.6 or newer (uses the 'function' command),
# as well as FindGit.cmake (included with 2.8.2, may be backported)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Only do any of the prep work if not already in a dashboard script
if(NOT IN_DASHBOARD_SCRIPT)
# Hide a CTest variable
mark_as_advanced(DART_TESTING_TIMEOUT)
include(GetCompilerInfoString)
get_compiler_info_string(_COMPILERID)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_dashboardmoddir
${CMAKE_CURRENT_LIST_FILE}
PATH)
if(NOT "$ENV{USER}" MATCHES "^$")
set(_user "$ENV{USER}")
elseif(NOT "$ENV{USERNAME}" MATCHES "^$")
set(_user "$ENV{USERNAME}")
endif()
if(NOT _dashboardscript_machine)
if(NOT SITE)
site_name(SITE)
endif()
set(_dashboardscript_machine "${SITE}" CACHE INTERNAL "")
set(SITE
"${_user}@${_dashboardscript_machine}"
CACHE
STRING
"Human-readable site name"
FORCE)
endif()
set(DASHBOARDSCRIPT_BASE_DIRECTORY
"${CMAKE_BINARY_DIR}/Dashboards-${_dashboardscript_machine}-${_user}"
CACHE
PATH
"Directory to use as the root of all dashboard work")
mark_as_advanced(DASHBOARDSCRIPT_BASE_DIRECTORY)
set(DASHBOARDSCRIPT_SOURCE_DIRECTORY "${CMAKE_SOURCE_DIR}")
set(BUILDNAME
"${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR}-${_COMPILERID}"
CACHE
STRING
"Human-readable build ID info")
set(DASHBOARDSCRIPT_CMAKE_COMMAND
"${CMAKE_COMMAND}"
CACHE
FILEPATH
"The cmake binary to use when configuring a dashboard build")
mark_as_advanced(DASHBOARDSCRIPT_CMAKE_COMMAND)
# Try to find CTest, preferably right next to the chosen CMake
if(DASHBOARDSCRIPT_CMAKE_COMMAND)
get_filename_component(_cmake_dir
${DASHBOARDSCRIPT_CMAKE_COMMAND}
PATH)
else()
get_filename_component(_cmake_dir ${CMAKE_COMMAND} PATH)
endif()
find_program(DASHBOARDSCRIPT_CTEST_EXECUTABLE
NAMES
ctest
HINTS
"${_cmake_dir}"
NO_DEFAULT_PATH)
find_program(DASHBOARDSCRIPT_CTEST_EXECUTABLE
NAMES
ctest
HINTS
"${_cmake_dir}")
set(DASHBOARDSCRIPT_CTEST_EXECUTABLE
"${DASHBOARDSCRIPT_CTEST_EXECUTABLE}"
CACHE
FILEPATH
"Path to the CTest executable to use for dashboard builds.")
mark_as_advanced(DASHBOARDSCRIPT_CTEST_EXECUTABLE)
# Optionals
if(NOT "1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0")
if(IS_DIRECTORY "${CMAKE_SOURCE_DIRECTORY}/.git")
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
# If we have a valid git we found ourselves in older version of the module,
# let the regular FindGit module (since 2.8.2) know.
if(DASHBOARDSCRIPT_GIT_EXECUTABLE AND EXISTS "${DASHBOARDSCRIPT_GIT_EXECUTABLE}" AND NOT GIT_FOUND)
set(GIT_EXECUTABLE "${DASHBOARDSCRIPT_GIT_EXECUTABLE}" CACHE FILEPATH "Git executable" FORCE)
find_package(Git QUIET)
endif()
unset(DASHBOARDSCRIPT_GIT_EXECUTABLE)
unset(DASHBOARDSCRIPT_GIT_EXECUTABLE CACHE)
if(GIT_FOUND)
set(UPDATE_TYPE "git")
set(UPDATE_COMMAND "${GIT_EXECUTABLE}")
set(UPDATE_OPTIONS "")
endif()
endif()
endif()
else()
# IN_DASHBOARD_SCRIPT is YES
message(STATUS
"CreateDashboardScripts detected that we're in a dashboard script already.")
endif()
function(create_dashboard_scripts)
# Only create the script if we have all the required variables
# and are not already in it, and are at least 2.8.0.
if(DASHBOARDSCRIPT_BASE_DIRECTORY AND
DASHBOARDSCRIPT_SOURCE_DIRECTORY AND
DASHBOARDSCRIPT_BASE_DIRECTORY AND
BUILDNAME AND
DASHBOARDSCRIPT_CMAKE_COMMAND AND
DASHBOARDSCRIPT_CTEST_EXECUTABLE AND
NOT IN_DASHBOARD_SCRIPT AND
NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.0")
set(_Continuous_cron "15 * * * * ")
set(_Nightly_cron "15 0 * * * ")
set(_Experimental_cron
"\nor run this command for an one-off experimental test build:\n")
set(_Experimental_flags "-VV")
message(STATUS
"Dashboard scripts have been generated for automatic nightly and continuous builds.")
if(WIN32)
set(_Continuous_cron)
set(_Nightly_cron)
message(STATUS
"You can set up scheduled tasks to run these command lines:")
else()
message(STATUS "You can add these sample lines to your crontab:")
endif()
set(_msg)
if(NOT DASHBOARDSCRIPT_BUILD_CONFIGURATION)
set(DASHBOARDSCRIPT_BUILD_CONFIGURATION "RelWithDebInfo")
endif()
set(DASHBOARDSCRIPT_BUILD_CONFIGURATION "${DASHBOARDSCRIPT_BUILD_CONFIGURATION}" CACHE STRING "Build configuration to use for dashboard builds by default")
mark_as_advanced(DASHBOARDSCRIPT_BUILD_CONFIGURATION)
foreach(DASHBOARDSCRIPT_DASH_TYPE Nightly Continuous Experimental)
# If given a cache template, configure it
if(ARGN)
configure_file(${ARGN}
"${DASHBOARDSCRIPT_BASE_DIRECTORY}/GeneratedInitialCache.run${DASHBOARDSCRIPT_DASH_TYPE}.cmake"
@ONLY)
endif()
# Actually create the script file
configure_file(${_dashboardmoddir}/DashboardScript.cmake.in
"${DASHBOARDSCRIPT_BASE_DIRECTORY}/run${DASHBOARDSCRIPT_DASH_TYPE}.cmake"
@ONLY)
set(_msg
"${_msg}\n${_${DASHBOARDSCRIPT_DASH_TYPE}_cron}\"${DASHBOARDSCRIPT_CTEST_EXECUTABLE}\" -S \"${DASHBOARDSCRIPT_BASE_DIRECTORY}/run${DASHBOARDSCRIPT_DASH_TYPE}.cmake\" ${_${DASHBOARDSCRIPT_DASH_TYPE}_flags}")
endforeach()
message(STATUS "\n${_msg}\n")
message(STATUS "")
endif()
endfunction()

View File

@ -0,0 +1,64 @@
# - A smarter replacement for list(REMOVE_DUPLICATES) for library lists
#
# create_imported_target(<libname> [SHARED|STATIC|MODULE] [<library dependency>...]) - where
# ${libname}_LIBRARIES is set to this library's paths.
#
# Removes duplicates from the list then sorts while preserving "optimized",
# "debug", and "general" labeling
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__create_imported_target)
return()
endif()
set(__create_imported_target YES)
function(create_imported_target _libname)
if(ARGN)
list(FIND ARGN SHARED _target_shared)
list(FIND ARGN STATIC _target_static)
list(FIND ARGN MODULE _target_module)
if(${_target_shared} GREATER -1)
set(_target_type SHARED)
elseif(${_target_static} GREATER -1)
set(_target_type STATIC)
elseif(${_target_module} GREATER -1)
set(_target_type MODULE)
else()
set(_target_type UNKNOWN)
endif()
set(_deps ${ARGN})
list(REMOVE_ITEM _deps SHARED STATIC MODULE UNKNOWN)
else()
set(_target_type UNKNOWN)
set(_deps)
endif()
if(${_libname}_LIBRARIES AND NOT TARGET ${_libname}_imported)
add_library(${_libname}_imported ${_target_type} IMPORTED)
#message(STATUS "Library ${_libname}: lib ${${_libname}_LIBRARIES}")
#message(STATUS "Deps: ${_deps}")
set_target_properties(${_libname}_imported
PROPERTIES
IMPORTED_LOCATION
"${${_libname}_LIBRARIES}"
IMPORTED_LINK_INTERFACE_LIBRARIES
"${_deps}")
endif()
if(TARGET ${_libname}_imported)
set(${_libname}_LIBRARIES ${_libname}_imported PARENT_SCOPE)
endif()
endfunction()

View File

@ -0,0 +1,349 @@
# - Create launchers to set working directory, env. vars, etc.
#
# include(CreateLaunchers) - to make these available
# guess_runtime_library_dirs(<outputvarname> [<extralibrary> ...])
# create_default_target_launcher(<targetname>
# [ARGS <args...>]
# [FORWARD_ARGS]
# [RUNTIME_LIBRARY_DIRS <dir...>]
# [WORKING_DIRECTORY <dir>]
# [ENVIRONMENT <VAR=value> [<VAR=value>...]])
#
# create_target_launcher(<targetname>
# [ARGS <args...>]
# [FORWARD_ARGS]
# [RUNTIME_LIBRARY_DIRS <dir...>]
# [WORKING_DIRECTORY <dir>]
# [ENVIRONMENT <VAR=value> [<VAR=value>...]])
#
# create_generic_launcher(<launchername>
# [RUNTIME_LIBRARY_DIRS <dir...>]
# [WORKING_DIRECTORY <dir>]
# [ENVIRONMENT <VAR=value> [<VAR=value>...]])
# - sets GENERIC_LAUNCHER_COMMAND and GENERIC_LAUNCHER_FAIL_REGULAR_EXPRESSION
#
# Requires these CMake modules:
# ListFilter
# ProgramFilesGlob
# CleanDirectoryList
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__create_launchers)
return()
endif()
set(__create_launchers YES)
include(CleanDirectoryList)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_launchermoddir
${CMAKE_CURRENT_LIST_FILE}
PATH)
set(_launchermoddir "${_launchermoddir}/launcher-templates")
macro(_launcher_system_settings)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BITS 64)
else()
set(BITS 32)
endif()
if(WIN32)
# Find user and system name
set(SYSTEM_NAME $ENV{USERDOMAIN})
set(USER_NAME $ENV{USERNAME})
set(VCPROJ_TYPE vcproj)
set(USERFILE_EXTENSION ${SYSTEM_NAME}.${USER_NAME}.user)
set(LAUNCHER_LINESEP "&#x0A;")
if(MSVC90)
set(USERFILE_VC_VERSION 9.00)
elseif(MSVC80)
set(USERFILE_VC_VERSION 8.00)
elseif(MSVC71)
set(USERFILE_VC_VERSION 7.10)
elseif(MSVC10 OR (MSVC AND MSVC_VERSION GREATER 1600)) # 2010 or newer
set(LAUNCHER_LINESEP "\n")
set(USERFILE_VC_VERSION 10.00)
set(USERFILE_EXTENSION user)
set(VCPROJ_TYPE vcxproj)
endif()
if(BITS EQUAL 64)
set(USERFILE_PLATFORM x64)
else()
set(USERFILE_PLATFORM Win${BITS})
endif()
set(_pathdelim ";")
set(_suffix "cmd")
else()
set(_pathdelim ":")
set(USERFILE_PLATFORM ${CMAKE_SYSTEM_NAME}${BITS})
set(_suffix "sh")
find_package(GDB QUIET)
if(GDB_FOUND)
set(LAUNCHERS_GOT_GDB YES)
if(GDB_HAS_RETURN_CHILD_RESULT)
set(LAUNCHERS_GDB_ARG --return-child-result)
endif()
else()
set(LAUNCHERS_GOT_GDB)
endif()
endif()
if(WIN32 AND NOT USERFILE_REMOTE_MACHINE)
site_name(USERFILE_REMOTE_MACHINE)
mark_as_advanced(USERFILE_REMOTE_MACHINE)
endif()
endmacro()
macro(_launcher_process_args)
set(_nowhere)
set(_curdest _nowhere)
set(_val_args
ARGS
RUNTIME_LIBRARY_DIRS
WORKING_DIRECTORY
ENVIRONMENT
TARGET_PLATFORM)
set(_bool_args FORWARD_ARGS)
foreach(_arg ${_val_args} ${_bool_args})
set(${_arg})
endforeach()
foreach(_element ${ARGN})
string(REPLACE ";" "\\;" _element "${_element}")
list(FIND _val_args "${_element}" _val_arg_find)
list(FIND _bool_args "${_element}" _bool_arg_find)
if("${_val_arg_find}" GREATER "-1")
set(_curdest "${_element}")
elseif("${_bool_arg_find}" GREATER "-1")
set("${_element}" ON)
set(_curdest _nowhere)
else()
list(APPEND ${_curdest} "${_element}")
endif()
endforeach()
if(_nowhere)
message(FATAL_ERROR
"Syntax error in use of a function in CreateLaunchers!")
endif()
# Turn into a list of native paths
set(_runtime_lib_dirs)
foreach(_dlldir ${RUNTIME_LIBRARY_DIRS})
file(TO_NATIVE_PATH "${_dlldir}" _path)
set(_runtime_lib_dirs "${_runtime_lib_dirs}${_path}${_pathdelim}")
endforeach()
if(NOT WORKING_DIRECTORY)
set(WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
if(FORWARD_ARGS)
if(WIN32)
set(FWD_ARGS %*)
else()
set(FWD_ARGS $*)
endif()
else()
set(FWD_ARGS)
endif()
if(TARGET_PLATFORM)
set(USERFILE_PLATFORM ${TARGET_PLATFORM})
endif()
set(USERFILE_WORKING_DIRECTORY "${WORKING_DIRECTORY}")
set(USERFILE_COMMAND_ARGUMENTS "${ARGS}")
set(LAUNCHERSCRIPT_COMMAND_ARGUMENTS "${ARGS} ${FWD_ARGS}")
if(WIN32)
if(_runtime_lib_dirs)
set(RUNTIME_LIBRARIES_ENVIRONMENT "PATH=${_runtime_lib_dirs};%PATH%")
endif()
file(READ
"${_launchermoddir}/launcher.env.cmd.in"
_cmdenv)
else()
if(_runtime_lib_dirs)
if(APPLE)
set(RUNTIME_LIBRARIES_ENVIRONMENT
"DYLD_LIBRARY_PATH=${_runtime_lib_dirs}:$DYLD_LIBRARY_PATH")
else()
set(RUNTIME_LIBRARIES_ENVIRONMENT
"LD_LIBRARY_PATH=${_runtime_lib_dirs}:$LD_LIBRARY_PATH")
endif()
endif()
file(READ
"${_launchermoddir}/launcher.env.sh.in"
_cmdenv)
endif()
set(USERFILE_ENVIRONMENT "${RUNTIME_LIBRARIES_ENVIRONMENT}")
set(USERFILE_ENV_COMMANDS)
foreach(_arg "${RUNTIME_LIBRARIES_ENVIRONMENT}" ${ENVIRONMENT})
if(_arg)
string(CONFIGURE
"@USERFILE_ENVIRONMENT@@LAUNCHER_LINESEP@@_arg@"
USERFILE_ENVIRONMENT
@ONLY)
endif()
string(CONFIGURE
"@USERFILE_ENV_COMMANDS@${_cmdenv}"
USERFILE_ENV_COMMANDS
@ONLY)
endforeach()
endmacro()
macro(_launcher_produce_vcproj_user)
if(MSVC)
file(READ
"${_launchermoddir}/perconfig.${VCPROJ_TYPE}.user.in"
_perconfig)
set(USERFILE_CONFIGSECTIONS)
foreach(USERFILE_CONFIGNAME ${CMAKE_CONFIGURATION_TYPES})
get_target_property(USERFILE_${USERFILE_CONFIGNAME}_COMMAND
${_targetname}
LOCATION_${USERFILE_CONFIGNAME})
file(TO_NATIVE_PATH
"${USERFILE_${USERFILE_CONFIGNAME}_COMMAND}"
USERFILE_${USERFILE_CONFIGNAME}_COMMAND)
string(CONFIGURE "${_perconfig}" _temp @ONLY ESCAPE_QUOTES)
string(CONFIGURE
"${USERFILE_CONFIGSECTIONS}${_temp}"
USERFILE_CONFIGSECTIONS
ESCAPE_QUOTES)
endforeach()
configure_file("${_launchermoddir}/${VCPROJ_TYPE}.user.in"
${VCPROJNAME}.${VCPROJ_TYPE}.${USERFILE_EXTENSION}
@ONLY)
endif()
endmacro()
macro(_launcher_configure_executable _src _tmp _target)
# get_filename_component(_targetname "${_target}" NAME)
get_filename_component(_targetpath "${_target}" PATH)
configure_file("${_src}"
"${_tmp}"
@ONLY)
file(COPY "${_tmp}"
DESTINATION "${_targetpath}"
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endmacro()
macro(_launcher_create_target_launcher)
if(CMAKE_CONFIGURATION_TYPES)
# Multi-config generator - multiple launchers
foreach(_config ${CMAKE_CONFIGURATION_TYPES})
get_target_property(USERFILE_${_config}_COMMAND
${_targetname}
LOCATION_${_config})
file(TO_NATIVE_PATH
"${USERFILE_${_config}_COMMAND}"
USERFILE_COMMAND)
set(_fn "launch-${_targetname}-${_config}.${_suffix}")
_launcher_configure_executable("${_launchermoddir}/targetlauncher.${_suffix}.in"
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_fn}"
"${CMAKE_CURRENT_BINARY_DIR}/${_fn}")
endforeach()
else()
# Single-config generator - single launcher
get_target_property(USERFILE_COMMAND
${_targetname}
LOCATION)
file(TO_NATIVE_PATH
"${USERFILE_COMMAND}"
USERFILE_COMMAND)
_launcher_configure_executable("${_launchermoddir}/targetlauncher.${_suffix}.in"
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/launch-${_targetname}.${_suffix}"
"${CMAKE_CURRENT_BINARY_DIR}/launch-${_targetname}.${_suffix}"
@ONLY)
endif()
endmacro()
function(create_default_target_launcher _targetname)
_launcher_system_settings()
_launcher_process_args(${ARGN})
set(VCPROJNAME "${CMAKE_BINARY_DIR}/ALL_BUILD")
_launcher_produce_vcproj_user()
_launcher_create_target_launcher()
endfunction()
function(create_target_launcher _targetname)
_launcher_system_settings()
_launcher_process_args(${ARGN})
set(VCPROJNAME "${CMAKE_CURRENT_BINARY_DIR}/${_targetname}")
_launcher_produce_vcproj_user()
_launcher_create_target_launcher()
endfunction()
function(create_generic_launcher _launchername)
_launcher_system_settings()
_launcher_process_args(${ARGN})
if(NOT IS_ABSOLUTE _launchername)
set(_launchername
"${CMAKE_CURRENT_BINARY_DIR}/${_launchername}.${_suffix}")
else()
set(_launchername "${_launchername}.${_suffix}")
endif()
if(WIN32)
set(GENERIC_LAUNCHER_COMMAND "${_launchername}" PARENT_SCOPE)
set(GENERIC_LAUNCHER_FAIL_REGULAR_EXPRESSION)
else()
set(GENERIC_LAUNCHER_COMMAND sh "${_launchername}" PARENT_SCOPE)
set(GENERIC_LAUNCHER_FAIL_REGULAR_EXPRESSION
"Program terminated with signal")
endif()
_launcher_configure_executable("${_launchermoddir}/genericlauncher.${_suffix}.in"
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/genericlauncher.${_suffix}.in"
"${_launchername}")
endfunction()
function(guess_runtime_library_dirs _var)
# Start off with the link directories of the calling listfile's directory
get_directory_property(_libdirs LINK_DIRECTORIES)
# Add additional libraries passed to the function
foreach(_lib ${ARGN})
get_filename_component(_libdir "${_lib}" PATH)
list(APPEND _libdirs "${_libdir}")
endforeach()
# Now, build a list of potential dll directories
set(_dlldirs)
foreach(_libdir ${_libdirs})
# Add the libdir itself
list(APPEND _dlldirs "${_libdir}")
# Look also in libdir/../bin since the dll might not be with the lib
get_filename_component(_libdir "${_libdir}/../bin" ABSOLUTE)
list(APPEND _dlldirs "${_libdir}")
endforeach()
# Only keep the valid, unique directories
clean_directory_list(_dlldirs)
# Return _dlldirs
set(${_var} "${_dlldirs}" PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,122 @@
# - Dashboard driver script for use with ctest.
#
# Generated file processed by CreateDashboardScripts.cmake
# Run it like:
# ctest -S nameofthisfile
# with -V or -V -VV if you want more feedback.
#
# Generally you do not need to edit this file by hand!
#
# If this file isn't named DashboardScript.cmake.in and located
# in the same directory as CreateDashboardScripts.cmake, it has been
# auto-generated and will be overwritten every time CMake configures
# itself. (This may be every build!)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set(CTEST_PROJECT_NAME "@PROJECT_NAME@")
set(CTEST_DASHBOARD_ROOT "@DASHBOARDSCRIPT_BASE_DIRECTORY@")
set(CTEST_SOURCE_DIRECTORY "@DASHBOARDSCRIPT_SOURCE_DIRECTORY@")
set(DASH_TYPE "@DASHBOARDSCRIPT_DASH_TYPE@")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/build-${DASH_TYPE}")
set(CTEST_NOTES_FILES
"${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}"
"${CTEST_DASHBOARD_ROOT}/GeneratedCombinedCache.${CTEST_SCRIPT_NAME}")
set(CTEST_BUILD_NAME "@BUILDNAME@")
set(CTEST_SITE "@SITE@")
set(CTEST_USE_LAUNCHERS TRUE)
set(CTEST_COMMAND "@DASHBOARDSCRIPT_CTEST_EXECUTABLE@")
set(CTEST_CMAKE_COMMAND "@DASHBOARDSCRIPT_CMAKE_COMMAND@")
set(CTEST_UPDATE_TYPE "@UPDATE_TYPE@")
set(CTEST_UPDATE_COMMAND "@UPDATE_COMMAND@")
set(CTEST_UPDATE_OPTIONS "@UPDATE_OPTIONS@")
if((NOT CTEST_CONFIGURATION_TYPE) OR (NOT CTEST_BUILD_CONFIGURATION))
set(CTEST_BUILD_CONFIGURATION "@DASHBOARDSCRIPT_BUILD_CONFIGURATION@")
set(CTEST_CONFIGURATION_TYPE "@DASHBOARDSCRIPT_BUILD_CONFIGURATION@")
endif()
# Avoid non-ascii characters in tool output.
set(ENV{LC_ALL} C)
if(EXISTS "${CTEST_DASHBOARD_ROOT}/GeneratedInitialCache.${CTEST_SCRIPT_NAME}")
file(READ "${CTEST_DASHBOARD_ROOT}/GeneratedInitialCache.${CTEST_SCRIPT_NAME}" _initcache)
else()
set(_initcache)
endif()
if(EXISTS "${CTEST_DASHBOARD_ROOT}/CustomInitialCache.cmake")
file(READ "${CTEST_DASHBOARD_ROOT}/CustomInitialCache.cmake" _customcache)
set(_initcache "${_initcache}
${_customcache}")
endif()
set(_initcache "# This file is automatically regenerated every dashboard build -
# Do not edit it directly!
# If you want to add initial cache values, you can create/modify
# the CustomInitialCache.cmake file in this directory.
# Pretty typical settings to preseve from the generating cache
set(BUILD_TESTING ON CACHE BOOL docstring)
set(IN_DASHBOARD_SCRIPT ON CACHE BOOL docstring)
set(CTEST_USE_LAUNCHERS ON CACHE BOOL docstring)
set(CMAKE_PREFIX_PATH \"@CMAKE_PREFIX_PATH@\" CACHE STRING docstring)
set(CMAKE_BUILD_TYPE \"@CMAKE_BUILD_TYPE@\" CACHE STRING docstring)
set(CTEST_CONFIGURATION_TYPE \"@CMAKE_BUILD_TYPE@\" CACHE STRING docstring)
# testing tool locations
# Saved here because the tools in the path might be outdated
set(CPPCHECK_EXECUTABLE \"@CPPCHECK_EXECUTABLE@\" CACHE FILEPATH docstring)
set(DOXYGEN_EXECUTABLE \"@DOXYGEN_EXECUTABLE@\" CACHE FILEPATH docstring)
${_initcache}")
file(WRITE "${CTEST_DASHBOARD_ROOT}/GeneratedCombinedCache.${CTEST_SCRIPT_NAME}" "${_initcache}")
ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}")
ctest_start(${DASH_TYPE})
if(CTEST_UPDATE_COMMAND AND NOT DASH_TYPE STREQUAL "Experimental")
ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
endif()
# Only proceed if we updated a file or if we're not a continuous build
set(PROCEED NO)
if(res GREATER 0)
message(STATUS "One or more files were updated, so we will proceed to "
"and build")
set(PROCEED YES)
endif()
if(NOT DASH_TYPE STREQUAL "Continuous")
message(STATUS "We are not a continuous dashboard, so continuing regardless "
"of whether any files were updated")
set(PROCEED YES)
endif()
if(PROCEED)
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res
OPTIONS "-C${CTEST_DASHBOARD_ROOT}/GeneratedCombinedCache.${CTEST_SCRIPT_NAME}")
if(${res} EQUAL 0)
# Only try to build if we could configure
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
# Some tests, like cppcheck tests, don't depend on a successful build
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
endif()
endif()
# Always submit results
ctest_submit(RETURN_VALUE res)

View File

@ -0,0 +1,357 @@
# - Run doxygen on source files as a custom target
#
# include(DoxygenTargets)
# add_doxygen(<doxyfile> [OUTPUT_DIRECTORY <outputdir>]
# [EXTRA_INPUT <single path or quoted list of paths>]
# [EXTRA_STRIP_FROM_PATH <single path or quoted list of paths>]
# [EXTRA_STRIP_FROM_INC_PATH <single path or quoted list of paths>]
# [INSTALL_DESTINATION <installdir>
# [INSTALL_COMPONENT <installcomponent>]
# [INSTALL_PDF_NAME <installpdfname>] ]
# [DOC_TARGET <targetname>]
# [PROJECT_NUMBER <versionnumber>]
# [NO_WARNINGS]
# [NO_PDF])
#
# Requires these CMake modules:
# FindDoxygen
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__add_doxygen)
return()
endif()
set(__add_doxygen YES)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_doxygenmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
if(APPLE)
list(APPEND CMAKE_PREFIX_PATH "/usr/texbin")
endif()
if(NOT DOXYGEN_FOUND)
find_package(Doxygen QUIET)
endif()
set(DOXYGEN_LATEX "NO")
set(DOXYGEN_PDFLATEX "NO")
set(DOXYGEN_DOT "NO")
if(DOXYGEN_DOT_EXECUTABLE)
set(DOXYGEN_DOT "YES")
endif()
find_package(LATEX QUIET)
if(LATEX_COMPILER AND MAKEINDEX_COMPILER)
set(DOXYGEN_LATEX "YES")
endif()
if(PDFLATEX_COMPILER)
set(DOXYGEN_PDFLATEX "YES")
endif()
set(_PF86 "ProgramFiles(x86)")
find_program(DOXYGEN_MSCGEN_EXECUTABLE
mscgen
PATHS
"$ENV{ProgramFiles}/Mscgen"
"$ENV{${_PF86}}/Mscgen"
"$ENV{ProgramW6432}/Mscgen")
if(DOXYGEN_MSCGEN_EXECUTABLE)
mark_as_advanced(DOXYGEN_MSCGEN_EXECUTABLE)
endif()
# An optional single-file install that supports cmake older than 2.8.0
# For internal use
function(_dt_install_file target filename dest rename)
if(CMAKE_VER VERSION_LESS 2.8.0)
set(INSTALL_CODE "
if(EXISTS \"${filename}\")
message(STATUS \"Found: ${filename}\")
file(INSTALL
DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${dest}\"
TYPE FILE
RENAME \"${rename}\"
FILES \"${filename}\")
else()
message(STATUS \"Skipping (build '${target}' to create): ${filename}\")
endif()
")
if(NOT ARGN STREQUAL "")
set(INSTALL_COMPONENT "${ARGN}")
set(INSTALL_CODE "
if(NOT CMAKE_INSTALL_COMPONENT OR \"\${CMAKE_INSTALL_COMPONENT}\" STREQUAL \"${INSTALL_COMPONENT}\")
${INSTALL_CODE}
endif()
")
endif()
install(CODE "${INSTALL_CODE}")
else()
set(COMPONENT_ARGS)
if(NOT ARGN STREQUAL "")
set(COMPONENT_ARGS COMPONENT "${ARGN}")
endif()
install(FILES
"${filename}"
DESTINATION
"${dest}"
RENAME "${rename}"
${COMPONENT_ARGS}
OPTIONAL)
endif()
endfunction()
# An optional single-directory install that supports cmake older than 2.8.0
# For internal use
function(_dt_install_dir target dir dest)
if(CMAKE_VER VERSION_LESS 2.8.0)
set(INSTALL_CODE "
if(EXISTS \"${dir}\")
message(STATUS \"Found: ${dir}\")
file(INSTALL
DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${dest}\"
TYPE DIRECTORY
FILES \"${dir}\")
else()
message(STATUS \"Skipping (build '${target}' to create): ${dir}\")
endif()
")
if(NOT ARGN STREQUAL "")
set(INSTALL_COMPONENT "${ARGN}")
set(INSTALL_CODE "
if(NOT CMAKE_INSTALL_COMPONENT OR \"\${CMAKE_INSTALL_COMPONENT}\" STREQUAL \"${INSTALL_COMPONENT}\")
${INSTALL_CODE}
endif()
")
endif()
install(CODE "${INSTALL_CODE}")
else()
set(COMPONENT_ARGS)
if(NOT ARGN STREQUAL "")
set(COMPONENT_ARGS COMPONENT "${ARGN}")
endif()
install(DIRECTORY
"${dir}"
DESTINATION
"${dest}"
${COMPONENT_ARGS}
OPTIONAL)
endif()
endfunction()
function(add_doxygen _doxyfile)
# parse arguments
set(WARNINGS YES)
set(_nowhere)
set(_curdest _nowhere)
set(_val_args
OUTPUT_DIRECTORY
EXTRA_INPUT
EXTRA_STRIP_FROM_PATH
EXTRA_STRIP_FROM_INC_PATH
DOC_TARGET
INSTALL_DESTINATION
INSTALL_COMPONENT
INSTALL_PDF_NAME
PROJECT_NUMBER)
set(_bool_args
NO_WARNINGS
NO_PDF)
foreach(_arg ${_val_args} ${_bool_args})
set(${_arg})
endforeach()
foreach(_element ${ARGN})
list(FIND _val_args "${_element}" _val_arg_find)
list(FIND _bool_args "${_element}" _bool_arg_find)
if("${_val_arg_find}" GREATER "-1")
set(_curdest "${_element}")
elseif("${_bool_arg_find}" GREATER "-1")
set("${_element}" ON)
set(_curdest _nowhere)
else()
list(APPEND ${_curdest} "${_element}")
endif()
endforeach()
if(_nowhere)
message(FATAL_ERROR "Syntax error in use of add_doxygen!")
endif()
if(NO_WARNINGS)
set(WARNINGS NO)
endif()
if(NOT DOC_TARGET)
set(DOC_TARGET doc)
endif()
if(NOT OUTPUT_DIRECTORY)
set(OUTPUT_DIRECTORY "docs-generated")
endif()
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_DIRECTORY}")
if(NOT INSTALL_PDF_NAME)
set(INSTALL_PDF_NAME "docs-generated.pdf")
endif()
if(NOT PROJECT_NUMBER)
set(PROJECT_NUMBER "${CPACK_PACKAGE_VERSION}")
endif()
if(DOXYGEN_FOUND)
if(TARGET ${DOC_TARGET})
message(FATAL_ERROR "Documentation target ${DOC_TARGET} already exists!")
endif()
if(NOT IS_ABSOLUTE "${OUTPUT_DIRECTORY}")
get_filename_component(OUTPUT_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_DIRECTORY}"
ABSOLUTE)
endif()
set_property(DIRECTORY
APPEND
PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
"${OUTPUT_DIRECTORY}/html"
"${OUTPUT_DIRECTORY}/latex")
if(NOT TARGET ${DOC_TARGET}_open)
# Create a target to open the generated HTML file.
if(WIN32)
set(DOXYGEN_LAUNCHER_COMMAND start)
elseif(NOT APPLE)
set(DOXYGEN_LAUNCHER_COMMAND xdg-open)
endif()
if(DOXYGEN_LAUNCHER_COMMAND)
add_custom_target(${DOC_TARGET}_open
COMMAND ${DOXYGEN_LAUNCHER_COMMAND} "${OUTPUT_DIRECTORY}/html/index.html"
VERBATIM)
set_target_properties(${DOC_TARGET}_open
PROPERTIES
EXCLUDE_FROM_ALL
TRUE)
set_target_properties(${DOC_TARGET}_open
PROPERTIES
EXCLUDE_FROM_DEFAULT_BUILD
TRUE)
add_dependencies(${DOC_TARGET}_open ${DOC_TARGET})
endif()
endif()
get_filename_component(_doxyfileabs "${_doxyfile}" ABSOLUTE)
get_filename_component(INCLUDE_FILE "${_doxyfileabs}" NAME)
get_filename_component(INCLUDE_PATH "${_doxyfileabs}" PATH)
# Doesn't currently work on Windows, so don't bother
if(DOXYGEN_LATEX AND NOT NO_PDF AND NOT WIN32)
set(MAKE_PDF YES)
set(GENERATE_LATEX YES)
else()
set(MAKE_PDF NO)
set(GENERATE_LATEX NO)
endif()
if(DOXYGEN_PDFLATEX AND MAKE_PDF)
set(USE_PDFLATEX YES)
else()
set(USE_PDFLATEX NO)
endif()
if(DOXYGEN_DOT)
set(HAVE_DOT YES)
set(DOT_PATH ${DOXYGEN_DOT_PATH})
else()
set(HAVE_DOT NO)
set(DOT_PATH)
endif()
if(DOXYGEN_MSCGEN_EXECUTABLE)
get_filename_component(MSCGEN_PATH "${DOXYGEN_MSCGEN_EXECUTABLE}" PATH)
endif()
# See http://www.cmake.org/pipermail/cmake/2006-August/010786.html
# for info on this variable
if("${CMAKE_BUILD_TOOL}" MATCHES "(msdev|devenv)")
set(WARN_FORMAT "\"$file($line) : $text \"")
else()
set(WARN_FORMAT "\"$file:$line: $text \"")
endif()
configure_file("${_doxygenmoddir}/DoxygenTargets.doxyfile.in"
"${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.${DOC_TARGET}.additional"
@ONLY)
if(IN_DASHBOARD_SCRIPT)
set(ALL_IN_DASHBOARD ALL)
else()
set(ALL_IN_DASHBOARD)
endif()
add_custom_target(${DOC_TARGET} ${ALL_IN_DASHBOARD}
COMMAND
"${DOXYGEN_EXECUTABLE}"
"${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.${DOC_TARGET}.additional"
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
#MAIN_DEPENDENCY ${DOC_TARGET}
COMMENT
"Running Doxygen with configuration ${_doxyfile}..."
VERBATIM)
if(NOT IN_DASHBOARD_SCRIPT)
set_target_properties(${DOC_TARGET}
PROPERTIES
EXCLUDE_FROM_ALL
TRUE)
set_target_properties(${DOC_TARGET}
PROPERTIES
EXCLUDE_FROM_DEFAULT_BUILD
TRUE)
endif()
if(MAKE_PDF)
add_custom_command(TARGET
${DOC_TARGET}
POST_BUILD
COMMAND
${CMAKE_MAKE_PROGRAM}
WORKING_DIRECTORY
"${OUTPUT_DIRECTORY}/latex"
COMMENT
"Generating PDF using PDFLaTeX..."
VERBATIM)
endif()
if(INSTALL_DESTINATION)
if(INSTALL_COMPONENT)
_dt_install_dir("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/html" "${INSTALL_DESTINATION}" "${INSTALL_COMPONENT}")
if(MAKE_PDF)
_dt_install_file("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/latex/refman.pdf" "${INSTALL_DESTINATION}" "${INSTALL_PDF_NAME}" "${INSTALL_COMPONENT}")
endif()
else()
_dt_install_dir("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/html" "${INSTALL_DESTINATION}")
if(MAKE_PDF)
_dt_install_file("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/latex/refman.pdf" "${INSTALL_DESTINATION}" "${INSTALL_PDF_NAME}")
endif()
endif()
endif()
endif()
endfunction()

View File

@ -0,0 +1,23 @@
@INCLUDE_PATH = "@INCLUDE_PATH@"
@INCLUDE = "@INCLUDE_FILE@"
OUTPUT_DIRECTORY = "@OUTPUT_DIRECTORY@"
GENERATE_LATEX = "@GENERATE_LATEX@"
USE_PDFLATEX = @USE_PDFLATEX@
HAVE_DOT = @HAVE_DOT@
DOT_PATH = "@DOT_PATH@"
MSCGEN_PATH = "@MSCGEN_PATH@"
LATEX_CMD_NAME = "@LATEX_COMPILER@"
MAKEINDEX_CMD_NAME = "@MAKEINDEX_COMPILER@"
WARNINGS = @WARNINGS@
WARN_FORMAT = @WARN_FORMAT@
PROJECT_NUMBER = @PROJECT_NUMBER@
INPUT += @EXTRA_INPUT@
STRIP_FROM_PATH += @EXTRA_STRIP_FROM_PATH@
STRIP_FROM_INC_PATH += @EXTRA_STRIP_FROM_INC_PATH@
LATEX_BATCHMODE = YES
QUIET = YES

View File

@ -0,0 +1,88 @@
# - Add flags to compile with extra warnings
#
# enable_extra_compiler_warnings(<targetname>)
# globally_enable_extra_compiler_warnings() - to modify CMAKE_CXX_FLAGS, etc
# to change for all targets declared after the command, instead of per-command
#
#
# Original Author:
# 2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__enable_extra_compiler_warnings)
return()
endif()
set(__enable_extra_compiler_warnings YES)
macro(_enable_extra_compiler_warnings_flags)
set(_flags)
if(MSVC)
option(COMPILER_WARNINGS_EXTREME
"Use compiler warnings that are probably overkill."
off)
mark_as_advanced(COMPILER_WARNINGS_EXTREME)
set(_flags "/W4")
if(COMPILER_WARNINGS_EXTREME)
set(_flags "${_flags} /Wall /wd4619 /wd4668 /wd4820 /wd4571 /wd4710")
endif()
else()
include(CheckCXXCompilerFlag)
set(_flags)
check_cxx_compiler_flag(-W SUPPORTS_W_FLAG)
if(SUPPORTS_W_FLAG)
set(_flags "${_flags} -W")
endif()
check_cxx_compiler_flag(-Wall SUPPORTS_WALL_FLAG)
if(SUPPORTS_WALL_FLAG)
set(_flags "${_flags} -Wall")
endif()
check_cxx_compiler_flag(-Wextra SUPPORTS_WEXTRA_FLAG)
if(SUPPORTS_WEXTRA_FLAG)
set(_flags "${_flags} -Wextra")
endif()
if(SUPPORTS_WALL_FLAG)
# At least GCC includes -Wmaybe-uninitialized in -Wall, which
# unneccesarily whines about boost::optional (by it's nature
# it's a "maybe" warning - prone to noisy false-positives)
check_cxx_compiler_flag(-Wno-maybe-uninitialized SUPPORTS_WNO_MAYBE_UNINITIALIZED_FLAG)
if(SUPPORTS_WNO_MAYBE_UNINITIALIZED_FLAG)
set(_flags "${_flags} -Wno-maybe-uninitialized")
endif()
endif()
endif()
endmacro()
function(enable_extra_compiler_warnings _target)
_enable_extra_compiler_warnings_flags()
get_target_property(_origflags ${_target} COMPILE_FLAGS)
if(_origflags)
set_property(TARGET
${_target}
PROPERTY
COMPILE_FLAGS
"${_flags} ${_origflags}")
else()
set_property(TARGET
${_target}
PROPERTY
COMPILE_FLAGS
"${_flags}")
endif()
endfunction()
function(globally_enable_extra_compiler_warnings)
_enable_extra_compiler_warnings_flags()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,56 @@
# - Add flags to compile with profiling support - currently only for GCC
#
# enable_profiling(<targetname>)
# globally_enable_profiling() - to modify CMAKE_CXX_FLAGS, etc
# to change for all targets declared after the command, instead of per-command
#
#
# Original Author:
# 2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__enable_profiling)
return()
endif()
set(__enable_profiling YES)
macro(_enable_profiling_flags)
set(_flags)
if(MSVC)
# TODO: what kind of flags are needed to profile on MSVC?
#set(_flags /W4)
elseif(CMAKE_COMPILER_IS_GNUCXX)
set(_flags "-p")
endif()
endmacro()
function(enable_profiling _target)
_enable_profiling_flags()
get_target_property(_origflags ${_target} COMPILE_FLAGS)
if(_origflags)
set_property(TARGET
${_target}
PROPERTY
COMPILE_FLAGS
"${_flags} ${_origflags}")
else()
set_property(TARGET
${_target}
PROPERTY
COMPILE_FLAGS
"${_flags}")
endif()
endfunction()
function(globally_enable_profiling)
_enable_profiling_flags()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,103 @@
# - Add a target for files that just need to be copied
#
# include(FileCopyTargets)
# add_file_copy_target(<target_name> <directory to copy to> <filename> [<filename>...])
# Creates a custom target that copies the files to a directory, if needed.
# Relative paths for the destination directory are considered with
# with respect to CMAKE_CURRENT_BINARY_DIR
# You can use this target in all the usual ways, including
# add_dependencies(some_other_target this_target) to specify that another
# target depends on this.
#
# install_file_copy_target(<target_name> [arguments to INSTALL(PROGRAMS ...) ])
# Works just the same as INSTALL(PROGRAMS ...) because it wraps it to install
# the files you specified in add_file_copy_target
#
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__add_file_copy_target)
return()
endif()
set(__add_file_copy_target YES)
define_property(TARGET
PROPERTY
FILE_COPY_TARGET
BRIEF_DOCS
"File Copy target"
FULL_DOCS
"Is this a target created by add_file_copy_target?")
function(add_file_copy_target _target _dest)
if(NOT ARGN)
message(WARNING
"In add_file_copy_target call for target ${_target}, no source files were specified!")
return()
endif()
set(ALLFILES)
set(SOURCES)
foreach(fn ${ARGN})
# Produce an absolute path to the input file
if(IS_ABSOLUTE "${fn}")
get_filename_component(fullpath "${fn}" ABSOLUTE)
get_filename_component(fn "${fn}" NAME)
else()
get_filename_component(fullpath
"${CMAKE_CURRENT_SOURCE_DIR}/${fn}"
ABSOLUTE)
endif()
# Clean up output file name
get_filename_component(absout "${_dest}/${fn}" ABSOLUTE)
add_custom_command(OUTPUT "${absout}"
COMMAND
${CMAKE_COMMAND}
ARGS -E make_directory "${_dest}"
COMMAND
${CMAKE_COMMAND}
ARGS -E copy "${fullpath}" "${_dest}"
MAIN_DEPENDENCY "${fullpath}"
VERBATIM
COMMENT "Copying ${fn} to ${absout}")
list(APPEND SOURCES "${fullpath}")
list(APPEND ALLFILES "${absout}")
endforeach()
# Custom target depending on all the file copy commands
add_custom_target(${_target}
SOURCES ${SOURCES}
DEPENDS ${ALLFILES})
set_property(TARGET ${_target} PROPERTY FILE_COPY_TARGET YES)
endfunction()
function(install_file_copy_target _target)
get_target_property(_isFCT ${_target} FILE_COPY_TARGET)
if(NOT _isFCT)
message(WARNING
"install_file_copy_target called on a target not created with add_file_copy_target!")
return()
endif()
# Get sources
get_target_property(_srcs ${_target} SOURCES)
# Remove the "fake" file forcing build
list(REMOVE_AT _srcs 0)
# Forward the call to install
install(PROGRAMS ${_srcs} ${ARGN})
endfunction()

View File

@ -0,0 +1,136 @@
# - try to find the OpenAL ALUT library
#
# Users may optionally supply:
# ALUT_ROOT_DIR - a prefix to start searching.
#
# Cache Variables: (probably not for direct use in your scripts)
# ALUT_INCLUDE_DIR
# ALUT_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# ALUT_FOUND
# ALUT_INCLUDE_DIRS
# ALUT_LIBRARIES
# ALUT_WORKAROUND_INCLUDE_DIRS - add these to your include path with
# include_directories(${ALUT_WORKAROUND_INCLUDE_DIRS} ${ALUT_INCLUDE_DIRS})
# so you can always #include <AL/al.h> and #include <AL/alut.h> even on
# Mac where the paths might differ.
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(ALUT_ROOT_DIR
"${ALUT_ROOT_DIR}"
CACHE
PATH
"Path to search for ALUT library")
# Share search paths with OpenAL
if(NOT "$ENV{OPENALDIR}" STREQUAL "")
if(NOT ALUT_ROOT_DIR)
set(ALUT_ROOT_DIR "$ENV{OPENALDIR}")
endif()
else()
if(ALUT_ROOT_DIR)
set(ENV{OPENALDIR} "${ALUT_ROOT_DIR}")
endif()
endif()
###
# Configure ALUT
###
find_path(ALUT_INCLUDE_DIR
NAMES
alut.h
HINTS
"${ALUT_ROOT_DIR}"
PATH_SUFFIXES
AL
alut
OpenAL
include
include/alut
include/freealut
include/AL
include/OpenAL
PATHS
/usr/local
/opt/local
/sw)
mark_as_advanced(ALUT_INCLUDE_DIR)
find_library(ALUT_LIBRARY
NAMES
alut
HINTS
"${ALUT_ROOT_DIR}"
PATH_SUFFIXES
lib
lib64
PATHS
/usr/local
/opt/local
/sw)
mark_as_advanced(ALUT_LIBRARY)
###
# Prereq: OpenAL
###
# On Mac OS X, the ALUT headers were in the OpenAL framework until 10.4.7
# If we found ALUT headers elsewhere, it's probably freealut which may
# define the same symbols as the library in the framework (?)
# so we might want to save/restore the CMake variable that controls searching
# in frameworks
find_package(OpenAL QUIET)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ALUT
DEFAULT_MSG
ALUT_LIBRARY
ALUT_INCLUDE_DIR
OPENAL_FOUND)
if(ALUT_FOUND)
set(ALUT_INCLUDE_DIRS "${OPENAL_INCLUDE_DIR}" "${ALUT_INCLUDE_DIR}")
set(ALUT_LIBRARIES "${OPENAL_LIBRARY}" ${ALUT_LIBRARY})
if(APPLE)
get_filename_component(_moddir ${CMAKE_CURRENT_LIST_FILE} PATH)
if("${OPENAL_INCLUDE_DIR}" MATCHES "\\.framework$")
# OpenAL is in a framework - need a workaround
set(OPENAL_WORKAROUND_INCLUDE_DIR
"${_moddir}/workarounds/mac-openal")
list(APPEND
ALUT_WORKAROUND_INCLUDE_DIRS
"${OPENAL_WORKAROUND_INCLUDE_DIR}")
endif()
if("${ALUT_INCLUDE_DIR}" MATCHES "\\.framework$")
# ALUT is in the OpenAL framework - need a workaround
set(ALUT_WORKAROUND_INCLUDE_DIR
"${_moddir}/workarounds/mac-alut-framework")
list(APPEND
ALUT_WORKAROUND_INCLUDE_DIRS
"${ALUT_WORKAROUND_INCLUDE_DIR}")
endif()
endif()
if("${ALUT_INCLUDE_DIR}" MATCHES "AL$")
get_filename_component(_parent "${ALUT_INCLUDE_DIR}/.." ABSOLUTE)
list(APPEND ALUT_INCLUDE_DIRS "${_parent}")
endif()
mark_as_advanced(ALUT_ROOT_DIR)
endif()

View File

@ -0,0 +1,202 @@
# - try to find Adrienne Electronics Corporation timecode card library
#
# SDK available from the manufacturer: http://www.adrielec.com/
#
# Cache Variables: (probably not for direct use in your scripts)
# ADRIENNE_INCLUDE_DIR
# ADRIENNE_LIBRARY
# ADRIENNE_RUNTIME_LIBRARY
# ADRIENNE_INCLUDE_FILE
#
# Variables you might use in your CMakeLists.txt:
# ADRIENNE_FOUND
# ADRIENNE_INCLUDE_DIRS
# ADRIENNE_LIBRARIES
# ADRIENNE_RUNTIME_LIBRARIES - the AEC_NTTC.dll file
# ADRIENNE_RUNTIME_LIBRARY_DIRS
#
# ADRIENNE_INCLUDE_FILENAME - this is probably AEC_NTTC.h, but it might also
# be AECINTTC.H.
#
# ADRIENNE_INCLUDE_HAS_EXTERN_C - Some (most) versions of the header already
# wrap their definitions in extern "C" { }, but some do not.
#
# ADRIENNE_DEFINITIONS - defines a quoted ADRIENNE_INCLUDE_FILENAME as above,
# so you can write a line like #include ADRIENNE_INCLUDE_FILENAME
# Also defines ADRIENNE_BEFORE_INCLUDE and ADRIENNE_AFTER_INCLUDE to handle
# adding extern "C" { and } if the header file doesn't do so itself.
#
# Variables that might be set by the user in the gui/command line to help
# find the library:
# ADRIENNE_ROOT_DIR - root of an Adrienne CD, disk, or extracted/copied contents
# thereof.
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Apparently Windows only.
if(WIN32 OR CYGWIN)
set(ADRIENNE_ROOT_DIR
"${ADRIENNE_ROOT_DIR}"
CACHE
PATH
"Directory to search for Adrienne Electronics Timecode data - root of a software distribution or extracted download from http://www.adrielec.com/")
set(ADRIENNE_DEFINITIONS)
set(ADRIENNE_INCLUDE_SEARCH
# from AecPCIeTC_8-12a: contains AEC_NTTC.h with extern "C" and three extra functions:
# AEC_PCTC_OPEN_ALL, AEC_PCTC_CLOSE_ALL, AEC_PCTC_INITIALIZE_EVENT
"SDK_SourceCode"
# from AecPci6_02_CD - called AECINTTC.H but otherwise essentially identical to earlier versions
"TestPrograms_WithDLL/DLL_API_INFO"
# A zipped development project contains essentially the same, named AEC_NTTC.h so we'll add this in case it's unzipped.
"TestPrograms_WithDLL/ZippedDevelopmentProjects/AecMfc32_Rel504"
# from pc-ltc - called AECINTTC.H and lacks extern "C"
"NT-CODE/C40-APP1"
)
set(ADRIENNE_HEADER_NAMES
AEC_NTTC.H
AEC_NTTC.h
Aec_nttc.h
AECINTTC.H)
set(ADRIENNE_LIB_SEARCH)
set(ADRIENNE_DLL_SEARCH)
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
# 64 bit code - apparently initially packaged only in the
# PCIe version of their software
list(APPEND ADRIENNE_LIB_SEARCH
# from AecPCIeTC_8-12a
"64BitOS_files/DLL Versions")
list(APPEND ADRIENNE_DLL_SEARCH
# from AecPCIeTC_8-12a
"64BitOS_files/DLL Versions")
else()
# 32-bit code, much more prevalent.
list(APPEND ADRIENNE_LIB_SEARCH
# from AecPCIeTC_8-12a
"32BitOS_files/DLLversions"
# from AecPci6_02_CD
"TestPrograms_WithDLL/DLL_API_INFO"
# from pc-ltc
"NT-CODE/DLL"
)
list(APPEND ADRIENNE_DLL_SEARCH
# from AecPCIeTC_8-12a
"32BitOS_files/DLLversions"
# from AecPci6_02_CD
"TestPrograms_WithDLL"
# from pc-ltc
"NT-CODE/DLL")
endif()
find_library(ADRIENNE_LIBRARY
NAMES
AEC_NTTC
PATHS
"${ADRIENNE_ROOT_DIR}"
PATH_SUFFIXES
${ADRIENNE_LIB_SEARCH})
find_path(ADRIENNE_INCLUDE_DIR
NAMES
${ADRIENNE_HEADER_NAMES}
PATHS
"${ADRIENNE_ROOT_DIR}"
PATH_SUFFIXES
${ADRIENNE_INCLUDE_SEARCH})
if(ADRIENNE_INCLUDE_DIR)
find_file(ADRIENNE_INCLUDE_FILE
NAMES
${ADRIENNE_HEADER_NAMES}
HINTS
${ADRIENNE_INCLUDE_DIR})
# Get include filename
get_filename_component(ADRIENNE_INCLUDE_FILENAME
"${ADRIENNE_INCLUDE_FILE}"
NAME)
list(APPEND ADRIENNE_DEFINITIONS -DADRIENNE_INCLUDE_FILENAME="ADRIENNE_INCLUDE_FILENAME")
# Find out if it has extern "C" in it.
file(STRINGS "${ADRIENNE_INCLUDE_FILE}" strings)
set(ADRIENNE_INCLUDE_HAS_EXTERN_C OFF)
foreach(_line ${strings})
if("${_line}" STREQUAL "extern \"C\"")
set(ADRIENNE_INCLUDE_HAS_EXTERN_C ON)
break()
endif()
endforeach()
if(ADRIENNE_INCLUDE_HAS_EXTERN_C)
list(APPEND ADRIENNE_DEFINITIONS -DADRIENNE_BEFORE_INCLUDE -DADRIENNE_AFTER_INCLUDE)
else()
list(APPEND ADRIENNE_DEFINITIONS "-DADRIENNE_BEFORE_INCLUDE=extern \"C\" {" "-DADRIENNE_AFTER_INCLUDE=}")
endif()
endif()
get_filename_component(_adrienne_libdir "${ADRIENNE_LIBRARY}" PATH)
find_file(ADRIENNE_RUNTIME_LIBRARY
NAMES
AEC_NTTC.dll
HINTS
"${_adrienne_libdir}"
"${_adrienne_libdir}/.."
PATHS
"${ADRIENNE_ROOT_DIR}"
PATH_SUFFIXES
${ADRIENNE_DLL_SEARCH})
set(ADRIENNE_RUNTIME_LIBRARIES "${ADRIENNE_RUNTIME_LIBRARY}")
get_filename_component(ADRIENNE_RUNTIME_LIBRARY_DIRS
"${ADRIENNE_RUNTIME_LIBRARY}"
PATH)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Adrienne
DEFAULT_MSG
ADRIENNE_LIBRARY
ADRIENNE_RUNTIME_LIBRARY
ADRIENNE_INCLUDE_DIR
ADRIENNE_INCLUDE_FILENAME)
if(ADRIENNE_FOUND)
set(ADRIENNE_LIBRARIES "${ADRIENNE_LIBRARY}")
set(ADRIENNE_INCLUDE_DIRS "${ADRIENNE_INCLUDE_DIR}")
mark_as_advanced(ADRIENNE_ROOT_DIR)
endif()
mark_as_advanced(
ADRIENNE_LIBRARY
ADRIENNE_RUNTIME_LIBRARY
ADRIENNE_INCLUDE_DIR
ADRIENNE_INCLUDE_FILE)
else()
set(ADRIENNE_FOUND OFF)
set(ADRIENNE_SDK_IS_WINDOWS_ONLY NOTFOUND)
find_package_handle_standard_args(Adrienne
DEFAULT_MSG
ADRIENNE_SDK_IS_WINDOWS_ONLY)
endif()

View File

@ -0,0 +1,77 @@
# - try to find Bluez
#
# Cache Variables: (probably not for direct use in your scripts)
# BLUEZ_INCLUDE_DIR
# BLUEZ_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# BLUEZ_FOUND
# BLUEZ_INCLUDE_DIRS
# BLUEZ_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(WIN32 OR APPLE OR NOT UNIX)
if(NOT Bluez_FIND_QUIETLY)
message(STATUS "Platform not supported by Bluez - skipping search")
endif()
else()
set(BLUEZ_ROOT_DIR
"${BLUEZ_ROOT_DIR}"
CACHE
PATH
"Directory to search")
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(_LIBSUFFIXES lib64 lib)
else()
set(_LIBSUFFIXES lib)
endif()
find_library(BLUEZ_LIBRARY
NAMES
bluetooth
HINTS
"${BLUEZ_ROOT_DIR}"
PATH_SUFFIXES
"${_LIBSUFFIXES}")
# Might want to look close to the library first for the includes.
get_filename_component(_libdir "${BLUEZ_LIBRARY}" PATH)
find_path(BLUEZ_INCLUDE_DIR
NAMES
bluetooth/bluetooth.h
HINTS
"${_libdir}/.."
PATHS
"${BLUEZ_ROOT_DIR}"
PATH_SUFFIXES
include/)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Bluez
DEFAULT_MSG
BLUEZ_LIBRARY
BLUEZ_INCLUDE_DIR)
if(BLUEZ_FOUND)
set(BLUEZ_LIBRARIES "${BLUEZ_LIBRARY}")
set(BLUEZ_INCLUDE_DIRS "${BLUEZ_INCLUDE_DIR}")
mark_as_advanced(BLUEZ_ROOT_DIR)
endif()
mark_as_advanced(BLUEZ_INCLUDE_DIR
BLUEZ_LIBRARY)

View File

@ -0,0 +1,216 @@
# - try to find CPPDOM library
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# CPPDOM_LIBRARY_DIR, library search path
# CPPDOM_INCLUDE_DIR, include search path
# CPPDOM_LIBRARY, the library to link against
# CPPDOM_CXX_FLAGS
# CPPDOM_FOUND, If false, do not try to use this library.
#
# Useful configuration variables you might want to add to your cache:
# CPPDOM_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
# CPPDOM_ADDITIONAL_VERSIONS - Additional versions (outside of 0.7.8 to 1.2.0)
# to use when constructing search names and paths
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# VR Juggler requires this package, so this Find script takes that into
# account when determining where to search for the desired files.
# The VJ_BASE_DIR environment variable is searched (preferentially)
# when searching for this package, so most sane VR Juggler build environments
# should "just work." Note that you need to manually re-run CMake if you
# change this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_HUMAN "cppdom")
set(_HEADER cppdom/cppdom.h)
set(_FP_PKG_NAME cppdom)
set(CPPDOM_VERSIONS
${CPPDOM_ADDITIONAL_VERSIONS}
1.3.0
1.2.0
1.1.2
1.1.1
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0
0.7.10
0.7.9
0.7.8)
set(CPPDOM_DIRS)
set(CPPDOM_RELEASE_LIB_NAMES)
set(CPPDOM_DEBUG_LIB_NAMES)
foreach(_version ${CPPDOM_VERSIONS})
string(REGEX REPLACE "[-\\.]" "_" _versionclean ${_version})
list(APPEND CPPDOM_DIRS cppdom-${_version})
list(APPEND CPPDOM_HEADER_DIRS include/cppdom-${_version})
list(APPEND CPPDOM_RELEASE_LIB_NAMES cppdom-${_versionclean})
list(APPEND CPPDOM_DEBUG_LIB_NAMES cppdom_d-${_versionclean})
endforeach()
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
include(FindPackageHandleStandardArgs)
# Handle the case where a recent cppdom is supplying its own cmake config file.
option(CPPDOM_ATTEMPT_CMAKE_MODULE "Should we attempt to use CPPDOM's own CMake module for configuration?" ON)
mark_as_advanced(CPPDOM_ATTEMPT_CMAKE_MODULE)
if(NOT cppdom_FOUND)
find_package(cppdom QUIET NO_MODULE)
if(cppdom_FOUND)
set(CPPDOM_LIBRARIES ${cppdom_LIBRARIES})
set(CPPDOM_INCLUDE_DIRS ${cppdom_INCLUDE_DIRS})
find_package_handle_standard_args(CPPDOM
DEFAULT_MSG
CPPDOM_LIBRARIES
CPPDOM_INCLUDE_DIRS)
return()
endif()
endif()
if(CPPDOM_INCLUDE_DIRS AND CPPDOM_LIBRARIES)
# in cache already
set(CPPDOM_FIND_QUIETLY TRUE)
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_names(${_FP_PKG_NAME} NO_DEPS)
endif()
set(CPPDOM_ROOT_DIR
"${CPPDOM_ROOT_DIR}"
CACHE
PATH
"Root directory to search for CPPDOM")
if(DEFINED VRJUGGLER22_ROOT_DIR)
mark_as_advanced(CPPDOM_ROOT_DIR)
endif()
if(NOT CPPDOM_ROOT_DIR)
if(VRJUGGLER22_ROOT_DIR)
set(CPPDOM_ROOT_DIR "${VRJUGGLER22_ROOT_DIR}")
elseif(VRJUGGLER30_ROOT_DIR)
set(CPPDOM_ROOT_DIR "${VRJUGGLER30_ROOT_DIR}")
endif()
endif()
set(_ROOT_DIR "${CPPDOM_ROOT_DIR}")
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(_VRJ_LIBSUFFIXES lib64 lib)
set(_VRJ_LIBDSUFFIXES
debug
lib64/x86_64/debug
lib64/debug
lib64
lib/x86_64/debug
lib/debug
lib)
set(_VRJ_LIBDSUFFIXES_ONLY
debug
lib64/x86_64/debug
lib64/debug
lib/x86_64/debug
lib/debug)
else()
set(_VRJ_LIBSUFFIXES lib)
set(_VRJ_LIBDSUFFIXES debug lib/i686/debug lib/debug lib)
set(_VRJ_LIBDSUFFIXES_ONLY debug lib/i686/debug lib/debug)
endif()
find_path(CPPDOM_INCLUDE_DIR
${_HEADER}
HINTS
${_ROOT_DIR}
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATHS
PATH_SUFFIXES
${CPPDOM_DIRS}
${CPPDOM_HEADER_DIRS}
include
DOC
"Path to ${_HUMAN} includes root")
find_library(CPPDOM_LIBRARY_RELEASE
NAMES
${CPPDOM_RELEASE_LIB_NAMES}
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_NAMES}
HINTS
${_ROOT_DIR}
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} library full path")
find_library(CPPDOM_LIBRARY_DEBUG
NAMES
${CPPDOM_DEBUG_LIB_NAMES}
HINTS
${_ROOT_DIR}
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
# Fallback to same library name but in the debug folder
if(NOT CPPDOM_LIBRARY_DEBUG)
find_library(CPPDOM_LIBRARY_DEBUG
NAMES
${CPPDOM_LIB_NAMES}
HINTS
${CPPDOM_INCLUDE_DIR}/../
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES_ONLY}
NO_DEFAULT_PATH
DOC
"${_HUMAN} debug library full path")
endif()
if(CPPDOM_LIBRARY_RELEASE OR CPPDOM_LIBRARY_DEBUG)
select_library_configurations(CPPDOM)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
find_package_handle_standard_args(CPPDOM
DEFAULT_MSG
CPPDOM_LIBRARY
CPPDOM_INCLUDE_DIR)
if(CPPDOM_FOUND)
set(CPPDOM_INCLUDE_DIRS ${CPPDOM_INCLUDE_DIR})
if(MSVC)
set(CPPDOM_CXX_FLAGS "/wd4290")
endif()
mark_as_advanced(CPPDOM_ROOT_DIR)
endif()
mark_as_advanced(CPPDOM_LIBRARY_RELEASE
CPPDOM_LIBRARY_DEBUG
CPPDOM_INCLUDE_DIR)

View File

@ -0,0 +1,120 @@
# - try to find Trivisio Colibri API library
#
# Cache Variables:
# COLIBRIAPI_LIBRARY
# COLIBRIAPI_INCLUDE_DIR
#
# Non-cache variables you might use in your CMakeLists.txt:
# COLIBRIAPI_FOUND
# COLIBRIAPI_SERVER_LIBRARIES - server libraries
# COLIBRIAPI_LIBRARIES - client libraries
# COLIBRIAPI_CLIENT_DEFINITIONS - definitions if you only use the client library
# COLIBRIAPI_DEFINITIONS - Client-only definition if all we found was the client library.
# COLIBRIAPI_INCLUDE_DIRS
#
# COLIBRIAPI_ROOT_DIR is searched preferentially for these files
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(COLIBRIAPI_ROOT_DIR
"${COLIBRIAPI_ROOT_DIR}"
CACHE
PATH
"Root directory to search for Colibri API")
if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8")
set(_libsuffixes lib64 lib)
# 64-bit dir: only set on win64
file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _progfiles)
else()
set(_libsuffixes lib)
set(_PF86 "ProgramFiles(x86)")
if(NOT "$ENV{${_PF86}}" STREQUAL "")
# 32-bit dir: only set on win64
file(TO_CMAKE_PATH "$ENV{${_PF86}}" _progfiles)
else()
# 32-bit dir on win32, useless to us on win64
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles)
endif()
endif()
###
# Configure COLIBRIAPI
###
find_path(COLIBRIAPI_INCLUDE_DIR
NAMES
colibri_api.h
PATH_SUFFIXES
include
HINTS
"${COLIBRIAPI_ROOT_DIR}"
PATHS
"${_progfiles}/ColibriAPI 1.1.20140925 (64-bit)"
"$ENV{HOME}"
"$ENV{HOME}/ColibriAPI-1.1.20140710-Linux-amd64"
C:/usr/local
/usr/local)
find_library(COLIBRIAPI_LIBRARY
NAMES
colibri-api
PATH_SUFFIXES
${_libsuffixes}
HINTS
"${COLIBRIAPI_ROOT_DIR}"
PATHS
"${_progfiles}/ColibriAPI 1.1.20140925 (64-bit)"
"$ENV{HOME}"
"$ENV{HOME}/ColibriAPI-1.1.20140710-Linux-amd64"
C:/usr/local
/usr/local)
###
# Dependencies
###
set(_deps_libs)
set(_deps_includes)
set(_deps_check)
find_package(quatlib)
list(APPEND _deps_libs ${QUATLIB_LIBRARIES})
list(APPEND _deps_includes ${QUATLIB_INCLUDE_DIRS})
list(APPEND _deps_check QUATLIB_FOUND)
if(NOT WIN32)
find_package(Threads)
list(APPEND _deps_libs ${CMAKE_THREAD_LIBS_INIT})
list(APPEND _deps_check CMAKE_HAVE_THREADS_LIBRARY)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ColibriApi
DEFAULT_MSG
COLIBRIAPI_LIBRARY
COLIBRIAPI_INCLUDE_DIR
${_deps_check})
if(COLIBRIAPI_FOUND)
set(COLIBRIAPI_INCLUDE_DIRS "${COLIBRIAPI_INCLUDE_DIR}" ${_deps_includes})
set(COLIBRIAPI_LIBRARIES "${COLIBRIAPI_LIBRARY}" ${_deps_libs})
mark_as_advanced(COLIBRIAPI_ROOT_DIR)
endif()
mark_as_advanced(COLIBRIAPI_LIBRARY COLIBRIAPI_INCLUDE_DIR)

View File

@ -0,0 +1,192 @@
# - try to find DCUBED library
#
# DCUBED_LIBRARY_DIR, library search path
# DCUBED_INCLUDE_DIR, include search path
# DCUBED_{component}_LIBRARY, the library to link against
# DCUBED_ENVIRONMENT
# DCUBED_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# DCUBED_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(NOT BITS)
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(BITS 64)
else()
set(BITS 32)
endif()
endif()
if(WIN32 AND MSVC)
include(CMakeDetermineVSServicePack)
determinevsservicepack(_sp)
if(MSVC71)
set(VC_VER vc71)
set(VC_VER_LONG vc71)
elseif(MSVC80)
set(VC_VER vc8)
set(VC_VER_LONG vc80)
# FIXME TODO provide more options here
set(D3BUILD nt8)
if("${_sp}" STREQUAL "vc80sp1")
set(_verstring nt8s1)
else()
set(_verstring nt8)
endif()
elseif(MSVC90)
set(VC_VER vc9)
set(VC_VER_LONG vc90)
set(_verstring nt9)
endif()
if(BITS EQUAL 32)
set(PLATFORM win32)
else()
set(PLATFORM win64)
endif()
endif()
if(NOT DCUBED_ROOT_DIR)
if(EXISTS "$ENV{DCUBED}" AND IS_DIRECTORY "$ENV{DCUBED}")
set(DCUBED_ROOT_DIR "$ENV{DCUBED}")
endif()
endif()
file(TO_CMAKE_PATH "${DCUBED_ROOT_DIR}" DCUBED_ROOT_DIR)
set(DCUBED_ROOT_DIR
"${DCUBED_ROOT_DIR}"
CACHE
PATH
"Root directory to search for DCubed")
# Do this by default
if(NOT DEFINED DCUBED_NESTED_TARGETS)
set(DCUBED_NESTED_TARGETS TRUE)
endif()
set(DCUBED_NESTED_TARGETS
"${DCUBED_NESTED_TARGETS}"
CACHE
BOOL
"Whether we should compile the wrappers as a part of the solution")
mark_as_advanced(DCUBED_NESTED_TARGETS)
###
# Configure DCubed
###
find_path(DCUBED_CORE_INCLUDE_DIR
d3ew_inc/modelgate.hxx
PATHS
"${DCUBED_ROOT_DIR}/inc")
foreach(lib aem cdmwp d3e_base d3e_cd dcm dcm3 g3)
find_library(DCUBED_${lib}_LIBRARY
${lib}
PATHS
"${DCUBED_ROOT_DIR}/lib/${_verstring}")
if(DCUBED_${lib}_LIBRARY)
list(APPEND DCUBED_LIBRARIES ${DCUBED_${lib}_LIBRARY})
list(APPEND DCUBED_CORE_LIBRARIES ${DCUBED_${lib}_LIBRARY})
endif()
mark_as_advanced(DCUBED_${lib}_LIBRARY)
endforeach()
find_path(DCUBED_WRAPPER_INCLUDE_DIR
d3ew_p/p_utils.hxx
PATHS
"${DCUBED_ROOT_DIR}/source/wrapper_source/")
foreach(lib d3ew_p d3ew_scene)
find_library(DCUBED_WRAPPER_${lib}_LIBRARY
${lib}_${D3BUILD}
PATHS
"${DCUBED_ROOT_DIR}/wrappers/cdmwp/${lib}")
mark_as_advanced(DCUBED_WRAPPER_${lib}_LIBRARY)
endforeach()
set(_nest_targets)
if(DCUBED_WRAPPER_INCLUDE_DIR)
foreach(lib d3ew_p d3ew_scene)
if(DCUBED_NESTED_TARGETS OR NOT DCUBED_WRAPPER_${lib}_LIBRARY)
if(PARASOLID_FOUND)
set(_nest_targets YES)
set(DCUBED_WRAPPER_${lib}_LIBRARY
"dcubed_wrapper_${lib}_nested_target"
CACHE
STRING
"We will build the DCubed wrapper ${lib} lib."
FORCE)
else()
set(DCUBED_WRAPPER_${lib}_LIBRARY
"NESTED_TARGET_REQUIRES_PARASOLID-NOTFOUND"
CACHE
STRING
"Can't build the DCubed wrapper ${lib} without first finding Parasolid."
FORCE)
endif()
endif()
endforeach()
endif()
foreach(lib d3ew_p d3ew_scene)
if(DCUBED_WRAPPER_${lib}_LIBRARY)
list(APPEND DCUBED_WRAPPER_LIBRARIES ${DCUBED_WRAPPER_${lib}_LIBRARY})
endif()
endforeach()
if(NOT DCUBED_ROOT_DIR)
get_filename_component(_path "${DCUBED_dcm_LIBRARY}" PATH)
get_filename_component(_path "${_path}/../.." ABSOLUTE)
set(DCUBED_ROOT_DIR
"${_path}"
CACHE
PATH
"Root directory to search for DCubed"
FORCE)
endif()
#file(TO_NATIVE_PATH "${DCUBED_ROOT_DIR}" _d3envdir)
set(DCUBED_ENVIRONMENT "DCUBED=${DCUBED_ROOT_DIR}")
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DCubed
DEFAULT_MSG
DCUBED_ROOT_DIR
DCUBED_LIBRARIES
DCUBED_CORE_LIBRARIES
DCUBED_CORE_INCLUDE_DIR
DCUBED_WRAPPER_INCLUDE_DIR
DCUBED_WRAPPER_LIBRARIES)
if(DCUBED_FOUND)
if(_nest_targets)
get_filename_component(_moddir "${CMAKE_CURRENT_LIST_FILE}" PATH)
add_subdirectory("${_moddir}/nested_targets/DCubed")
endif()
set(DCUBED_INCLUDE_DIRS
"${DCUBED_CORE_INCLUDE_DIR}"
"${DCUBED_CORE_INCLUDE_DIR}/if3"
"${DCUBED_CORE_INCLUDE_DIR}/.."
"${DCUBED_WRAPPER_INCLUDE_DIR}")
mark_as_advanced(DCUBED_ROOT_DIR)
endif()
mark_as_advanced(DCUBED_CORE_INCLUDE_DIR DCUBED_WRAPPER_INCLUDE_DIR)

View File

@ -0,0 +1,204 @@
# - Find Microsoft DirectShow sample files, library, and headers.
#
# DIRECTSHOW_INCLUDE_DIRS - where to find needed include file
# DIRECTSHOW_BASECLASS_DIR- Directory containing the DirectShow baseclass sample code.
# DIRECTSHOW_FOUND - True if DirectShow found.
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Initially in VRPN - Distributed under the Boost Software License, Version 1.0.
#
# Almost entirely re-written by:
# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Look for one of the sample files.
set(_ds_quiet)
if(DirectShow_FIND_QUIETLY)
set(_ds_quiet QUIET)
endif()
find_package(WindowsSDK ${_ds_quiet})
find_package(DirectX ${_ds_quiet})
set(DIRECTSHOW_WINDOWSSDK_ROOT
"${DIRECTSHOW_WINDOWSSDK_ROOT}"
CACHE
PATH
"A specific Windows SDK to use for DirectShow.")
if(MSVC AND CMAKE_CL_64)
set(DIRECTSHOW_LIB_SUBDIR /x64)
else()
set(DIRECTSHOW_LIB_SUBDIR)
endif()
set(_acceptable_winsdk)
if(WINDOWSSDK_FOUND)
foreach(_sdkdir ${WINDOWSSDK_DIRS})
if(EXISTS "${_sdkdir}/Samples/Multimedia/DirectShow/BaseClasses/streams.h"
AND EXISTS "${_sdkdir}/Lib${DIRECTSHOW_LIB_SUBDIR}/strmiids.lib"
AND EXISTS "${_sdkdir}/Include/DShow.h")
list(APPEND _acceptable_winsdk "${_sdkdir}")
endif()
endforeach()
endif()
find_path(DIRECTSHOW_BASECLASS_DIR
NAMES
streams.h
HINTS
"${DIRECTSHOW_WINDOWSSDK_ROOT}"
PATHS
${_acceptable_winsdk}
PATH_SUFFIXES
"Samples/Multimedia/DirectShow/BaseClasses")
find_path(DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR
NAMES
DShow.h
HINTS
"${DIRECTSHOW_WINDOWSSDK_ROOT}"
PATHS
${_acceptable_winsdk}
PATH_SUFFIXES
"Include")
###
# Begin code dedicated to finding a proper qedit.h file...
###
# Checks to see if a directory has qedit.h and if that file contains ISampleGrabber.
function(_directshow_check_qedit _dir _var)
set(fn "${_dir}/qedit.h")
if(NOT EXISTS "${fn}")
set(${_var} FALSE PARENT_SCOPE)
return()
endif()
file(STRINGS "${fn}" samplegrabber REGEX ISampleGrabber)
if(NOT samplegrabber)
set(${_var} FALSE PARENT_SCOPE)
return()
endif()
set(${_var} TRUE PARENT_SCOPE)
endfunction()
function(_directshow_check_current_qedit)
if(DIRECTSHOW_QEDIT_INCLUDE_DIR)
_directshow_check_qedit("${DIRECTSHOW_QEDIT_INCLUDE_DIR}" _ds_ok)
if(NOT _ds_ok)
message(STATUS "FindDirectShow: qedit.h in ${DIRECTSHOW_QEDIT_INCLUDE_DIR} lacks ISampleGrabber, unsetting DIRECTSHOW_QEDIT_INCLUDE_DIR")
set(DIRECTSHOW_QEDIT_INCLUDE_DIR "" CACHE PATH "" FORCE)
endif()
endif()
endfunction()
# Check before deciding if we should make our list of possible locations.
_directshow_check_current_qedit()
# Compose a list of possible directories that might hold a qedit.h file.
set(DIRECTSHOW_QEDIT_SEARCH)
if(WINDOWSSDK_FOUND AND NOT DIRECTSHOW_QEDIT_INCLUDE_DIR)
foreach(_sdk ${WINDOWSSDK_DIRS})
windowssdk_build_lookup("${_sdk}" _build)
if(_build AND ("${_build}" VERSION_LESS 6.2))
get_windowssdk_include_dirs("${_sdk}" _dirs)
if(_dirs)
list(APPEND DIRECTSHOW_QEDIT_SEARCH ${_dirs})
endif()
endif()
endforeach()
endif()
# This one we can grab from another SDK version.
find_path(DIRECTSHOW_QEDIT_INCLUDE_DIR
NAMES
qedit.h
HINTS
"${DIRECTSHOW_WINDOWSSDK_ROOT}"
PATHS
${DIRECTSHOW_QEDIT_SEARCH}
PATH_SUFFIXES
"Include")
# Check if the directory is OK after the search.
_directshow_check_current_qedit()
# If we didn't find a proper qedit, manually look through the possibilities.
if(NOT DIRECTSHOW_QEDIT_INCLUDE_DIR)
foreach(_dir "${DIRECTSHOW_WINDOWSSDK_ROOT}/Include" ${DIRECTSHOW_QEDIT_SEARCH})
if(NOT DIRECTSHOW_QEDIT_INCLUDE_DIR)
_directshow_check_qedit("${_dir}" _ds_ok)
if(_ds_ok)
set(DIRECTSHOW_QEDIT_INCLUDE_DIR "${_dir}" CACHE PATH "" FORCE)
endif()
endif()
endforeach()
endif()
###
# End qedit.h section.
###
set(DIRECTSHOW_STRMIIDS_SEARCH)
if(WINDOWSSDK_FOUND AND NOT DIRECTSHOW_STRMIIDS_LIBRARY)
foreach(_sdk ${WINDOWSSDK_DIRS})
get_windowssdk_library_dirs("${_sdk}" _dirs)
if(_dirs)
list(APPEND DIRECTSHOW_STRMIIDS_SEARCH ${_dirs})
endif()
endforeach()
endif()
find_library(DIRECTSHOW_STRMIIDS_LIBRARY
NAMES
strmiids
HINTS
"${DIRECTSHOW_WINDOWSSDK_ROOT}"
PATHS
${DIRECTSHOW_STRMIIDS_SEARCH}
PATH_SUFFIXES
"Lib${DIRECTSHOW_LIB_SUBDIR}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DirectShow
DEFAULT_MSG
DIRECTSHOW_BASECLASS_DIR
DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR
DIRECTSHOW_QEDIT_INCLUDE_DIR
DIRECTX_INCLUDE_DIR
DIRECTSHOW_STRMIIDS_LIBRARY)
if(DIRECTSHOW_FOUND)
set(DIRECTSHOW_INCLUDE_DIRS
# Baseclass must be before SDK so it gets the correct refclock.h
"${DIRECTSHOW_BASECLASS_DIR}"
"${DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR}"
"${DIRECTX_INCLUDE_DIR}"
)
if(EXISTS "${DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR}/atl/atlbase.h")
list(APPEND
DIRECTSHOW_INCLUDE_DIRS
"${DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR}/atl")
endif()
if(NOT "${DIRECTSHOW_QEDIT_INCLUDE_DIR}" STREQUAL "${DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR}")
# QEdit include dir might be an older SDK, so put it last.
list(APPEND DIRECTSHOW_INCLUDE_DIRS "${DIRECTSHOW_QEDIT_INCLUDE_DIR}")
endif()
set(DIRECTSHOW_LIBRARIES "${DIRECTSHOW_STRMIIDS_LIBRARY}")
mark_as_advanced(DIRECTSHOW_WINDOWSSDK_ROOT)
endif()
mark_as_advanced(DIRECTSHOW_BASECLASS_DIR
DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR
DIRECTSHOW_QEDIT_INCLUDE_DIR
DIRECTSHOW_STRMIIDS_LIBRARY)

View File

@ -0,0 +1,322 @@
# - try to find part of DirectX SDK
#
# Cache Variables: (probably not for direct use in your scripts)
# DIRECTX_INCLUDE_DIR
#
# Variables you should use in your CMakeLists.txt:
# DIRECTX_DXGUID_LIBRARY - deprecated, see below
# DIRECTX_DXERR_LIBRARY - deprecated, see http://blogs.msdn.com/b/chuckw/archive/2012/04/24/where-s-dxerr-lib.aspx
# DIRECTX_DINPUT_LIBRARY
# DIRECTX_DINPUT_INCLUDE_DIR
# DIRECTX_D3D9_LIBRARY
# DIRECTX_D3DXOF_LIBRARY
# DIRECTX_D3DX9_LIBRARIES
# DIRECTX_INCLUDE_DIRS
# DIRECTX_FOUND - if this is not true, do not attempt to use this library
#
# Defines these macros:
# find_directx_include - wrapper for find_path that provides PATHS, HINTS, and PATH_SUFFIXES.
# find_directx_library - wrapper for find_library that provides PATHS, HINTS, and PATH_SUFFIXES.
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
# SelectLibraryConfigurations
#
# Original Author:
# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(DIRECTX_ROOT_DIR
"${DIRECTX_ROOT_DIR}"
CACHE
PATH
"Root directory to search for DirectX")
if(MSVC)
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _PROG_FILES)
set(_PF86 "ProgramFiles(x86)")
file(TO_CMAKE_PATH "$ENV{${_PF86}}" _PROG_FILES_X86)
if(_PROG_FILES_X86)
set(_PROG_FILES "${_PROG_FILES_X86}")
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_dx_lib_suffixes lib/x64 lib)
else()
set(_dx_lib_suffixes lib/x86 lib)
endif()
set(DXSDK_DIRS)
set(_dx_quiet)
if(DirectX_FIND_QUIETLY)
set(_dx_quiet QUIET)
endif()
find_package(WindowsSDK ${_dx_quiet})
if(WINDOWSSDK_FOUND)
foreach(_dir ${WINDOWSSDK_DIRS})
get_windowssdk_include_dirs(${_dir} _include_dirs)
if(_include_dirs)
list(APPEND DXSDK_DIRS ${_include_dirs})
endif()
endforeach()
endif()
macro(_append_dxsdk_in_inclusive_range _low _high)
if((NOT MSVC_VERSION LESS ${_low}) AND (NOT MSVC_VERSION GREATER ${_high}))
list(APPEND DXSDK_DIRS ${ARGN})
endif()
endmacro()
_append_dxsdk_in_inclusive_range(1500 1600 "${_PROG_FILES}/Microsoft DirectX SDK (June 2010)")
_append_dxsdk_in_inclusive_range(1400 1600
"${_PROG_FILES}/Microsoft DirectX SDK (February 2010)"
"${_PROG_FILES}/Microsoft DirectX SDK (August 2009)"
"${_PROG_FILES}/Microsoft DirectX SDK (March 2009)"
"${_PROG_FILES}/Microsoft DirectX SDK (November 2008)"
"${_PROG_FILES}/Microsoft DirectX SDK (August 2008)"
"${_PROG_FILES}/Microsoft DirectX SDK (June 2008)"
"${_PROG_FILES}/Microsoft DirectX SDK (March 2008)")
_append_dxsdk_in_inclusive_range(1310 1500
"${_PROG_FILES}/Microsoft DirectX SDK (November 2007)"
"${_PROG_FILES}/Microsoft DirectX SDK (August 2007)"
"${_PROG_FILES}/Microsoft DirectX SDK (June 2007)"
"${_PROG_FILES}/Microsoft DirectX SDK (April 2007)"
"${_PROG_FILES}/Microsoft DirectX SDK (February 2007)"
"${_PROG_FILES}/Microsoft DirectX SDK (December 2006)"
"${_PROG_FILES}/Microsoft DirectX SDK (October 2006)"
"${_PROG_FILES}/Microsoft DirectX SDK (August 2006)"
"${_PROG_FILES}/Microsoft DirectX SDK (June 2006)"
"${_PROG_FILES}/Microsoft DirectX SDK (April 2006)"
"${_PROG_FILES}/Microsoft DirectX SDK (February 2006)")
file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}" ENV_DXSDK_DIR)
if(ENV_DXSDK_DIR)
list(APPEND DXSDK_DIRS ${ENV_DXSDK_DIR})
endif()
else()
set(_dx_lib_suffixes lib)
set(DXSDK_DIRS /mingw)
endif()
find_path(DIRECTX_INCLUDE_DIR
NAMES
dxdiag.h
dinput.h
dxerr8.h
PATHS
${DXSDK_DIRS}
HINTS
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
include)
find_path(DIRECTX_DINPUT_INCLUDE_DIR
NAMES
dinput.h
PATHS
${DXSDK_DIRS}
HINTS
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
include)
set(DXLIB_HINTS)
if(WINDOWSSDK_FOUND AND DIRECTX_INCLUDE_DIR)
get_windowssdk_from_component("${DIRECTX_INCLUDE_DIR}" _winsdk)
if(_winsdk)
get_windowssdk_library_dirs("${_winsdk}" _libdirs)
if(_libdirs)
list(APPEND DXLIB_HINTS ${_libdirs})
endif()
endif()
endif()
if(WINDOWSSDK_FOUND AND DIRECTX_DINPUT_INCLUDE_DIR)
get_windowssdk_from_component("${DIRECTX_DINPUT_INCLUDE_DIR}" _winsdk)
if(_winsdk)
get_windowssdk_library_dirs("${_winsdk}" _includes)
if(_includes)
list(APPEND DXLIB_HINTS ${_includes})
endif()
endif()
endif()
find_library(DIRECTX_DXGUID_LIBRARY
NAMES
dxguid
PATHS
${DXLIB_HINTS}
${DXSDK_DIRS}
HINTS
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
${_dx_lib_suffixes})
if(DIRECTX_DXGUID_LIBRARY)
get_filename_component(_dxsdk_lib_dir ${DIRECTX_DXGUID_LIBRARY} PATH)
list(APPEND DXLIB_HINTS "${_dxsdk_lib_dir}")
endif()
find_library(DIRECTX_DINPUT_LIBRARY
NAMES
dinput8
dinput
PATHS
${DXSDK_DIRS}
HINTS
${DXLIB_HINTS}
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
${_dx_lib_suffixes})
find_library(DIRECTX_DXERR_LIBRARY
NAMES
dxerr
dxerr9
dxerr8
PATHS
${DXSDK_DIRS}
HINTS
${DXLIB_HINTS}
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
${_dx_lib_suffixes})
find_library(DIRECTX_D3D9_LIBRARY
NAMES
d3d9
PATHS
${DXSDK_DIRS}
HINTS
${DXLIB_HINTS}
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
${_dx_lib_suffixes})
find_library(DIRECTX_D3DXOF_LIBRARY
NAMES
d3dxof
PATHS
${DXSDK_DIRS}
HINTS
${DXLIB_HINTS}
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
${_dx_lib_suffixes})
find_library(DIRECTX_D3DX9_LIBRARY_RELEASE
NAMES
d3dx9
PATHS
${DXSDK_DIRS}
HINTS
${DXLIB_HINTS}
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
${_dx_lib_suffixes})
find_library(DIRECTX_D3DX9_LIBRARY_DEBUG
NAMES
d3dx9d
PATHS
${DXSDK_DIRS}
HINTS
${DXLIB_HINTS}
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
${_dx_lib_suffixes})
find_library(DIRECTX_XINPUT_LIBRARY
NAMES
Xinput9_1_0
Xinput
PATHS
${DXSDK_DIRS}
HINTS
${DXLIB_HINTS}
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
${_dx_lib_suffixes})
include(SelectLibraryConfigurations)
select_library_configurations(DIRECTX_D3DX9)
set(DIRECTX_EXTRA_CHECK)
if(DIRECTX_INCLUDE_DIR)
if(MSVC80)
set(DXSDK_DEPRECATION_BUILD 1962)
endif()
if(DXSDK_DEPRECATION_BUILD)
include(CheckCSourceCompiles)
set(_dinput_old_includes ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_INCLUDES "${DIRECTX_INCLUDE_DIR}")
check_c_source_compiles("
#include <dxsdkver.h>
#if _DXSDK_BUILD_MAJOR >= ${DXSDK_DEPRECATION_BUILD}
#error
#else
int main(int argc, char * argv[]) {
return 0;
}
#endif
"
DIRECTX_SDK_SUPPORTS_COMPILER)
set(DIRECTX_EXTRA_CHECK DIRECTX_SDK_SUPPORTS_COMPILER)
set(CMAKE_REQUIRED_INCLUDES "${_dinput_old_includes}")
else()
# Until proven otherwise.
set(DIRECTX_SDK_SUPPORTS_COMPILER TRUE)
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DirectX
DEFAULT_MSG
DIRECTX_DXGUID_LIBRARY
DIRECTX_DINPUT_LIBRARY
DIRECTX_INCLUDE_DIR
${DIRECTX_EXTRA_CHECK})
if(DIRECTX_FOUND)
set(DIRECTX_LIBRARIES
"${DIRECTX_DXGUID_LIBRARY}"
"${DIRECTX_DINPUT_LIBRARY}")
set(DIRECTX_INCLUDE_DIRS "${DIRECTX_INCLUDE_DIR}")
mark_as_advanced(DIRECTX_ROOT_DIR)
endif()
macro(find_directx_library)
find_library(${ARGN}
PATHS
${DXSDK_DIRS}
HINTS
${DXLIB_HINTS}
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
${_dx_lib_suffixes})
endmacro()
macro(find_directx_include)
find_path(${ARGN}
PATHS
${DXSDK_DIRS}
HINTS
${DIRECTX_INCLUDE_DIR}
"${DIRECTX_ROOT_DIR}"
PATH_SUFFIXES
include)
endmacro()
mark_as_advanced(DIRECTX_DINPUT_LIBRARY
DIRECTX_DXGUID_LIBRARY
DIRECTX_DXERR_LIBRARY
DIRECTX_D3D9_LIBRARY
DIRECTX_D3DXOF_LIBRARY
DIRECTX_D3DX9_LIBRARY_RELEASE
DIRECTX_D3DX9_LIBRARY_DEBUG
DIRECTX_INCLUDE_DIR)

View File

@ -0,0 +1,151 @@
# - try to find Flagpoll application, and offer package-finding services
# FLAGPOLL, the executable: if not defined, do not try to use Flagpoll.
#
# Useful configuration variables you might want to add to your cache:
# FLAGPOLL_ROOT_DIR - A directory prefix to search for the app
# (a path that contains bin/ as a subdirectory)
#
# VR Juggler requires this package, so this Find script takes that into
# account when determining where to search for the desired files.
# The VJ_BASE_DIR environment variable is searched (preferentially)
# when searching for this package, so most sane VR Juggler build environments
# should "just work." Note that you need to manually re-run CMake if you
# change this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# You can use Flagpoll to provide directories to use as HINTS for find_*
# These are the provided macros:
# flagpoll_get_include_dirs
# flagpoll_get_library_dirs
# flagpoll_get_library_names
# flagpoll_get_extra_libs
# All take the name of the desired package, optionally NO_DEPS to pass --no-deps
# to Flagpoll, and return yourpkgname_FLAGPOLL_INCLUDE_DIRS(etc. for the other
# macros).
#
# Example usage:
# flagpoll_get_include_dirs(vpr NO_DEPS)
# find_path(VPR20_INCLUDE_DIRS vpr/vpr.h
# HINTS ${vpr_FLAGPOLL_INCLUDE_DIRS})
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
###
# Flagpoll detection
###
set(Flagpoll_FIND_QUIETLY true)
find_program(FLAGPOLL
NAMES
flagpoll
flagpoll.exe
PATHS
"${FLAGPOLL_ROOT_DIR}"
"${VRJUGGLER22_ROOT_DIR}"
PATH_SUFFIXES
bin)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Flagpoll DEFAULT_MSG FLAGPOLL)
mark_as_advanced(FLAGPOLL)
###
# Macro for internal use - shared workings between all the public macros below.
###
macro(_flagpoll_get_results _package _arg _flag _output)
if(FLAGPOLL)
# If the CMakeLists that called the flagpoll macro passed NO_DEPS,
# we won't return the results for dependencies
if("${ARGN}" MATCHES "NO_DEPS")
set(_FLAGPOLL_NODEP "--no-deps")
else()
set(_FLAGPOLL_NODEP "")
endif()
# Run flagpoll
execute_process(COMMAND
${FLAGPOLL}
${_package}
${_arg}
${_FLAGPOLL_NODEP}
OUTPUT_VARIABLE
_FLAGPOLL_OUTPUT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(_FLAGPOLL_OUTPUT)
# Remove -I and /I(or equivalent for other flags
string(REGEX
REPLACE
"[-/]${_flag}"
""
_FLAGPOLL_OUTPUT
${_FLAGPOLL_OUTPUT})
# Remove extra spaces
string(REGEX REPLACE " +" " " _FLAGPOLL_OUTPUT ${_FLAGPOLL_OUTPUT})
# Make a CMake list, standardize paths, and append only what we want to our final list
separate_arguments(_FLAGPOLL_OUTPUT)
foreach(_RESULT ${_FLAGPOLL_OUTPUT})
string(REGEX MATCH "^-" _BAD ${_RESULT})
if(_RESULT AND NOT _BAD)
file(TO_CMAKE_PATH "${_RESULT}" _RESULT_CLEAN)
list(APPEND ${_output} ${_RESULT_CLEAN})
endif()
endforeach()
endif()
endif()
endmacro()
###
# "Public" macros - to use flagpoll to give you HINTS directories when finding things
###
macro(flagpoll_get_include_dirs _package)
# Passing ARGN along so if they specified NO_DEPS we actually do it.
_flagpoll_get_results(${_package}
"--cflags-only-I"
I
${_package}_FLAGPOLL_INCLUDE_DIRS
${ARGN})
endmacro()
macro(flagpoll_get_library_dirs _package)
# Passing ARGN along so if they specified NO_DEPS we actually do it.
_flagpoll_get_results(${_package}
"--libs-only-L"
L
${_package}_FLAGPOLL_LIBRARY_DIRS
${ARGN})
endmacro()
macro(flagpoll_get_library_names _package)
# Passing ARGN along so if they specified NO_DEPS we actually do it.
_flagpoll_get_results(${_package}
"--libs-only-l"
l
${_package}_FLAGPOLL_LIBRARY_NAMES
${ARGN})
endmacro()
macro(flagpoll_get_extra_libs _package)
# Passing ARGN along so if they specified NO_DEPS we actually do it.
_flagpoll_get_results(${_package}
"--get-extra-libs"
l
${_package}_FLAGPOLL_EXTRA_LIBS
${ARGN})
endmacro()

View File

@ -0,0 +1,74 @@
# - Try to find GDB
#
# Once done, this will define:
# GDB_FOUND - system has GDB
# GDB_COMMAND - the command to run
# GDB_VERSION - version
# GDB_HAS_RETURN_CHILD_RESULT - if the --return-child-result flag is supported
#
# Useful configuration variables you might want to add to your cache:
# GDB_ROOT_DIR - A directory prefix to search
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(GDB_ROOT_DIR
"${GDB_ROOT_DIR}"
CACHE
PATH
"Directory to start our search in")
find_program(GDB_COMMAND
NAMES
gdb
HINTS
"${GDB_ROOT_DIR}"
PATH_SUFFIXES
bin
libexec)
if(GDB_COMMAND)
execute_process(COMMAND
gdb
--version
COMMAND
head
-n
1
OUTPUT_VARIABLE
GDB_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX
REPLACE
"[^0-9]*([0-9]+[0-9.]*).*"
"\\1"
GDB_VERSION
"${GDB_VERSION}")
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GDB
DEFAULT_MSG
GDB_COMMAND
GDB_VERSION)
if(GDB_FOUND)
mark_as_advanced(GDB_ROOT_DIR)
if(GDB_VERSION VERSION_LESS 6.4)
set(GDB_HAS_RETURN_CHILD_RESULT FALSE)
else()
set(GDB_HAS_RETURN_CHILD_RESULT TRUE)
endif()
endif()
mark_as_advanced(GDB_COMMAND)

View File

@ -0,0 +1,90 @@
# - try to find Sensable GHOST library and include files
# GHOST_INCLUDE_DIRS, where to find GL/glut.h, etc.
# GHOST_LIBRARIES, the libraries to link against
# GHOST_FOUND, If false, do not try to use GLUT.
# GHOST_RUNTIME_LIBRARY_DIRS, path to DLL on Windows for runtime use.
#
# Requires these CMake modules:
# no additional modules required
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(GHOST_ROOT_DIR
"${GHOST_ROOT_DIR}"
CACHE
PATH
"Path to search for GHOST")
set(_dirs)
if(WIN32)
include(ProgramFilesGlob)
program_files_fallback_glob(_dirs "/Sensable/GHOST/v*/")
endif()
find_path(GHOST_INCLUDE_DIR
gstPHANToM.h
PATHS
${_dirs}
HINTS
"${GHOST_ROOT_DIR}"
PATH_SUFFIXES
include)
find_library(GHOST_LIBRARY
GHOST40
GHOST31
PATHS
${_dirs}
HINTS
"${GHOST_ROOT_DIR}"
PATH_SUFFIXES
lib)
if(MSVC)
if(MSVC_VERSION GREATER 1300)
# .NET and newer: fake the STL headers
get_filename_component(_moddir "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(GHOST_STL_INCLUDE_DIR "${_moddir}/ghost-fake-stl")
else()
# 6.0 and earlier - use GHOST-provided STL
find_path(GHOST_STL_INCLUDE_DIR
vector.h
PATHS
${_dirs}
HINTS
"${GHOST_ROOT_DIR}"
"${GHOST_INCLUDE_DIR}"
PATH_SUFFIXES
external/stl
stl)
endif()
set(_deps_check GHOST_STL_INCLUDE_DIR)
else()
set(_deps_check)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GHOST
DEFAULT_MSG
GHOST_LIBRARY
${_deps_check}
GHOST_INCLUDE_DIR)
if(GHOST_FOUND)
set(GHOST_LIBRARIES "${GHOST_LIBRARY}")
set(GHOST_INCLUDE_DIRS "${GHOST_INCLUDE_DIR}")
mark_as_advanced(GHOST_ROOT_DIR)
endif()
mark_as_advanced(GHOST_LIBRARY GHOST_STL_INCLUDE_DIR GHOST_INCLUDE_DIR)

View File

@ -0,0 +1,132 @@
#.rst:
# FindGLEW
# --------
#
# Find the OpenGL Extension Wrangler Library (GLEW)
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the :prop_tgt:`IMPORTED` target ``GLEW::GLEW``,
# if GLEW has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# GLEW_INCLUDE_DIRS - include directories for GLEW
# GLEW_LIBRARIES - libraries to link against GLEW
# GLEW_FOUND - true if GLEW has been found and can be used
#=============================================================================
# Copyright 2012 Benjamin Eikel
# Copyright 2016 Ryan Pavlik
#
# Distributed under the OSI-approved BSD License (the "License");
# see below.
#
# 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.
#=============================================================================
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
find_path(GLEW_INCLUDE_DIR GL/glew.h)
if(WIN32)
# TODO how to make this exclude arm?
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(GLEW_ARCH Win32)
else()
set(GLEW_ARCH x64)
endif()
set(GLEW_EXTRA_SUFFIXES lib/Release/${GLEW_ARCH} bin/Release/${GLEW_ARCH})
endif()
if(WIN32 AND GLEW_INCLUDE_DIR)
get_filename_component(GLEW_LIB_ROOT_CANDIDATE "${GLEW_INCLUDE_DIR}/.." ABSOLUTE)
endif()
find_library(GLEW_LIBRARY
NAMES GLEW glew32 glew glew32s
PATH_SUFFIXES lib64 ${GLEW_EXTRA_SUFFIXES}
HINTS "${GLEW_LIB_ROOT_CANDIDATE}")
if(WIN32 AND GLEW_LIBRARY AND NOT GLEW_LIBRARY MATCHES ".*s.lib")
get_filename_component(GLEW_LIB_DIR "${GLEW_LIBRARY}" DIRECTORY)
get_filename_component(GLEW_BIN_ROOT_CANDIDATE1 "${GLEW_LIB_DIR}/.." ABSOLUTE)
get_filename_component(GLEW_BIN_ROOT_CANDIDATE2 "${GLEW_LIB_DIR}/../../.." ABSOLUTE)
find_file(GLEW_RUNTIME_LIBRARY
NAMES glew32.dll
PATH_SUFFIXES bin ${GLEW_EXTRA_SUFFIXES}
HINTS
"${GLEW_BIN_ROOT_CANDIDATE1}"
"${GLEW_BIN_ROOT_CANDIDATE2}")
endif()
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLEW
REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY)
if(GLEW_FOUND AND NOT TARGET GLEW::GLEW)
if(WIN32 AND GLEW_LIBRARY MATCHES ".*s.lib")
# Windows, known static library.
add_library(GLEW::GLEW STATIC IMPORTED)
set_target_properties(GLEW::GLEW PROPERTIES
IMPORTED_LOCATION "${GLEW_LIBRARY}"
PROPERTY INTERFACE_COMPILE_DEFINITIONS GLEW_STATIC)
elseif(WIN32 AND GLEW_RUNTIME_LIBRARY)
# Windows, known dynamic library and we have both pieces
# TODO might be different for mingw
add_library(GLEW::GLEW SHARED IMPORTED)
set_target_properties(GLEW::GLEW PROPERTIES
IMPORTED_LOCATION "${GLEW_RUNTIME_LIBRARY}"
IMPORTED_IMPLIB "${GLEW_LIBRARY}")
else()
# Anything else - previous behavior.
add_library(GLEW::GLEW UNKNOWN IMPORTED)
set_target_properties(GLEW::GLEW PROPERTIES
IMPORTED_LOCATION "${GLEW_LIBRARY}")
endif()
set_target_properties(GLEW::GLEW PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIRS}")
endif()
mark_as_advanced(GLEW_INCLUDE_DIR GLEW_LIBRARY GLEW_RUNTIME_LIBRARY)

View File

@ -0,0 +1,136 @@
# - Try to find GLUI (GL User Interface)
# Requires OpenGL and GLUT - searches for them using find_package
# Once done, this will define
#
# GLUI_INCLUDE_DIR, where to find GL/glui.h (or GLUI/glui.h on mac)
# GLUI_LIBRARY, the libraries to link against
# GLUI_FOUND, If false, do not try to use GLUI.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# GLUI_ROOT_DIR - A directory prefix to search
# (usually a path that contains include/ as a subdirectory)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(GLUI_FIND_QUIETLY)
find_package(OpenGL QUIET)
find_package(GLUT QUIET)
else()
find_package(OpenGL)
find_package(GLUT)
endif()
if(OPENGL_FOUND AND GLUT_FOUND)
if(WIN32)
find_path(GLUI_INCLUDE_DIR
NAMES
GL/glui.h
PATHS
${GLUI_ROOT_PATH}/include
DOC
"GLUI include directory")
find_library(GLUI_LIBRARY
NAMES
glui
${GLUI_ROOT_DIR}/lib
${GLUI_ROOT_DIR}/Release
HINTS
${OPENGL_LIBRARY_DIR}
${OPENGL_INCLUDE_DIR}/../lib
DOC
"GLUI library")
find_library(GLUI_DEBUG_LIBRARY
NAMES
glui32
${GLUI_ROOT_DIR}/lib
${GLUI_ROOT_DIR}/Debug
HINTS
${OPENGL_LIBRARY_DIR}
${OPENGL_INCLUDE_DIR}/../lib
DOC
"GLUI debug library")
else()
find_library(GLUI_LIBRARY
NAMES
GLUI
glui
PATHS
${GLUI_ROOT_DIR}/lib64
${GLUI_ROOT_DIR}/lib
${GLUI_ROOT_DIR}
/usr/openwin/lib
HINTS
${OPENGL_LIBRARY_DIR}
${OPENGL_INCLUDE_DIR}/../lib64
${OPENGL_INCLUDE_DIR}/../lib
DOC
"GLUI library")
if(APPLE)
find_path(GLUI_INCLUDE_DIR
GLUI/glui.h
HINTS
${OPENGL_INCLUDE_DIR}
DOC
"GLUI include directory")
else()
find_path(GLUI_INCLUDE_DIR
GL/glui.h
PATHS
${GLUI_ROOT_DIR}/include
/usr/include/GL
/usr/openwin/share/include
/usr/openwin/include
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/contrib/libglui
DOC
"GLUI include directory")
endif()
endif()
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLUI
DEFAULT_MSG
GLUI_INCLUDE_DIR
GLUI_LIBRARY
GLUT_FOUND
OPENGL_FOUND)
if(GLUI_FOUND)
if(WIN32 AND GLUI_LIBRARY AND GLUI_DEBUG_LIBRARY)
set(GLUI_LIBRARIES
optimized
${GLUI_LIBRARY}
debug
${GLUI_DEBUG_LIBRARY}
${GLUT_LIBRARIES}
${OPENGL_LIBRARIES})
else()
set(GLUI_LIBRARIES
${GLUI_LIBRARY}
${GLUT_LIBRARIES}
${OPENGL_LIBRARIES})
endif()
set(GLUI_INCLUDE_DIRS
${GLUI_INCLUDE_DIR}
${GLUT_INCLUDE_DIR}
${OPENGL_INCLUDE_DIR})
endif()
if(GLUI_LIBRARY AND GLUI_INCLUDE_DIR)
mark_as_advanced(GLUI_INCLUDE_DIR GLUI_LIBRARY GLUI_DEBUG_LIBRARY)
endif()

View File

@ -0,0 +1,132 @@
# - try to find glut library and include files
# GLUT_INCLUDE_DIRS, where to find GL/glut.h, etc.
# GLUT_LIBRARIES, the libraries to link against
# GLUT_FOUND, If false, do not try to use GLUT.
# GLUT_RUNTIME_LIBRARY_DIRS, path to DLL on Windows for runtime use.
# GLUT_RUNTIME_LIBRARY, dll on Windows, for installation purposes
#
# Also defined, but not for general use are:
# GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
# GLUT_glut_LIBRARY = the full path to the glut library.
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
# Copyright 2009-2010 Iowa State University
# (Author: Ryan Pavlik <abiryan@ryand.net> )
#
# Distributed under the OSI-approved BSD License (the "License");
# see below.
#
# 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.
#=============================================================================
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
if(GLUT_FIND_QUIETLY)
find_package(OpenGL QUIET)
else()
find_package(OpenGL)
endif()
if(OPENGL_FOUND)
get_filename_component(_ogl_libdir ${OPENGL_gl_LIBRARY} PATH)
find_path(GLUT_INCLUDE_DIR
NAMES
GL/glut.h
GLUT/glut.h
glut.h
PATHS
${_ogl_libdir}/../include
${GLUT_ROOT_PATH}
${GLUT_ROOT_PATH}/include
/usr/include/GL
/usr/openwin/share/include
/usr/openwin/include
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/contrib/libglut)
find_library(GLUT_glut_LIBRARY
NAMES
glut
glut32
GLUT
freeglut
PATHS
${_ogl_libdir}
${GLUT_ROOT_PATH}
${GLUT_ROOT_PATH}/Release
/usr/openwin/lib)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLUT
DEFAULT_MSG
GLUT_glut_LIBRARY
GLUT_INCLUDE_DIR
OPENGL_FOUND)
if(GLUT_FOUND)
set(GLUT_LIBRARIES ${GLUT_glut_LIBRARY} ${OPENGL_LIBRARIES})
set(GLUT_INCLUDE_DIRS ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
if(WIN32)
get_filename_component(_basename "${GLUT_glut_LIBRARY}" NAME_WE)
get_filename_component(_libpath "${GLUT_glut_LIBRARY}" PATH)
find_path(GLUT_RUNTIME_LIBRARY
NAMES
${_basename}.dll
glut.dll
glut32.dll
freeglut.dll
HINTS
${_libpath}
${_libpath}/../bin)
if(GLUT_RUNTIME_LIBRARY)
get_filename_component(GLUT_RUNTIME_LIBRARY_DIRS
"${GLUT_RUNTIME_LIBRARY}"
PATH)
else()
set(GLUT_RUNTIME_LIBRARY_DIRS)
endif()
endif()
#The following deprecated settings are for backwards compatibility with CMake1.4
set(GLUT_LIBRARY ${GLUT_LIBRARIES})
set(GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
endif()
mark_as_advanced(GLUT_INCLUDE_DIR
GLUT_glut_LIBRARY
GLUT_RUNTIME_LIBRARY)

View File

@ -0,0 +1,111 @@
# - Try to find GMTL
# Optionally uses Flagpoll and FindFlagpoll.cmake
# Once done, this will define
#
# GMTL_FOUND - system has GMTL
# GMTL_INCLUDE_DIR - the GMTL include directory
#
# Useful configuration variables you might want to add to your cache:
# GMTL_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
# GMTL_ADDITIONAL_VERSIONS - Additional versions (outside of 0.5.1 to 0.7.0)
# to use when constructing search names and paths
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# VR Juggler requires this package, so this Find script takes that into
# account when determining where to search for the desired files.
# The VJ_BASE_DIR environment variable is searched (preferentially)
# when searching for this package, so most sane VR Juggler build environments
# should "just work." Note that you need to manually re-run CMake if you
# change this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_HUMAN "GMTL")
set(_HEADER gmtl/gmtl.h)
set(_FP_PKG_NAME gmtl)
include(CheckVersion)
set(GMTL_VERSIONS
${GMTL_ADDITIONAL_VERSIONS}
0.7.0
0.6.2
0.6.1
0.6.0
0.5.4
0.5.3
0.5.2
0.5.1)
set(GMTL_DIRS)
foreach(_version ${GMTL_VERSIONS})
check_version(_ver_ok GMTL ${_version})
if(_ver_ok)
list(APPEND GMTL_DIRS gmtl-${_version})
list(APPEND GMTL_HEADER_DIRS include/gmtl-${_version})
endif()
endforeach()
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanDirectoryList)
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME})
endif()
set(GMTL_ROOT_DIR
"${GMTL_ROOT_DIR}"
CACHE
PATH
"Root directory to search for GMTL")
if(DEFINED VRJUGGLER22_ROOT_DIR)
mark_as_advanced(GMTL_ROOT_DIR)
endif()
if(NOT GMTL_ROOT_DIR)
set(GMTL_ROOT_DIR "${VRJUGGLER22_ROOT_DIR}")
endif()
set(_ROOT_DIR "${GMTL_ROOT_DIR}")
# Include dir
find_path(GMTL_INCLUDE_DIR
NAMES
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATHS
PATH_SUFFIXES
${GMTL_DIRS}
${GMTL_HEADER_DIRS}
include/
DOC
"GMTL include path")
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GMTL DEFAULT_MSG GMTL_INCLUDE_DIR)
if(GMTL_FOUND)
set(GMTL_INCLUDE_DIRS "${GMTL_INCLUDE_DIR}")
mark_as_advanced(GMTL_ROOT_DIR)
endif()
mark_as_advanced(GMTL_INCLUDE_DIR)

View File

@ -0,0 +1,43 @@
# - try to find GPM library
#
# Cache Variables: (probably not for direct use in your scripts)
# GPM_INCLUDE_DIR
# GPM_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# GPM_FOUND
# GPM_INCLUDE_DIRS
# GPM_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
find_library(GPM_LIBRARY
NAMES gpm)
find_path(GPM_INCLUDE_DIR
NAMES gpm.h)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GPM
DEFAULT_MSG
GPM_LIBRARY
GPM_INCLUDE_DIR)
if(GPM_FOUND)
set(GPM_LIBRARIES "${GPM_LIBRARY}")
set(GPM_INCLUDE_DIRS "${GPM_INCLUDE_DIR}")
endif()
mark_as_advanced(GPM_INCLUDE_DIR GPM_LIBRARY)

View File

@ -0,0 +1,186 @@
# - try to find Gadgeteer 1.2 library
# Requires JCCL 1.2 and VPR 2.0 (thus FindJCCL12.cmake and FindVPR20.cmake)
# Requires X11 if not on Mac or Windows.
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 2.2 - you probably want to use
# find_package(VRJuggler22) instead, for an easy interface to this and
# related scripts. See FindVRJuggler22.cmake for more information.
#
# GADGETEER12_LIBRARY_DIR, library search path
# GADGETEER12_INCLUDE_DIR, include search path
# GADGETEER12_LIBRARY, the library to link against
# GADGETEER12_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# GADGETEER12_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_HUMAN "Gadgeteer 1.2")
set(_RELEASE_NAMES gadget-1_2 libgadget-1_2)
set(_DEBUG_NAMES gadget_d-1_2 libgadget_d-1_2)
set(_DIR gadgeteer-1.2)
set(_HEADER gadget/gadgetConfig.h)
set(_FP_PKG_NAME gadgeteer)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(Gadgeteer12_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_extra_libs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(GADGETEER12_ROOT_DIR
"${GADGETEER12_ROOT_DIR}"
CACHE
PATH
"Root directory to search for Gadgeteer")
if(DEFINED VRJUGGLER22_ROOT_DIR)
mark_as_advanced(GADGETEER12_ROOT_DIR)
endif()
if(NOT GADGETEER12_ROOT_DIR)
set(GADGETEER12_ROOT_DIR "${VRJUGGLER22_ROOT_DIR}")
endif()
set(_ROOT_DIR "${GADGETEER12_ROOT_DIR}")
find_path(GADGETEER12_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(GADGETEER12_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(GADGETEER12_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(GADGETEER12)
# Dependencies
foreach(package JCCL12 VPR20 GMTL)
if(NOT ${PACKAGE}_FOUND)
find_package(${package} ${_FIND_FLAGS})
endif()
endforeach()
if(UNIX AND NOT APPLE AND NOT WIN32)
# We need X11 if not on Mac or Windows
if(NOT X11_FOUND)
find_package(X11 ${_FIND_FLAGS})
endif()
set(_CHECK_EXTRAS
X11_FOUND
X11_X11_LIB
X11_ICE_LIB
X11_SM_LIB
X11_INCLUDE_DIR)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Gadgeteer12
DEFAULT_MSG
GADGETEER12_LIBRARY
GADGETEER12_INCLUDE_DIR
JCCL12_FOUND
JCCL12_LIBRARIES
JCCL12_INCLUDE_DIR
VPR20_FOUND
VPR20_LIBRARIES
VPR20_INCLUDE_DIR
GMTL_FOUND
GMTL_INCLUDE_DIR
${_CHECK_EXTRAS})
if(GADGETEER12_FOUND)
set(_DEPS ${JCCL12_LIBRARIES} ${VPR20_LIBRARIES})
set(GADGETEER12_INCLUDE_DIRS ${GADGETEER12_INCLUDE_DIR})
list(APPEND
GADGETEER12_INCLUDE_DIRS
${JCCL12_INCLUDE_DIRS}
${VPR20_INCLUDE_DIRS}
${GMTL_INCLUDE_DIRS})
if(UNIX AND NOT APPLE AND NOT WIN32)
# We need X11 if not on Mac or Windows
list(APPEND _DEPS ${X11_X11_LIB} ${X11_ICE_LIB} ${X11_SM_LIB})
list(APPEND GADGETEER12_INCLUDE_DIRS ${X11_INCLUDE_DIR})
endif()
clean_directory_list(GADGETEER12_INCLUDE_DIRS)
if(VRJUGGLER22_CREATE_IMPORTED_TARGETS)
create_imported_target(GADGETEER12 ${_DEPS})
else()
clean_library_list(GADGETEER12_LIBRARIES ${_DEPS})
endif()
mark_as_advanced(GADGETEER12_ROOT_DIR)
endif()
mark_as_advanced(GADGETEER12_LIBRARY_RELEASE
GADGETEER12_LIBRARY_DEBUG
GADGETEER12_INCLUDE_DIR)

View File

@ -0,0 +1,187 @@
# - try to find Gadgeteer 2.0 library
# Requires JCCL 1.4 and VPR 2.2 (thus FindJCCL14.cmake and FindVPR22.cmake)
# Requires X11 if not on Mac or Windows.
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 3.0 - you probably want to use
# find_package(VRJuggler30) instead, for an easy interface to this and
# related scripts. See FindVRJuggler30.cmake for more information.
#
# GADGETEER20_LIBRARY_DIR, library search path
# GADGETEER20_INCLUDE_DIR, include search path
# GADGETEER20_LIBRARY, the library to link against
# GADGETEER20_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# GADGETEER20_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
# Updated for VR Juggler 3.0 by:
# Brandon Newendorp <brandon@newendorp.com>
set(_HUMAN "Gadgeteer 2.0")
set(_FP_PKG_NAME gadgeteer)
set(_RELEASE_NAMES)
set(_DEBUG_NAMES)
foreach(VER 2_0 2_0_0 2_0_1 2_0_2)
list(APPEND _RELEASE_NAMES gadget-${VER})
list(APPEND _DEBUG_NAMES gadget_d-${VER})
endforeach()
set(_DIR gadgeteer-2.0)
set(_HEADER gadget/gadgetConfig.h)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(GADGETEER20_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_extra_libs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(GADGETEER20_ROOT_DIR
"${GADGETEER20_ROOT_DIR}"
CACHE
PATH
"Root directory to search for Gadgeteer")
if(DEFINED VRJUGGLER30_ROOT_DIR)
mark_as_advanced(GADGETEER20_ROOT_DIR)
endif()
if(NOT GADGETEER20_ROOT_DIR)
set(GADGETEER20_ROOT_DIR "${VRJUGGLER30_ROOT_DIR}")
endif()
set(_ROOT_DIR "${GADGETEER20_ROOT_DIR}")
find_path(GADGETEER20_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(GADGETEER20_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(GADGETEER20_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(GADGETEER20)
# Dependencies
foreach(package JCCL14 VPR22 GMTL)
if(NOT ${PACKAGE}_FOUND)
find_package(${package} ${_FIND_FLAGS})
endif()
endforeach()
if(UNIX AND NOT APPLE AND NOT WIN32)
# We need X11 if not on Mac or Windows
if(NOT X11_FOUND)
find_package(X11 ${_FIND_FLAGS})
endif()
set(_CHECK_EXTRAS
X11_FOUND
X11_X11_LIB
X11_ICE_LIB
X11_SM_LIB
X11_INCLUDE_DIR)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GADGETEER20
DEFAULT_MSG
GADGETEER20_LIBRARY
GADGETEER20_INCLUDE_DIR
JCCL14_FOUND
JCCL14_LIBRARIES
JCCL14_INCLUDE_DIR
VPR22_FOUND
VPR22_LIBRARIES
VPR22_INCLUDE_DIR
GMTL_FOUND
GMTL_INCLUDE_DIR
${_CHECK_EXTRAS})
if(GADGETEER20_FOUND)
set(_DEPS ${JCCL14_LIBRARIES} ${VPR22_LIBRARIES})
set(GADGETEER20_INCLUDE_DIRS ${GADGETEER20_INCLUDE_DIR})
list(APPEND
GADGETEER20_INCLUDE_DIRS
${JCCL14_INCLUDE_DIRS}
${VPR22_INCLUDE_DIRS}
${GMTL_INCLUDE_DIRS})
if(UNIX AND NOT APPLE AND NOT WIN32)
# We need X11 if not on Mac or Windows
list(APPEND _DEPS ${X11_X11_LIB} ${X11_ICE_LIB} ${X11_SM_LIB})
list(APPEND GADGETEER20_INCLUDE_DIRS ${X11_INCLUDE_DIR})
endif()
clean_directory_list(GADGETEER20_INCLUDE_DIRS)
if(VRJUGGLER30_CREATE_IMPORTED_TARGETS)
create_imported_target(GADGETEER20 ${_DEPS})
else()
clean_library_list(GADGETEER20_LIBRARIES ${_DEPS})
endif()
mark_as_advanced(GADGETEER20_ROOT_DIR)
endif()
mark_as_advanced(GADGETEER20_LIBRARY_RELEASE
GADGETEER20_LIBRARY_DEBUG
GADGETEER20_INCLUDE_DIR)

View File

@ -0,0 +1,203 @@
# - try to find Glove5DT libraries
#
# Cache Variables: (probably not for direct use in your scripts)
# GLOVE5DT_INCLUDE_DIR
# GLOVE5DT_LIBRARY
# GLOVE5DT_LIBRARY_RELEASE
# GLOVE5DT_LIBRARY_DEBUG
# GLOVE5DT_RUNTIME_LIBRARY_RELEASE
# GLOVE5DT_RUNTIME_LIBRARY_DEBUG
#
# Non-cache variables you might use in your CMakeLists.txt:
# GLOVE5DT_FOUND
# GLOVE5DT_INCLUDE_DIRS
# GLOVE5DT_LIBRARIES
# GLOVE5DT_RUNTIME_LIBRARY_DIRS
#
# Requires these CMake modules:
# CleanDirectoryList
# CleanLibraryList
# ListCombinations
# ProgramFilesGlob
# SelectLibraryConfigurations (included with CMake >=2.8.0)
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(GLOVE5DT_ROOT_DIR
"${GLOVE5DT_ROOT_DIR}"
CACHE
PATH
"Path to search for Glove5DT SDK")
###
# Configure Glove5DT
###
include(SelectLibraryConfigurations)
include(ListCombinations)
include(CleanDirectoryList)
include(ProgramFilesGlob)
if(WIN32)
# Data Glove 5 and 16 use these directories for includes, lib, and runtime
program_files_glob(_dirs516 "/5DT/*/Driver")
set(_dirs516
"${GLOVE5DT_ROOT_DIR}/Driver"
"${GLOVE5DT_ROOT_DIR}"
${_dirs516})
# Data Glove Ultra uses this directory as the base for a dll, inc, and lib directory
program_files_glob(_dirsultra "/5DT/*/SDK")
list_combinations(_libsearchultra
PREFIXES
"${GLOVE5DT_ROOT_DIR}"
"${_dirsultra}"
SUFFIXES
"/lib")
list_combinations(_incsearchultra
PREFIXES
"${GLOVE5DT_ROOT_DIR}"
"${_dirsultra}"
SUFFIXES
"/inc")
list_combinations(_dllsearchultra
PREFIXES
"${GLOVE5DT_ROOT_DIR}"
"${_dirsultra}"
SUFFIXES
"/dll")
endif()
###
# First search for the Ultra (2.0) SDK
###
find_path(GLOVE5DT_INCLUDE_DIR
NAMES
fglove.h
HINTS
${_incsearchultra}
${GLOVE5DT_ROOT_DIR})
find_library(GLOVE5DT_LIBRARY_RELEASE
NAMES
fglove
HINTS
${_libsearchultra}
${GLOVE5DT_ROOT_DIR})
find_library(GLOVE5DT_LIBRARY_DEBUG
NAMES
fgloved
HINTS
${_libsearchultra}
${GLOVE5DT_ROOT_DIR})
select_library_configurations(GLOVE5DT)
# As a post condition, either both LIBRARY_RELEASE and LIBRARY_DEBUG are set, or
# neither is.
###
# Ultra (2.0) SDK Runtime Libraries
###
if(WIN32)
find_file(GLOVE5DT_RUNTIME_LIBRARY_RELEASE
NAMES
fglove.dll
HINTS
${_dllsearchultra})
find_file(GLOVE5DT_RUNTIME_LIBRARY_DEBUG
NAMES
fgloved.dll
HINTS
${_dllsearchultra})
else()
# the library is the runtime library
set(GLOVE5DT_RUNTIME_LIBRARY_RELEASE "${GLOVE5DT_LIBRARY_RELEASE}")
set(GLOVE5DT_RUNTIME_LIBRARY_DEBUG "${GLOVE5DT_LIBRARY_DEBUG}")
endif()
select_library_configurations(GLOVE5DT_RUNTIME)
###
# Fallback to the 5/16 (1.0) SDK
###
find_path(GLOVE5DT_INCLUDE_DIR
NAMES
fglove.h
HINTS
${_dirs516})
find_library(GLOVE5DT_LIBRARY_RELEASE
NAMES
fglove
HINTS
${_dirs516})
select_library_configurations(GLOVE5DT)
###
# 5/16 (1.0) SDK Runtime Libraries
###
if(WIN32)
find_file(GLOVE5DT_RUNTIME_LIBRARY_RELEASE
NAMES
fglove.dll
HINTS
${_dirs516})
else()
# the library is the runtime library
set(GLOVE5DT_RUNTIME_LIBRARY_RELEASE "${GLOVE5DT_LIBRARY_RELEASE}")
endif()
select_library_configurations(GLOVE5DT_RUNTIME)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Glove5DT
DEFAULT_MSG
GLOVE5DT_LIBRARY_RELEASE
GLOVE5DT_RUNTIME_LIBRARY_RELEASE
GLOVE5DT_INCLUDE_DIR)
if(GLOVE5DT_FOUND)
set(GLOVE5DT_RUNTIME_LIBRARY_DIRS)
foreach(_lib
GLOVE5DT_RUNTIME_LIBRARY_RELEASE
GLOVE5DT_RUNTIME_LIBRARY_DEBUG)
if(${_lib})
get_filename_component(_libdir ${${_lib}} PATH)
list(APPEND GLOVE5DT_RUNTIME_LIBRARY_DIRS "${_libdir}")
endif()
endforeach()
clean_directory_list(GLOVE5DT_RUNTIME_LIBRARY_DIRS)
set(GLOVE5DT_INCLUDE_DIRS "${GLOVE5DT_INCLUDE_DIR}")
set(GLOVE5DT_LIBRARIES ${GLOVE5DT_LIBRARY})
mark_as_advanced(GLOVE5DT_ROOT_DIR)
endif()
mark_as_advanced(GLOVE5DT_INCLUDE_DIR
GLOVE5DT_LIBRARY_RELEASE
GLOVE5DT_LIBRARY_DEBUG
GLOVE5DT_RUNTIME_LIBRARY_RELEASE
GLOVE5DT_RUNTIME_LIBRARY_DEBUG)

View File

@ -0,0 +1,46 @@
# - try to find HIDAPI library
# from http://www.signal11.us/oss/hidapi/
#
# Cache Variables: (probably not for direct use in your scripts)
# HIDAPI_INCLUDE_DIR
# HIDAPI_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# HIDAPI_FOUND
# HIDAPI_INCLUDE_DIRS
# HIDAPI_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
find_library(HIDAPI_LIBRARY
NAMES hidapi hidapi-libusb)
find_path(HIDAPI_INCLUDE_DIR
NAMES hidapi.h
PATH_SUFFIXES
hidapi)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HIDAPI
DEFAULT_MSG
HIDAPI_LIBRARY
HIDAPI_INCLUDE_DIR)
if(HIDAPI_FOUND)
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}")
set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}")
endif()
mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY)

View File

@ -0,0 +1,92 @@
# - try to find Java's IDLJ Interface Definition Language compiler.
#
# Ideally used with CMake 2.8.5 or newer for Java support using FindJava.cmake
# and UseJava.cmake
#
# Variables:
# Java_IDLJ_COMMAND, executable for idlj
# IDLJ_FOUND, If false, do not try to use this
#
# Function:
# java_idlj(varname idlfile [extra idlj args]) - Generates
# the Java source files from the IDL file you indicate, and
# appends filenames suitable to add to a add_jar() call to the
# variable you specified.
#
# Because the files generated from an IDL file are not entirely predictable,
# java_idlj runs idlj in the cmake step, rather than the build step, and triggers
# a CMake re-run when an idl file is modified. Already up-to-date generated source
# is not re-generated, however.
#
# Files are generated in a directory created specifically for
# the particular IDL file and the particular call, in the build directory -
# there should be no worries about overwriting files or picking up too much
# with the wildcard.
#
# You may wish to add the IDL file to your list of sources if you want it
# to appear in your IDE, but it is not necessary.
#
# Original Author:
# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(NOT JAVA_FOUND)
find_package(Java QUIET)
endif()
if(JAVA_FOUND)
get_filename_component(JAVA_BIN_DIR "${Java_JAVAC_EXECUTABLE}" PATH)
find_program(Java_IDLJ_COMMAND
idlj
HINTS
${JAVA_BIN_DIR}
)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IDLJ
DEFAULT_MSG
Java_IDLJ_COMMAND
JAVA_FOUND)
if(IDLJ_FOUND)
function(java_idlj _varname _idlfile)
# Get some unique value we can use in a directory name
# TODO would be better to somehow munge the full path relative to CMAKE_CURRENT_SOURCE_DIR
# in case somebody has multiple idl files with the same name
get_filename_component(_idl_name "${_idlfile}" NAME_WE)
get_filename_component(_idl_abs "${_idlfile}" ABSOLUTE)
# Compute directory name and stamp filename
set(outdir "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/idlj/${_idl_name}.dir")
set(stampfile "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/idlj/${_idl_name}.stamp")
# Force re-cmake if idl file changes
configure_file("${_idl_abs}" "${stampfile}" COPY_ONLY)
if((NOT EXISTS "${outdir}") OR ("${_idl_abs}" IS_NEWER_THAN "${outdir}"))
file(REMOVE_RECURSE "${outdir}")
message(STATUS "Processing ${_idlfile} with Java's idlj")
execute_process(COMMAND
"${Java_IDLJ_COMMAND}" -fclient -fallTIE -td "${outdir}" ${ARGN} "${_idlfile}"
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}")
endif()
file(GLOB_RECURSE _idl_output "${outdir}/*")
set(${_varname} ${_idl_output} PARENT_SCOPE)
# Clean up after ourselves on make clean
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${outdir}" "${stampfile}")
endfunction()
endif()
mark_as_advanced(Java_IDLJ_COMMAND)

View File

@ -0,0 +1,108 @@
# - try to find InterSense library
#
# Cache Variables: (probably not for direct use in your scripts)
# INTERSENSE_INCLUDE_DIR
# INTERSENSE_ISENSEC_DIR - location of the isense.c "import library" substitute.
# INTERSENSE_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# INTERSENSE_FOUND
# INTERSENSE_INCLUDE_DIRS
# INTERSENSE_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Author:
# 2013 Eric Marsh <bits@wemarsh.com>
# http://wemarsh.com/
# Kognitiv Neuroinformatik, Universität Bremen
#
# (building on Ryan Pavlik's templates)
#
# 2013 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(INTERSENSE_ROOT_DIR
"${INTERSENSE_ROOT_DIR}"
CACHE
PATH
"Directory to search for the Intersense SDK")
if(APPLE)
set(_ARCH UniversalLib)
else()
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(_IS_ARCH x86_64)
else()
set(_IS_ARCH x86_32)
endif()
endif()
set(_IS_INSTALLDIRS)
if(APPLE)
set(_IS_SDKDIR MacOSX)
elseif(WIN32)
set(_IS_SDKDIR Windows)
# Default locations, as well as registry places it records install locations,
# if you installed from a (actual or downloaded) product "CD"
foreach(_IS_PROD "IS-900 Software" "InertiaCube Software")
get_filename_component(_IS_REGPATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\InterSense\\${_IS_PROD};Path]" ABSOLUTE)
if(_IS_REGPATH AND (NOT "${_IS_REGPATH}" STREQUAL "/registry"))
list(APPEND _IS_INSTALLDIRS "${_IS_REGPATH}/SDK")
endif()
list(APPEND _IS_INSTALLDIRS "C:/InterSense/${_IS_PROD}/SDK")
endforeach()
else() # Assume Linux, since that's the only other platform supported by this library
set(_IS_SDKDIR Linux)
endif()
find_path(INTERSENSE_INCLUDE_DIR
NAMES isense.h
PATHS "${INTERSENSE_ROOT_DIR}" "${INTERSENSE_ROOT_DIR}/SDK" ${_IS_INSTALLDIRS})
find_path(INTERSENSE_ISENSEC_DIR
NAMES isense.c
PATHS "${INTERSENSE_ROOT_DIR}" "${INTERSENSE_ROOT_DIR}/SDK" ${_IS_INSTALLDIRS}
PATH_SUFFIXES
"Windows/Sample/Visual C++ 2005"
"Windows/Sample/Visual C++ 2005 (single tracker)"
Linux/Sample
MacOSX/Sample)
include(FindPackageHandleStandardArgs)
# This is a weird one - no import library is supplied, and instead, at least on Windows, they use
# an isense.c file to call into the DLL. Not sure if MinGW can link right against the dll in this case.
if(WIN32)
find_package_handle_standard_args(InterSense
DEFAULT_MSG
INTERSENSE_INCLUDE_DIR
INTERSENSE_ISENSEC_DIR)
if(INTERSENSE_FOUND)
set(INTERSENSE_LIBRARIES "")
set(INTERSENSE_INCLUDE_DIRS "${INTERSENSE_INCLUDE_DIR}" "${INTERSENSE_ISENSEC_DIR}")
endif()
else() # Only MSVC on Windows theoretically needs import libraries, so...
find_library(INTERSENSE_LIBRARY
NAMES isense
PATHS "${INTERSENSE_ROOT_DIR}" "${INTERSENSE_ROOT_DIR}/SDK" ${_IS_INSTALLDIRS}
PATH_SUFFIXES "${_IS_SDKDIR}/${_IS_ARCH}")
find_package_handle_standard_args(InterSense
DEFAULT_MSG
INTERSENSE_LIBRARY
INTERSENSE_INCLUDE_DIR)
if(INTERSENSE_FOUND)
set(INTERSENSE_LIBRARIES "${INTERSENSE_LIBRARY}" ${CMAKE_DL_LIBS})
set(INTERSENSE_INCLUDE_DIRS "${INTERSENSE_INCLUDE_DIR}")
endif()
endif()
mark_as_advanced(INTERSENSE_INCLUDE_DIR INTERSENSE_ISENSEC_DIR INTERSENSE_LIBRARY)

View File

@ -0,0 +1,152 @@
# - try to find JCCL 1.2 library
# Requires VPR 2.0 (thus FindVPR20.cmake)
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 2.2 - you probably want to use
# find_package(VRJuggler22) instead, for an easy interface to this and
# related scripts. See FindVRJuggler22.cmake for more information.
#
# JCCL12_LIBRARY_DIR, library search path
# JCCL12_INCLUDE_DIR, include search path
# JCCL12_LIBRARY, the library to link against
# JCCL12_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# JCCL12_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_HUMAN "JCCL 1.2")
set(_RELEASE_NAMES jccl-1_2 libjccl-1_2)
set(_DEBUG_NAMES jccl_d-1_2 libjccl_d-1_2)
set(_DIR jccl-1.2)
set(_HEADER jccl/jcclConfig.h)
set(_FP_PKG_NAME jccl)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(JCCL12_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(JCCL12_ROOT_DIR
"${JCCL12_ROOT_DIR}"
CACHE
PATH
"Root directory to search for JCCL")
if(DEFINED VRJUGGLER22_ROOT_DIR)
mark_as_advanced(JCCL12_ROOT_DIR)
endif()
if(NOT JCCL12_ROOT_DIR)
set(JCCL12_ROOT_DIR "${VRJUGGLER22_ROOT_DIR}")
endif()
set(_ROOT_DIR ${JCCL12_ROOT_DIR})
find_path(JCCL12_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(JCCL12_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(JCCL12_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(JCCL12)
# Dependency
if(NOT VPR20_FOUND)
find_package(VPR20 ${_FIND_FLAGS})
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JCCL12
DEFAULT_MSG
JCCL12_LIBRARY
JCCL12_INCLUDE_DIR
VPR20_FOUND
VPR20_LIBRARIES
VPR20_INCLUDE_DIR)
if(JCCL12_FOUND)
set(_DEPS ${VPR20_LIBRARIES})
set(JCCL12_INCLUDE_DIRS ${JCCL12_INCLUDE_DIR})
list(APPEND JCCL12_INCLUDE_DIRS ${VPR20_INCLUDE_DIRS})
clean_directory_list(JCCL12_INCLUDE_DIRS)
if(VRJUGGLER22_CREATE_IMPORTED_TARGETS)
create_imported_target(JCCL12 ${_DEPS})
else()
clean_library_list(JCCL12_LIBRARIES)
endif()
mark_as_advanced(JCCL12_ROOT_DIR)
endif()
mark_as_advanced(JCCL12_LIBRARY_RELEASE
JCCL12_LIBRARY_DEBUG
JCCL12_INCLUDE_DIR)

View File

@ -0,0 +1,153 @@
# - try to find JCCL 1.4 library
# Requires VPR 2.2 (thus FindVPR22.cmake)
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 3.0 - you probably want to use
# find_package(VRJuggler30) instead, for an easy interface to this and
# related scripts. See FindVRJuggler30.cmake for more information.
#
# JCCL14_LIBRARY_DIR, library search path
# JCCL14_INCLUDE_DIR, include search path
# JCCL14_LIBRARY, the library to link against
# JCCL14_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# JCCL14_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
# Updated for VR Juggler 3.0 by:
# Brandon Newendorp <brandon@newendorp.com>
set(_HUMAN "JCCL 1.4")
set(_FP_PKG_NAME jccl)
set(_RELEASE_NAMES)
set(_DEBUG_NAMES)
foreach(VER 1_4 1_4_0 1_4_1 1_4_2)
list(APPEND _RELEASE_NAMES ${_FP_PKG_NAME}-${VER})
list(APPEND _DEBUG_NAMES ${_FP_PKG_NAME}_d-${VER})
endforeach()
set(_DIR jccl-1.4)
set(_HEADER jccl/jcclConfig.h)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(JCCL14_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(JCCL14_ROOT_DIR
"${JCCL14_ROOT_DIR}"
CACHE
PATH
"Root directory to search for JCCL")
if(DEFINED VRJUGGLER30_ROOT_DIR)
mark_as_advanced(JCCL14_ROOT_DIR)
endif()
if(NOT JCCL14_ROOT_DIR)
set(JCCL14_ROOT_DIR "${VRJUGGLER30_ROOT_DIR}")
endif()
set(_ROOT_DIR ${JCCL14_ROOT_DIR})
find_path(JCCL14_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(JCCL14_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(JCCL14_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(JCCL14)
# Dependency
if(NOT VPR22_FOUND)
find_package(VPR22 ${_FIND_FLAGS})
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JCCL14
DEFAULT_MSG
JCCL14_LIBRARY
JCCL14_INCLUDE_DIR
VPR22_FOUND
VPR22_LIBRARIES
VPR22_INCLUDE_DIR)
if(JCCL14_FOUND)
set(_DEPS ${VPR22_LIBRARIES})
set(JCCL14_INCLUDE_DIRS ${JCCL14_INCLUDE_DIR})
list(APPEND JCCL14_INCLUDE_DIRS ${VPR22_INCLUDE_DIRS})
clean_directory_list(JCCL14_INCLUDE_DIRS)
if(VRJUGGLER30_CREATE_IMPORTED_TARGETS)
create_imported_target(JCCL14 ${_DEPS})
else()
clean_library_list(JCCL14_LIBRARIES)
endif()
mark_as_advanced(JCCL14_ROOT_DIR)
endif()
mark_as_advanced(JCCL14_LIBRARY_RELEASE
JCCL14_LIBRARY_DEBUG
JCCL14_INCLUDE_DIR)

View File

@ -0,0 +1,392 @@
# - Find jsoncpp - Overarching find module
# This is a over-arching find module to find older jsoncpp versions and those sadly built
# without JSONCPP_WITH_CMAKE_PACKAGE=ON, as well as those built with the cmake config file.
# It also wraps the different versions of the module.
#
# On CMake 3.0 and newer:
# JsonCpp::JsonCpp - Imported target (possibly an interface/alias) to use:
# if anything is populated, this is. If both shared and static are found, then
# this will be the static version on DLL platforms and shared on non-DLL platforms.
# JsonCpp::JsonCppShared - Imported target (possibly an interface/alias) for a
# shared library version.
# JsonCpp::JsonCppStatic - Imported target (possibly an interface/alias) for a
# static library version.
#
# On all CMake versions: (Note that on CMake 2.8.10 and earlier, you may need to use JSONCPP_INCLUDE_DIRS)
# JSONCPP_LIBRARY - wraps JsonCpp::JsonCpp or equiv.
# JSONCPP_LIBRARY_IS_SHARED - if we know for sure JSONCPP_LIBRARY is shared, this is true-ish. We try to "un-set" it if we don't know one way or another.
# JSONCPP_LIBRARY_SHARED - wraps JsonCpp::JsonCppShared or equiv.
# JSONCPP_LIBRARY_STATIC - wraps JsonCpp::JsonCppStatic or equiv.
# JSONCPP_INCLUDE_DIRS - Include directories - should (generally?) not needed if you require CMake 2.8.11+ since it handles target include directories.
#
# JSONCPP_FOUND - True if JsonCpp was found.
#
# Original Author:
# 2016 Ryan Pavlik <ryan.pavlik@gmail.com>
# Incorporates work from the module contributed to VRPN under the same license:
# 2011 Philippe Crassous (ENSAM ParisTech / Institut Image) p.crassous _at_ free.fr
#
# Copyright Philippe Crassous 2011.
# Copyright Sensics, Inc. 2016.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(__jsoncpp_have_namespaced_targets OFF)
set(__jsoncpp_have_interface_support OFF)
if(NOT ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 3.0))
set(__jsoncpp_have_namespaced_targets ON)
set(__jsoncpp_have_interface_support ON)
elseif(("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" EQUAL 2.8) AND "${CMAKE_PATCH_VERSION}" GREATER 10)
set(__jsoncpp_have_interface_support ON)
endif()
# sets __jsoncpp_have_jsoncpplib based on whether or not we have a real imported jsoncpp_lib target.
macro(_jsoncpp_check_for_real_jsoncpplib)
set(__jsoncpp_have_jsoncpplib FALSE)
if(TARGET jsoncpp_lib)
get_property(__jsoncpp_lib_type TARGET jsoncpp_lib PROPERTY TYPE)
# We make interface libraries. If an actual config module made it, it would be an imported library.
if(NOT __jsoncpp_lib_type STREQUAL "INTERFACE_LIBRARY")
set(__jsoncpp_have_jsoncpplib TRUE)
endif()
endif()
#message(STATUS "__jsoncpp_have_jsoncpplib ${__jsoncpp_have_jsoncpplib}")
endmacro()
include(FindPackageHandleStandardArgs)
# Ensure that if this is TRUE later, it's because we set it.
set(JSONCPP_FOUND FALSE)
set(__jsoncpp_have_jsoncpplib FALSE)
# See if we find a CMake config file - there is no harm in calling this more than once,
# and we need to call it at least once every CMake invocation to create the original
# imported targets, since those don't stick around like cache variables.
find_package(jsoncpp QUIET NO_MODULE)
if(jsoncpp_FOUND)
# Build a string to help us figure out when to invalidate our cache variables.
# start with where we found jsoncpp
set(__jsoncpp_info_string "[${jsoncpp_DIR}]")
# part of the string to indicate if we found a real jsoncpp_lib (and what kind)
_jsoncpp_check_for_real_jsoncpplib()
macro(_jsoncpp_apply_map_config target)
if(MSVC)
# Can't do this - different runtimes, incompatible ABI, etc.
set(_jsoncpp_debug_fallback)
else()
set(_jsoncpp_debug_fallback DEBUG)
#osvr_stash_map_config(DEBUG DEBUG RELWITHDEBINFO RELEASE MINSIZEREL NONE)
endif()
# Appending, just in case using project or upstream fixes this.
set_property(TARGET ${target} APPEND PROPERTY MAP_IMPORTED_CONFIG_RELEASE RELEASE RELWITHDEBINFO MINSIZEREL NONE ${_jsoncpp_debug_fallback})
set_property(TARGET ${target} APPEND PROPERTY MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELWITHDEBINFO RELEASE MINSIZEREL NONE ${_jsoncpp_debug_fallback})
set_property(TARGET ${target} APPEND PROPERTY MAP_IMPORTED_CONFIG_MINSIZEREL MINSIZEREL RELEASE RELWITHDEBINFO NONE ${_jsoncpp_debug_fallback})
set_property(TARGET ${target} APPEND PROPERTY MAP_IMPORTED_CONFIG_NONE RELEASE RELWITHDEBINFO MINSIZEREL ${_jsoncpp_debug_fallback})
if(NOT MSVC)
set_property(TARGET ${target} APPEND PROPERTY MAP_IMPORTED_CONFIG_DEBUG DEBUG RELWITHDEBINFO RELEASE MINSIZEREL NONE)
endif()
endmacro()
if(__jsoncpp_have_jsoncpplib)
list(APPEND __jsoncpp_info_string "[${__jsoncpp_lib_type}]")
_jsoncpp_apply_map_config(jsoncpp_lib)
else()
list(APPEND __jsoncpp_info_string "[]")
endif()
# part of the string to indicate if we found jsoncpp_lib_static
if(TARGET jsoncpp_lib_static)
list(APPEND __jsoncpp_info_string "[T]")
_jsoncpp_apply_map_config(jsoncpp_lib_static)
else()
list(APPEND __jsoncpp_info_string "[]")
endif()
endif()
# If we found something, and it's not the exact same as what we've found before...
# NOTE: The contents of this "if" block update only (internal) cache variables!
# (since this will only get run the first CMake pass that finds jsoncpp or that finds a different/updated install)
if(jsoncpp_FOUND AND NOT __jsoncpp_info_string STREQUAL "${JSONCPP_CACHED_JSONCPP_DIR_DETAILS}")
#message("Updating jsoncpp cache variables! ${__jsoncpp_info_string}")
set(JSONCPP_CACHED_JSONCPP_DIR_DETAILS "${__jsoncpp_info_string}" CACHE INTERNAL "" FORCE)
unset(JSONCPP_IMPORTED_LIBRARY_SHARED)
unset(JSONCPP_IMPORTED_LIBRARY_STATIC)
unset(JSONCPP_IMPORTED_LIBRARY)
unset(JSONCPP_IMPORTED_INCLUDE_DIRS)
unset(JSONCPP_IMPORTED_LIBRARY_IS_SHARED)
# if(__jsoncpp_have_jsoncpplib) is equivalent to if(TARGET jsoncpp_lib) except it excludes our
# "invented" jsoncpp_lib interface targets, made for convenience purposes after this block.
if(__jsoncpp_have_jsoncpplib AND TARGET jsoncpp_lib_static)
# A veritable cache of riches - we have both shared and static!
set(JSONCPP_IMPORTED_LIBRARY_SHARED jsoncpp_lib CACHE INTERNAL "" FORCE)
set(JSONCPP_IMPORTED_LIBRARY_STATIC jsoncpp_lib_static CACHE INTERNAL "" FORCE)
if(WIN32 OR CYGWIN OR MINGW)
# DLL platforms: static library should be default
set(JSONCPP_IMPORTED_LIBRARY ${JSONCPP_IMPORTED_LIBRARY_STATIC} CACHE INTERNAL "" FORCE)
set(JSONCPP_IMPORTED_LIBRARY_IS_SHARED FALSE CACHE INTERNAL "" FORCE)
else()
# Other platforms - might require PIC to be linked into shared libraries, so safest to prefer shared.
set(JSONCPP_IMPORTED_LIBRARY ${JSONCPP_IMPORTED_LIBRARY_SHARED} CACHE INTERNAL "" FORCE)
set(JSONCPP_IMPORTED_LIBRARY_IS_SHARED TRUE CACHE INTERNAL "" FORCE)
endif()
elseif(TARGET jsoncpp_lib_static)
# Well, only one variant, but we know for sure that it's static.
set(JSONCPP_IMPORTED_LIBRARY_STATIC jsoncpp_lib_static CACHE INTERNAL "" FORCE)
set(JSONCPP_IMPORTED_LIBRARY jsoncpp_lib_static CACHE INTERNAL "" FORCE)
set(JSONCPP_IMPORTED_LIBRARY_IS_SHARED FALSE CACHE INTERNAL "" FORCE)
elseif(__jsoncpp_have_jsoncpplib AND __jsoncpp_lib_type STREQUAL "STATIC_LIBRARY")
# We were able to figure out the mystery library is static!
set(JSONCPP_IMPORTED_LIBRARY_STATIC jsoncpp_lib CACHE INTERNAL "" FORCE)
set(JSONCPP_IMPORTED_LIBRARY jsoncpp_lib CACHE INTERNAL "" FORCE)
set(JSONCPP_IMPORTED_LIBRARY_IS_SHARED FALSE CACHE INTERNAL "" FORCE)
elseif(__jsoncpp_have_jsoncpplib AND __jsoncpp_lib_type STREQUAL "SHARED_LIBRARY")
# We were able to figure out the mystery library is shared!
set(JSONCPP_IMPORTED_LIBRARY_SHARED jsoncpp_lib CACHE INTERNAL "" FORCE)
set(JSONCPP_IMPORTED_LIBRARY jsoncpp_lib CACHE INTERNAL "" FORCE)
set(JSONCPP_IMPORTED_LIBRARY_IS_SHARED TRUE CACHE INTERNAL "" FORCE)
elseif(__jsoncpp_have_jsoncpplib)
# One variant, and we have no idea if this is just an old version or if
# this is shared based on the target name alone. Hmm.
set(JSONCPP_IMPORTED_LIBRARY jsoncpp_lib CACHE INTERNAL "" FORCE)
endif()
# Now, we need include directories. Can't just limit this to old CMakes, since
# new CMakes might be used to build projects designed to support older ones.
if(__jsoncpp_have_jsoncpplib)
get_property(__jsoncpp_interface_include_dirs TARGET jsoncpp_lib PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
if(__jsoncpp_interface_include_dirs)
set(JSONCPP_IMPORTED_INCLUDE_DIRS "${__jsoncpp_interface_include_dirs}" CACHE INTERNAL "" FORCE)
endif()
endif()
if(TARGET jsoncpp_lib_static AND NOT JSONCPP_IMPORTED_INCLUDE_DIRS)
get_property(__jsoncpp_interface_include_dirs TARGET jsoncpp_lib_static PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
if(__jsoncpp_interface_include_dirs)
set(JSONCPP_IMPORTED_INCLUDE_DIRS "${__jsoncpp_interface_include_dirs}" CACHE INTERNAL "" FORCE)
endif()
endif()
endif()
# As a convenience...
if(TARGET jsoncpp_lib_static AND NOT TARGET jsoncpp_lib)
add_library(jsoncpp_lib INTERFACE)
target_link_libraries(jsoncpp_lib INTERFACE jsoncpp_lib_static)
endif()
if(JSONCPP_IMPORTED_LIBRARY)
if(NOT JSONCPP_IMPORTED_INCLUDE_DIRS)
# OK, so we couldn't get it from the target... maybe we can figure it out from jsoncpp_DIR.
# take off the jsoncpp component
get_filename_component(__jsoncpp_import_root "${jsoncpp_DIR}/.." ABSOLUTE)
set(__jsoncpp_hints "${__jsoncpp_import_root}")
# take off the cmake component
get_filename_component(__jsoncpp_import_root "${__jsoncpp_import_root}/.." ABSOLUTE)
list(APPEND __jsoncpp_hints "${__jsoncpp_import_root}")
# take off the lib component
get_filename_component(__jsoncpp_import_root "${__jsoncpp_import_root}/.." ABSOLUTE)
list(APPEND __jsoncpp_hints "${__jsoncpp_import_root}")
# take off one more component in case of multiarch lib
get_filename_component(__jsoncpp_import_root "${__jsoncpp_import_root}/.." ABSOLUTE)
list(APPEND __jsoncpp_hints "${__jsoncpp_import_root}")
# Now, search.
find_path(JsonCpp_INCLUDE_DIR
NAMES
json/json.h
PATH_SUFFIXES include jsoncpp include/jsoncpp
HINTS ${__jsoncpp_hints})
if(JsonCpp_INCLUDE_DIR)
mark_as_advanced(JsonCpp_INCLUDE_DIR)
# Note - this does not set it in the cache, in case we find it better at some point in the future!
set(JSONCPP_IMPORTED_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR})
endif()
endif()
find_package_handle_standard_args(JsonCpp
DEFAULT_MSG
jsoncpp_DIR
JSONCPP_IMPORTED_LIBRARY
JSONCPP_IMPORTED_INCLUDE_DIRS)
endif()
if(JSONCPP_FOUND)
# Create any missing namespaced targets from the config module.
if(__jsoncpp_have_namespaced_targets)
if(JSONCPP_IMPORTED_LIBRARY AND NOT TARGET JsonCpp::JsonCpp)
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
set_target_properties(JsonCpp::JsonCpp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${JSONCPP_IMPORTED_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${JSONCPP_IMPORTED_LIBRARY}")
endif()
if(JSONCPP_IMPORTED_LIBRARY_SHARED AND NOT TARGET JsonCpp::JsonCppShared)
add_library(JsonCpp::JsonCppShared INTERFACE IMPORTED)
set_target_properties(JsonCpp::JsonCppShared PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${JSONCPP_IMPORTED_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${JSONCPP_IMPORTED_LIBRARY_SHARED}")
endif()
if(JSONCPP_IMPORTED_LIBRARY_STATIC AND NOT TARGET JsonCpp::JsonCppStatic)
add_library(JsonCpp::JsonCppStatic INTERFACE IMPORTED)
set_target_properties(JsonCpp::JsonCppStatic PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${JSONCPP_IMPORTED_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${JSONCPP_IMPORTED_LIBRARY_STATIC}")
endif()
# Hide the stuff we didn't, and no longer, need.
if(NOT JsonCpp_LIBRARY)
unset(JsonCpp_LIBRARY CACHE)
endif()
if(NOT JsonCpp_INCLUDE_DIR)
unset(JsonCpp_INCLUDE_DIR CACHE)
endif()
endif()
set(JSONCPP_LIBRARY ${JSONCPP_IMPORTED_LIBRARY})
set(JSONCPP_INCLUDE_DIRS ${JSONCPP_IMPORTED_INCLUDE_DIRS})
if(DEFINED JSONCPP_IMPORTED_LIBRARY_IS_SHARED)
set(JSONCPP_LIBRARY_IS_SHARED ${JSONCPP_IMPORTED_LIBRARY_IS_SHARED})
else()
unset(JSONCPP_LIBRARY_IS_SHARED)
endif()
if(JSONCPP_IMPORTED_LIBRARY_SHARED)
set(JSONCPP_LIBRARY_SHARED ${JSONCPP_IMPORTED_LIBRARY_SHARED})
endif()
if(JSONCPP_IMPORTED_LIBRARY_STATIC)
set(JSONCPP_LIBRARY_STATIC ${JSONCPP_IMPORTED_LIBRARY_STATIC})
endif()
endif()
# Still nothing after looking for the config file: must go "old-school"
if(NOT JSONCPP_FOUND)
# Invoke pkgconfig for hints
find_package(PkgConfig QUIET)
set(_JSONCPP_INCLUDE_HINTS)
set(_JSONCPP_LIB_HINTS)
if(PKG_CONFIG_FOUND)
pkg_search_module(_JSONCPP_PC QUIET jsoncpp)
if(_JSONCPP_PC_INCLUDE_DIRS)
set(_JSONCPP_INCLUDE_HINTS ${_JSONCPP_PC_INCLUDE_DIRS})
endif()
if(_JSONCPP_PC_LIBRARY_DIRS)
set(_JSONCPP_LIB_HINTS ${_JSONCPP_PC_LIBRARY_DIRS})
endif()
if(_JSONCPP_PC_LIBRARIES)
set(_JSONCPP_LIB_NAMES ${_JSONCPP_PC_LIBRARIES})
endif()
endif()
if(NOT _JSONCPP_LIB_NAMES)
# OK, if pkg-config wasn't able to give us a library name suggestion, then we may
# have to resort to some intense old logic.
set(_JSONCPP_LIB_NAMES jsoncpp)
set(_JSONCPP_PATHSUFFIXES)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND _JSONCPP_PATHSUFFIXES
linux-gcc) # bit of a generalization but close...
endif()
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND
_JSONCPP_LIB_NAMES
json_linux-gcc-${CMAKE_CXX_COMPILER_VERSION}_libmt
json_linux-gcc_libmt)
list(APPEND _JSONCPP_PATHSUFFIXES
linux-gcc-${CMAKE_CXX_COMPILER_VERSION})
elseif(MSVC)
if(MSVC_VERSION EQUAL 1200)
list(APPEND _JSONCPP_LIB_NAMES json_vc6_libmt)
list(APPEND _JSONCPP_PATHSUFFIXES msvc6)
elseif(MSVC_VERSION EQUAL 1300)
list(APPEND _JSONCPP_LIB_NAMES json_vc7_libmt)
list(APPEND _JSONCPP_PATHSUFFIXES msvc7)
elseif(MSVC_VERSION EQUAL 1310)
list(APPEND _JSONCPP_LIB_NAMES json_vc71_libmt)
list(APPEND _JSONCPP_PATHSUFFIXES msvc71)
elseif(MSVC_VERSION EQUAL 1400)
list(APPEND _JSONCPP_LIB_NAMES json_vc8_libmt)
list(APPEND _JSONCPP_PATHSUFFIXES msvc80)
elseif(MSVC_VERSION EQUAL 1500)
list(APPEND _JSONCPP_LIB_NAMES json_vc9_libmt)
list(APPEND _JSONCPP_PATHSUFFIXES msvc90)
elseif(MSVC_VERSION EQUAL 1600)
list(APPEND _JSONCPP_LIB_NAMES json_vc10_libmt)
list(APPEND _JSONCPP_PATHSUFFIXES msvc10 msvc100)
endif()
elseif(MINGW)
list(APPEND _JSONCPP_LIB_NAMES
json_mingw_libmt)
list(APPEND _JSONCPP_PATHSUFFIXES mingw)
else()
list(APPEND _JSONCPP_LIB_NAMES
json_suncc_libmt
json_vacpp_libmt)
endif()
endif() # end of old logic
# Actually go looking.
find_path(JsonCpp_INCLUDE_DIR
NAMES
json/json.h
PATH_SUFFIXES jsoncpp
HINTS ${_JSONCPP_INCLUDE_HINTS})
find_library(JsonCpp_LIBRARY
NAMES
${_JSONCPP_LIB_NAMES}
PATHS libs
PATH_SUFFIXES ${_JSONCPP_PATHSUFFIXES}
HINTS ${_JSONCPP_LIB_HINTS})
find_package_handle_standard_args(JsonCpp
DEFAULT_MSG
JsonCpp_INCLUDE_DIR
JsonCpp_LIBRARY)
if(JSONCPP_FOUND)
# We already know that the target doesn't exist, let's make it.
# TODO don't know why we get errors like:
# error: 'JsonCpp::JsonCpp-NOTFOUND', needed by 'bin/osvr_json_to_c', missing and no known rule to make it
# when we do the imported target commented out below. So, instead, we make an interface
# target with an alias. Hmm.
#add_library(JsonCpp::JsonCpp UNKNOWN IMPORTED)
#set_target_properties(JsonCpp::JsonCpp PROPERTIES
# IMPORTED_LOCATION "${JsonCpp_LIBRARY}"
# INTERFACE_INCLUDE_DIRECTORIES "${JsonCpp_INCLUDE_DIR}"
# IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
set(JSONCPP_LIBRARY "${JsonCpp_LIBRARY}")
set(JSONCPP_INCLUDE_DIRS "${JsonCpp_INCLUDE_DIR}")
unset(JSONCPP_LIBRARY_IS_SHARED)
if(__jsoncpp_have_interface_support AND NOT TARGET jsoncpp_interface)
add_library(jsoncpp_interface INTERFACE)
set_target_properties(jsoncpp_interface PROPERTIES
INTERFACE_LINK_LIBRARIES "${JsonCpp_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${JsonCpp_INCLUDE_DIR}")
endif()
if(__jsoncpp_have_namespaced_targets)
if(NOT TARGET JsonCpp::JsonCpp)
add_library(JsonCpp::JsonCpp ALIAS jsoncpp_interface)
endif()
endif()
endif()
endif()
if(JSONCPP_FOUND)
mark_as_advanced(jsoncpp_DIR JsonCpp_INCLUDE_DIR JsonCpp_LIBRARY)
endif()

View File

@ -0,0 +1,455 @@
# - try to find JTTK library
#
# JTTK_LIBRARY_DIRS, library search path
# JTTK_INCLUDE_DIRS, include search path
# JTTK_{component}_LIBRARY, the library to link against
# JTTK_ENVIRONMENT, environment variables to set
# JTTK_RUNTIME_LIBRARY_DIRS
# JTTK_FOUND, If false, do not try to use this library.
#
# If you have license issues, you might run this command on each JtTk-using target:
# jttk_stamp_binary(<targetname>)
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# JTTK_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
include(ListCombinations)
include(CheckVersion)
include(GetDirectoryList)
include(PrefixListGlob)
include(GetCompilerInfoString)
if(WIN32)
include(ProgramFilesGlob)
endif()
set(JTTK_ROOT_DIR
"${JTTK_ROOT_DIR}"
CACHE
PATH
"Root directory to search for JtTk")
if(NOT JTTK_CUSTOMER_ID)
set(JTTK_CUSTOMER_ID "$ENV{JTTK_CUSTOMER_ID}")
endif()
set(JTTK_CUSTOMER_ID
"${JTTK_CUSTOMER_ID}"
CACHE
STRING
"JtTk customer ID, to place in the environment")
get_filename_component(_jttk_mod_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(NOT BITS)
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(BITS 64)
else()
set(BITS 32)
endif()
endif()
set(JTTK_ENVIRONMENT "JTTK_DEV_PLATFORM=${BITS}")
if(JTTK_CUSTOMER_ID)
list(APPEND JTTK_ENVIRONMENT "JTTK_CUSTOMER_ID=${JTTK_CUSTOMER_ID}")
endif()
if(WIN32 AND MSVC)
if(MSVC90)
set(VC_VER vc9)
set(VC_VER_LONG vc90)
elseif(MSVC80)
set(VC_VER vc8)
set(VC_VER_LONG vc80)
elseif(MSVC71)
set(VC_VER vc71)
set(VC_VER_LONG vc71)
endif()
if(BITS EQUAL 32)
set(PLATFORM win32)
else()
set(PLATFORM win64)
endif()
endif()
if(NOT "${3RDPARTYROOT}")
set(3RDPARTYROOT ${CMAKE_SOURCE_DIR}/third-party)
endif()
set(libsearchdirs)
set(includesearchdirs)
set(_jttklibs)
set(_libsuffixes)
if(WIN32)
program_files_fallback_glob(_dirs "/UGS/JTOpenToolkit/*/dev")
program_files_fallback_glob(_dirs2 "/Siemens/JTOpenToolkit/*/dev")
list(APPEND _dirs ${_dirs2})
file(TO_CMAKE_PATH "$ENV{JTTK_DEV_PATH}" _envloc)
list(APPEND _dirs "${_envloc}")
if(MSVC90)
prefix_list_glob(_vc9_libdirs
"/lib/win_${BITS}vc9/JtTk*.dll"
"${JTTK_ROOT_DIR}"
${_dirs})
list(APPEND _jttklibs ${_vc9_libdirs})
prefix_list_glob(_vc9_libdirs
"/lib/win_${BITS}_vc9/JtTk*.dll"
"${JTTK_ROOT_DIR}"
${_dirs})
list(APPEND _jttklibs ${_vc9_libdirs})
list(APPEND _libsuffixes "/lib/win_${BITS}vc9" "/lib/win_${BITS}_vc9")
endif()
if(MSVC80)
prefix_list_glob(_vc8_libdirs
"/lib/win_${BITS}/JtTk*.dll"
"${JTTK_ROOT_DIR}"
${_dirs})
list(APPEND _jttklibs ${_vc8_libdirs})
list(APPEND _libsuffixes "/lib/win_${BITS}")
endif()
if(MSVC71)
prefix_list_glob(_vc71_libdirs
"/lib/win_${BITS}vs7/JtTk*.dll"
"${dirs}")
list(APPEND _jttklibs "${_vc71_libdirs}")
list(APPEND _libsuffixes "/lib/win_${BITS}vs7")
endif()
elseif(UNIX)
get_gcc_version(_gccver)
if("${_gccver}" VERSION_LESS "4.1.0")
set(_compiler "")
else()
set(_compiler "_gcc41")
endif()
string(TOLOWER "${CMAKE_SYSTEM_NAME}" _sysname)
file(TO_CMAKE_PATH "$ENV{JTTK_DEV_PATH}" _envloc)
prefix_list_glob(_jttklibs
"/lib/${_sysname}_${BITS}${_compiler}/libJtTk*"
"${JTTK_ROOT_DIR}"
"/usr/"
"/usr/local/"
"/usr/local/siemens/"
"/usr/local/ugs/")
prefix_list_glob(_jttklibs2
"/dev/lib/${_sysname}_${BITS}${_compiler}/libJtTk*"
"${JTTK_ROOT_DIR}"
"/usr/"
"/usr/local/"
"/usr/local/siemens/"
"/usr/local/ugs/"
"${_envloc}/")
list(APPEND _jttklibs ${_jttklibs2})
list(APPEND _libsuffixes "/lib/${_sysname}_${BITS}${_compiler}")
endif()
foreach(_lib ${_jttklibs})
string(REGEX MATCH "JtTk[0-9][0-9]" _jttkver "${_lib}")
if(_jttkver)
string(REGEX
REPLACE
"JtTk([0-9])([0-9])"
"\\1.\\2"
_verstd
"${_jttkver}")
string(REGEX
REPLACE
"JtTk([0-9])([0-9])"
"\\1\\2"
_vernodot
"${_jttkver}")
endif()
check_version(_result JtTk "${_verstd}")
if(_result)
get_filename_component(_libpath "${_lib}" PATH)
list(APPEND JTTK_JTTK_VERSIONS ${_vernodot})
list(APPEND JTTK_DEV_PATHS "${_libpath}")
else()
#message(STATUS "Found JtTk version ${ver}, does not meet requirements")
endif()
endforeach()
if(JTTK_JTTK_VERSIONS)
list(SORT JTTK_JTTK_VERSIONS)
list(REVERSE JTTK_JTTK_VERSIONS)
endif()
###
# Configure JtTk
###
###
# Find the link library
###
list_combinations(names PREFIXES "JtTk" SUFFIXES ${JTTK_JTTK_VERSIONS})
find_library(JTTK_JtTk_LIBRARY
NAMES
${names}
HINTS
${JTTK_DEV_PATHS}
PATH_SUFFIXES
${_libsuffixes})
set(JTTK_LIBRARY "${JTTK_JtTk_LIBRARY}")
set(JTTK_LIBRARIES "${JTTK_JtTk_LIBRARY}")
###
# Prepare for the rest of our search based off of where we found the link library
###
get_filename_component(JTTK_LIBRARY_DIR "${JTTK_LIBRARY}" PATH)
get_filename_component(JTTK_DEV_PATH
"${JTTK_LIBRARY_DIR}/../.."
ABSOLUTE)
# Grab JtTk version
string(REGEX MATCH "JtTk[0-9]*" _ver "${JTTK_LIBRARY}")
string(REGEX
REPLACE
"JtTk([0-9])([0-9])"
"\\1.\\2"
JTTK_JTTK_VERSION
"${_ver}")
string(REGEX
REPLACE
"JtTk([0-9])([0-9])"
"\\1\\2"
JTTK_JTTK_VERNODOT
"${_ver}")
# Grab JT version
file(GLOB _jtdll "${JTTK_LIBRARY_DIR}/*JtBrep*")
string(REGEX MATCH "JtBrep[0-9]*" _jtver "${_jtdll}")
string(REGEX
REPLACE
"JtBrep([0-9])([0-9])"
"\\1\\2"
JTTK_JT_VERNODOT
"${_jtver}")
# Setup dev path
get_filename_component(JTTK_DEV_PATH
"${JTTK_LIBRARY_DIR}/../../"
ABSOLUTE)
list(APPEND JTTK_ENVIRONMENT "JTTK_DEV_PATH=${JTTK_DEV_PATH}")
set(ENV{JTTK_DEV_PLATFORM} ${BITS})
set(ENV{JTTK_DEV_PATH} "${JTTK_DEV_PATH}")
set(_deps_libs)
set(_deps_includes)
set(_deps_check)
###
# Find the headers
###
find_path(JTTK_INCLUDE_DIR
JtTk/JtkEntity.h
HINTS
${JTTK_DEV_PATH}/include)
if(WIN32)
###
# Find the DLL's
###
# Find the versioned DLL's
foreach(dll Jt JtBrep JtLibra JtSimp JtSupt JtXTBrep ParaSupt)
find_file(JTTK_${dll}_DLL
NAMES
"${dll}${JTTK_JT_VERNODOT}.dll"
HINTS
"${JTTK_LIBRARY_DIR}")
list(APPEND JTTK_DLLS ${JTTK_${dll}_DLL})
mark_as_advanced(JTTK_${dll}_DLL)
endforeach()
# Find the unversioned DLL's and the matching JtTk dll
foreach(dll psbodyshop pskernel psxttoolkit JtTk${JTTK_JTTK_VERNODOT})
list_combinations(names PREFIXES "${dll}" SUFFIXES ".dll")
find_file(JTTK_${dll}_DLL
NAMES
${names}
HINTS
"${JTTK_LIBRARY_DIR}")
list(APPEND JTTK_DLLS ${JTTK_${dll}_DLL})
mark_as_advanced(JTTK_${dll}_DLL)
endforeach()
get_directory_list(JTTK_RUNTIME_LIBRARY_DIRS ${JTTK_DLLS})
elseif(UNIX)
foreach(_lib Jt JtBrep JtLibra JtSimp JtSupt JtXTBrep ParaSupt)
find_library(JTTK_${_lib}_LIBRARY
NAMES
"${_lib}${JTTK_JT_VERNODOT}"
HINTS
"${JTTK_LIBRARY_DIR}")
list(APPEND _deps_libs "${JTTK_${_lib}_LIBRARY}")
list(APPEND _deps_check JTTK_${_lib}_LIBRARY)
mark_as_advanced(JTTK_${_lib}_LIBRARY)
endforeach()
# Find the unversioned libs
foreach(_lib psbodyshop pskernel psxttoolkit eaiunicode)
find_library(JTTK_${_lib}_LIBRARY
NAMES
${_lib}
HINTS
"${JTTK_LIBRARY_DIR}")
list(APPEND _deps_libs "${JTTK_${_lib}_LIBRARY}")
list(APPEND _deps_check JTTK_${_lib}_LIBRARY)
mark_as_advanced(JTTK_${_lib}_LIBRARY)
endforeach()
# Find stamper
#list(APPEND _deps_check JTTK_KEYS)
find_program(JTTK_STAMP_COMMAND
stampkey
HINTS
"${JTTK_DEV_PATH}/../bin")
list(APPEND _deps_check JTTK_STAMP_COMMAND)
find_program(JTTK_STAMP_PLATFORM_COMMAND
stampkey
HINTS
"${JTTK_DEV_PATH}/../bin/${_sysname}")
list(APPEND _deps_check JTTK_STAMP_PLATFORM_COMMAND)
if("${JTTK_KEYS}" STREQUAL "${JTTK_KEYS_AUTO}" OR NOT JTTK_KEYS)
find_file(JTTK_INSTALL_LOG
install.log
HINTS
"${JTTK_DEV_PATH}/.."
NO_DEFAULT_PATH)
#list(APPEND _deps_check JTTK_INSTALL_LOG)
mark_as_advanced(JTTK_INSTALL_LOG)
if(JTTK_INSTALL_LOG)
file(READ "${JTTK_INSTALL_LOG}" _log)
string(REGEX MATCHALL "..key ([0-9A-Z])+" _keylines "${_log}")
set(JTTK_KEYS)
foreach(_keyline ${_keylines})
string(REGEX
REPLACE
"..key (([0-9A-Z])+)$"
"\\1"
_key
"${_keyline}")
list(APPEND JTTK_KEYS "${_key}")
message(STATUS "Found JtTk key: ${_key}")
endforeach()
set(JTTK_KEYS
"${JTTK_KEYS}"
CACHE
STRING
"A semi-colon separated list of JtTk keys to stamp on the binaries."
FORCE)
set(JTTK_KEYS_AUTO
"${JTTK_KEYS}"
CACHE
INTERNAL
"The keys we auto-detected"
FORCE)
endif()
else()
foreach(_key ${JTTK_KEYS})
message(STATUS "Using cached JtTk key: ${_key}")
endforeach()
set(JTTK_KEYS
"${JTTK_KEYS}"
CACHE
STRING
"A semi-colon separated list of JtTk keys to stamp on the binaries.")
endif()
# Find dependencies
find_library(JTTK_MATH_LIBRARY m)
mark_as_advanced(JTTK_MATH_LIBRARY)
list(APPEND _deps_check JTTK_MATH_LIBRARY)
list(APPEND _deps_libs ${JTTK_MATH_LIBRARY})
if(NOT X11_FOUND)
find_package(X11)
endif()
list(APPEND _deps_check X11_FOUND)
list(APPEND _deps_libs ${X11_LIBRARIES})
list(APPEND _deps_includes ${X11_INCLUDE_DIRS})
if(NOT OPENGL_FOUND)
find_package(OpenGL)
endif()
list(APPEND _deps_check OPENGL_FOUND)
list(APPEND _deps_libs ${OPENGL_LIBRARIES})
list(APPEND _deps_includes ${OPENGL_INCLUDE_DIR})
if(NOT THREADS_FOUND)
find_package(Threads)
endif()
list(APPEND _deps_check THREADS_FOUND)
list(APPEND _deps_libs ${CMAKE_THREAD_LIBS_INIT})
get_directory_list(JTTK_RUNTIME_LIBRARY_DIRS ${_deps_libs})
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JtTk
DEFAULT_MSG
JTTK_JtTk_LIBRARY
JTTK_CUSTOMER_ID
JTTK_INCLUDE_DIR
${_deps_check})
if(JTTK_FOUND)
set(JTTK_INCLUDE_DIRS "${JTTK_INCLUDE_DIR}" ${_deps_includes})
set(JTTK_LIBRARIES "${JTTK_LIBRARY}" ${_deps_libs})
mark_as_advanced(JTTK_CUSTOMER_ID JTTK_ROOT_DIR)
endif()
function(jttk_stamp_binary _target)
if(UNIX)
get_target_property(_binary "${_target}" LOCATION)
configure_file("${_jttk_mod_dir}/FindJtTk.stampkey.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${_target}.stampkey.cmake"
@ONLY)
add_custom_command(TARGET
"${_target}"
POST_BUILD
COMMAND
"${CMAKE_COMMAND}"
-P
"${CMAKE_CURRENT_BINARY_DIR}/${_target}.stampkey.cmake"
COMMENT
"Stamping executable ${_binary} with JtTk keys..."
VERBATIM)
endif()
endfunction()
mark_as_advanced(JTTK_JtTk_LIBRARY
JTTK_INCLUDE_DIR
JTTK_KEYS
JTTK_STAMP_COMMAND
JTTK_STAMP_PLATFORM_COMMAND)

View File

@ -0,0 +1,42 @@
# Small script to stamp the JtTk license key on an executable
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
set(ENV{JTTK_DEV_PLATFORM} @BITS@)
set(ENV{JTTK_DEV_PATH} @JTTK_DEV_PATH@)
set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:@JTTK_LIBRARY_DIR@")
set(ENV{PATH} "$ENV{PATH}:@JTTK_DEV_PATH@/../bin/")
message(STATUS "The stamp commands are being run with these environment variables:")
execute_process(COMMAND ${CMAKE_COMMAND} -E environment)
set(JTTK_KEYS @JTTK_KEYS@)
foreach(_key ${JTTK_KEYS})
execute_process(COMMAND ${_command} @JTTK_STAMP_COMMAND@ ${_key} @_binary@
RESULT_VARIABLE _result)
if(NOT "${_result}" EQUAL "0")
message(STATUS "Failed (error ${_result}) running stamp command:
@JTTK_STAMP_COMMAND@ ${_key} @_binary@")
else()
message(STATUS "Succeeded running stamp command:
@JTTK_STAMP_COMMAND@ ${_key} @_binary@")
endif()
execute_process(COMMAND @JTTK_STAMP_PLATFORM_COMMAND@ ${_key} @_binary@
RESULT_VARIABLE _result)
if(NOT "${_result}" EQUAL "0")
message(STATUS "Failed (error ${_result}) running stamp command:
@JTTK_STAMP_PLATFORM_COMMAND@ ${_key} @_binary@")
else()
message(STATUS "Succeeded running stamp command:
@JTTK_STAMP_PLATFORM_COMMAND@ ${_key} @_binary@")
endif()
endforeach()

View File

@ -0,0 +1,91 @@
# - Try to find LAPACK and BLAS libraries
# Once done, this will define
# LAPACKLIBS_LIBRARIES, all libraries to link against
# LAPACKLIBS_FOUND, If false, do not try to use LAPACK library features.
#
# Users may wish to set:
# LAPACKLIBS_ROOT_DIR, location to start searching for LAPACK libraries
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_check)
set(LAPACKLIBS_ROOT_DIR
"${LAPACKLIBS_ROOT_DIR}"
CACHE
PATH
"Directory to search for LAPACK libraries")
if(APPLE)
find_library(LAPACKLIBS_VECLIB_FRAMEWORK veclib)
find_library(LAPACKLIBS_ACCELERATE_FRAMEWORK accelerate)
mark_as_advanced(LAPACKLIBS_VECLIB_FRAMEWORK
LAPACKLIBS_ACCELERATE_FRAMEWORK)
set(LAPACKLIBS_LIBRARIES
"${LAPACKLIBS_VECLIB_FRAMEWORK}"
"${LAPACKLIBS_ACCELERATE_FRAMEWORK}")
list(APPEND
_check
LAPACKLIBS_VECLIB_FRAMEWORK
LAPACKLIBS_ACCELERATE_FRAMEWORK)
elseif(WIN32)
# Tested to work with the files from http://www.fi.muni.cz/~xsvobod2/misc/lapack/
# You might also see http://icl.cs.utk.edu/lapack-for-windows/clapack/index.html for
# the libraries and headers.
# Good luck!
find_library(LAPACKLIBS_LAPACK_LIBRARY
NAMES
lapack_win32_MT
lapack
lapackd
HINTS
${LAPACKLIBS_ROOT_DIR}
PATH_SUFFIXES
lapack-MT-release
lapack-MT-debug
lib)
find_library(LAPACKLIBS_BLAS_LIBRARY
NAMES
blas_win32_MT
blas
blasd
HINTS
${LAPACKLIBS_ROOT_DIR}
PATH_SUFFIXES
lapack-MT-release
lapack-MT-debug
lib)
set(LAPACKLIBS_LIBRARIES
"${LAPACKLIBS_LAPACK_LIBRARY}"
"${LAPACKLIBS_BLAS_LIBRARY}")
list(APPEND _check LAPACKLIBS_LAPACK_LIBRARY LAPACKLIBS_BLAS_LIBRARY)
elseif(UNIX)
# All other Linux/Unix should have lapack without a fuss
list(APPEND _check LAPACKLIBS_LAPACK_LIBRARY)
find_library(LAPACKLIBS_LAPACK_LIBRARY lapack)
set(LAPACKLIBS_LIBRARIES "${LAPACKLIBS_LAPACK_LIBRARY}")
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LAPACKLibs
DEFAULT_MSG
${_check})
if(LAPACKLIBS_FOUND)
mark_as_advanced(LAPACKLIBS_ROOT_DIR
LAPACKLIBS_LAPACK_LIBRARY
LAPACKLIBS_BLAS_LIBRARY)
endif()

View File

@ -0,0 +1,78 @@
# - try to find Hillcrest Labs' libfreespace library
#
# Cache Variables: (probably not for direct use in your scripts)
# LIBFREESPACE_INCLUDE_DIR
# LIBFREESPACE_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# LIBFREESPACE_FOUND
# LIBFREESPACE_INCLUDE_DIRS
# LIBFREESPACE_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2014 Ryan Pavlik <ryan@sensics.com> <abiryan@ryand.net>
# http://academic.cleardefinition.com
#
# Copyright Sensics, Inc. 2014.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(LIBFREESPACE_ROOT_DIR
"${LIBFREESPACE_ROOT_DIR}"
CACHE
PATH
"Directory to search for libfreespace")
find_library(LIBFREESPACE_LIBRARY
NAMES
freespace
libfreespace
PATHS
"${LIBFREESPACE_ROOT_DIR}"
PATH_SUFFIXES
lib)
get_filename_component(_libdir "${LIBFREESPACE_LIBRARY}" PATH)
find_path(LIBFREESPACE_INCLUDE_DIR
NAMES
freespace/freespace.h
HINTS
"${_libdir}"
"${_libdir}/.."
PATHS
"${LIBFREESPACE_ROOT_DIR}"
PATH_SUFFIXES
include/)
include(FindPackageHandleStandardArgs)
if(WIN32)
find_package(WinHID QUIET)
find_package_handle_standard_args(LibFreespace
DEFAULT_MSG
LIBFREESPACE_LIBRARY
LIBFREESPACE_INCLUDE_DIR
WINHID_LIBRARIES)
else()
find_package_handle_standard_args(LibFreespace
DEFAULT_MSG
LIBFREESPACE_LIBRARY
LIBFREESPACE_INCLUDE_DIR)
endif()
if(LIBFREESPACE_FOUND)
set(LIBFREESPACE_LIBRARIES "${LIBFREESPACE_LIBRARY}")
if(WIN32)
list(APPEND LIBFREESPACE_LIBRARIES ${WINHID_LIBRARIES})
endif()
set(LIBFREESPACE_INCLUDE_DIRS "${LIBFREESPACE_INCLUDE_DIR}")
mark_as_advanced(LIBFREESPACE_ROOT_DIR)
endif()
mark_as_advanced(LIBFREESPACE_INCLUDE_DIR
LIBFREESPACE_LIBRARY)

View File

@ -0,0 +1,96 @@
# - try to find libusb-1 library
#
# Cache Variables: (probably not for direct use in your scripts)
# LIBUSB1_LIBRARY
# LIBUSB1_INCLUDE_DIR
#
# Non-cache variables you should use in your CMakeLists.txt:
# LIBUSB1_LIBRARIES
# LIBUSB1_INCLUDE_DIRS
# LIBUSB1_FOUND - if this is not true, do not attempt to use this library
#
# Requires these CMake modules:
# ProgramFilesGlob
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(LIBUSB1_ROOT_DIR
"${LIBUSB1_ROOT_DIR}"
CACHE
PATH
"Root directory to search for libusb-1")
if(WIN32)
include(ProgramFilesGlob)
program_files_fallback_glob(_dirs "LibUSB-Win32")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
if(MSVC)
set(_lib_suffixes lib/msvc_x64 MS64/static)
endif()
else()
if(MSVC)
set(_lib_suffixes lib/msvc MS32/static)
elseif(COMPILER_IS_GNUCXX)
set(_lib_suffixes lib/gcc)
endif()
endif()
else()
set(_lib_suffixes)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBUSB1 libusb-1.0)
endif()
endif()
find_path(LIBUSB1_INCLUDE_DIR
NAMES
libusb.h
PATHS
${PC_LIBUSB1_INCLUDE_DIRS}
${PC_LIBUSB1_INCLUDEDIR}
${_dirs}
HINTS
"${LIBUSB1_ROOT_DIR}"
PATH_SUFFIXES
include/libusb-1.0
include
libusb-1.0)
find_library(LIBUSB1_LIBRARY
NAMES
libusb-1.0
usb-1.0
PATHS
${PC_LIBUSB1_LIBRARY_DIRS}
${PC_LIBUSB1_LIBDIR}
${_dirs}
HINTS
"${LIBUSB1_ROOT_DIR}"
PATH_SUFFIXES
${_lib_suffixes})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libusb1
DEFAULT_MSG
LIBUSB1_LIBRARY
LIBUSB1_INCLUDE_DIR)
if(LIBUSB1_FOUND)
set(LIBUSB1_LIBRARIES "${LIBUSB1_LIBRARY}")
set(LIBUSB1_INCLUDE_DIRS "${LIBUSB1_INCLUDE_DIR}")
mark_as_advanced(LIBUSB1_ROOT_DIR)
endif()
mark_as_advanced(LIBUSB1_INCLUDE_DIR LIBUSB1_LIBRARY)

View File

@ -0,0 +1,73 @@
# - try to find Luabind
#
# Users may optionally supply:
# LUABIND_ROOT_DIR - a prefix to start searching
#
# Non-cache variables you might use in your CMakeLists.txt:
# LUABIND_FOUND
# LUABIND_DEFINITIONS
# LUABIND_INCLUDE_DIRS
# LUABIND_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(LUABIND_ROOT_DIR
"${LUABIND_ROOT_DIR}"
CACHE
PATH
"Path to search for Luabind")
###
# Dependencies
###
find_package(Lua51 QUIET)
###
# Configure Luabind
###
find_path(LUABIND_INCLUDE_DIR
NAMES
luabind/luabind.hpp
HINTS
"${LUABIND_ROOT_DIR}"
PATH_SUFFIXES
include)
mark_as_advanced(LUABIND_INCLUDE_DIR)
find_library(LUABIND_LIBRARY
NAMES
luabind
HINTS
"${LUABIND_ROOT_DIR}"
PATH_SUFFIXES
lib64
lib)
mark_as_advanced(LUABIND_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Luabind
DEFAULT_MSG
LUABIND_LIBRARY
LUABIND_INCLUDE_DIR
LUA_LIBRARIES
LUA_INCLUDE_DIR)
if(LUABIND_FOUND)
set(LUABIND_INCLUDE_DIRS "${LUABIND_INCLUDE_DIR}" "${LUA_INCLUDE_DIR}")
set(LUABIND_LIBRARIES "${LUABIND_LIBRARY}" ${LUA_LIBRARIES})
set(LUABIND_DEFINITIONS "-DLUABIND_DYNAMIC_LINK")
mark_as_advanced(LUABIND_ROOT_DIR)
endif()

View File

@ -0,0 +1,144 @@
# - Try to find LyX, and define some custom commands to export from LyX
#
# Once done, this will define:
# LYX_FOUND - system has LyX
# LYX_COMMAND - the command to run
#
# and the following new functions:
# lyx_export(<format> <extension-without-leading-dot> <output-variable>
# INPUT <lyx-file> [...]
# [OUTPUT_TO_SOURCE_DIR]
# [ EXTRA_DEPS <bibtex-or-other-file> [...] ]) - the base function
#
# These shortcut functions all have the same syntax:
# lyx_export_to_XXX(<output-variable>
# INPUT <lyx-file> [...]
# [OUTPUT_TO_SOURCE_DIR]
# [ EXTRA_DEPS <bibtex-or-other-file> [...] ])
#
# Available shortcuts:
# lyx_export_to_docbook_xml
# lyx_export_to_docbook
# lyx_export_to_pdf
# lyx_export_to_pdf_via_pdflatex
# lyx_export_to_pdf_via_dvi
#
# Useful configuration variables you might want to add to your cache:
# LYX_ROOT_DIR - A directory prefix to search
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(LYX_ROOT_DIR
"${LYX_ROOT_DIR}"
CACHE
PATH
"Directory to start our search in")
find_program(LYX_COMMAND
NAMES
lyx
HINTS
"${LYX_ROOT_DIR}"
PATH_SUFFIXES
bin)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LyX DEFAULT_MSG LYX_COMMAND)
if(LYX_FOUND)
mark_as_advanced(LYX_ROOT_DIR)
endif()
mark_as_advanced(LYX_COMMAND)
function(lyx_export _format _extension _outvar)
set(_nowhere)
set(_curdest _nowhere)
set(_val_args EXTRA_DEPS INPUT)
set(_bool_args OUTPUT_TO_SOURCE_DIR)
foreach(_arg ${_val_args} ${_bool_args})
set(${_arg})
endforeach()
foreach(_element ${ARGN})
list(FIND _val_args "${_element}" _val_arg_find)
list(FIND _bool_args "${_element}" _bool_arg_find)
if("${_val_arg_find}" GREATER "-1")
set(_curdest "${_element}")
elseif("${_bool_arg_find}" GREATER "-1")
set("${_element}" ON)
set(_curdest _nowhere)
else()
list(APPEND ${_curdest} "${_element}")
endif()
endforeach()
if(_nowhere)
message(FATAL_ERROR "Syntax error in use of a lyx_export command!")
endif()
set(_out)
set(_outname)
foreach(_file ${INPUT})
get_filename_component(_base "${_file}" NAME_WE)
if(NOT OUTPUT_TO_SOURCE_DIR)
set(_outname "${CMAKE_CURRENT_BINARY_DIR}/${_base}.${_extension}")
else()
set(_outname "${CMAKE_CURRENT_SOURCE_DIR}/${_base}.${_extension}")
endif()
list(APPEND _out "${_outname}")
if(LYX_COMMAND)
add_custom_command(OUTPUT "${_outname}"
COMMAND ${CMAKE_COMMAND} -E remove "${_outname}"
#COMMAND ${LYX_COMMAND} "${_file}" --export ${_format}
COMMAND ${LYX_COMMAND} "${_file}"
--execute
"buffer-export-custom ${_format} ${CMAKE_COMMAND} -E copy '$$$$FName' '${_outname}'"
--execute
"lyx-quit"
MAIN_DEPENDENCY "${_file}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS "${_file}" ${EXTRA_DEPS}
COMMENT "Exporting ${_file} to ${_format}...")
endif()
endforeach()
set(${_outvar} ${_out} PARENT_SCOPE)
endfunction()
function(lyx_export_to_docbook_xml _outvar)
lyx_export(docbook-xml xml ${_outvar} ${ARGN})
set(${_outvar} ${${_outvar}} PARENT_SCOPE)
endfunction()
function(lyx_export_to_docbook _outvar)
lyx_export(docbook sgml ${_outvar} ${ARGN})
set(${_outvar} ${${_outvar}} PARENT_SCOPE)
endfunction()
function(lyx_export_to_pdf _outvar)
lyx_export(pdf pdf ${_outvar} ${ARGN})
set(${_outvar} ${${_outvar}} PARENT_SCOPE)
endfunction()
function(lyx_export_to_pdf_via_pdflatex _outvar)
lyx_export(pdf2 pdf ${_outvar} ${ARGN})
set(${_outvar} ${${_outvar}} PARENT_SCOPE)
endfunction()
function(lyx_export_to_pdf_via_dvi _outvar)
lyx_export(pdf3 pdf ${_outvar} ${ARGN})
set(${_outvar} ${${_outvar}} PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,66 @@
# - try to find Mac HID frameworks
#
# Cache Variables: (probably not for direct use in your scripts)
# MACHID_CoreFoundation_LIBRARY
# MACHID_CoreFoundation_INCLUDE_DIR
# MACHID_IOKit_LIBRARY
# MACHID_IOKit_INCLUDE_DIR
# MACOSX_HID_UINT32T (from CheckMacHIDAPI)
#
# Non-cache variables you should use in your CMakeLists.txt:
# MACHID_DEFINITIONS
# MACHID_LIBRARIES
# MACHID_INCLUDE_DIRS
# MACHID_FOUND - if this is not true, do not attempt to use this library
#
# Requires these CMake modules:
# CheckMacHIDAPI
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(APPLE)
find_library(MACHID_CoreFoundation_LIBRARY CoreFoundation)
find_path(MACHID_CoreFoundation_INCLUDE_DIR
CoreFoundation/CoreFoundation.h)
find_library(MACHID_IOKit_LIBRARY IOKit)
find_path(MACHID_IOKit_INCLUDE_DIR IOKit/hid/IOHIDLib.h)
include(CheckMacHIDAPI)
set(MACHID_DEFINITIONS "-DMACOSX_HID_UINT32T=${MACOSX_HID_UINT32T}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MacHID
DEFAULT_MSG
MACHID_CoreFoundation_LIBRARY
MACHID_CoreFoundation_INCLUDE_DIR
MACHID_IOKit_LIBRARY
MACHID_IOKit_INCLUDE_DIR
MACOSX_HID_UINT32T)
endif()
if(MACHID_FOUND)
set(MACHID_LIBRARIES
"${MACHID_CoreFoundation_LIBRARY}"
"${MACHID_IOKit_LIBRARY}")
set(MACHID_INCLUDE_DIRS
"${MACHID_CoreFoundation_INCLUDE_DIR}"
"${MACHID_IOKit_INCLUDE_DIR}")
mark_as_advanced(MACHID_CoreFoundation_LIBRARY
MACHID_CoreFoundation_INCLUDE_DIR
MACHID_IOKit_LIBRARY
MACHID_IOKit_INCLUDE_DIR)
endif()

View File

@ -0,0 +1,56 @@
# - try to find Markdown tool
#
# Cache Variables:
# MARKDOWN_EXECUTABLE
#
# Non-cache variables you might use in your CMakeLists.txt:
# MARKDOWN_FOUND
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2011 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2011.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
file(TO_CMAKE_PATH "${MARKDOWN_ROOT_DIR}" MARKDOWN_ROOT_DIR)
set(MARKDOWN_ROOT_DIR
"${MARKDOWN_ROOT_DIR}"
CACHE
PATH
"Path to search for Markdown")
if(MARKDOWN_EXECUTABLE AND NOT EXISTS "${MARKDOWN_EXECUTABLE}")
set(MARKDOWN_EXECUTABLE "notfound" CACHE PATH FORCE "")
endif()
# If we have a custom path, look there first.
if(MARKDOWN_ROOT_DIR)
find_program(MARKDOWN_EXECUTABLE
NAMES
markdown
PATHS
"${MARKDOWN_ROOT_DIR}"
PATH_SUFFIXES
bin
NO_DEFAULT_PATH)
endif()
find_program(MARKDOWN_EXECUTABLE NAMES markdown)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Markdown
DEFAULT_MSG
MARKDOWN_EXECUTABLE)
if(MARKDOWN_FOUND)
mark_as_advanced(MARKDOWN_ROOT_DIR)
endif()
mark_as_advanced(MARKDOWN_EXECUTABLE)

View File

@ -0,0 +1,219 @@
# - try to find Oculus VR's SDK for Oculus Rift support
#
# Cache Variables: (probably not for direct use in your scripts)
# OVR_INCLUDE_DIR
# OVR_SOURCE_DIR
# OVR_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# OVR_FOUND
# OVR_INCLUDE_DIRS
# OVR_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2014 Kevin M. Godby <kevin@godby.org>
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(OVR_ROOT_DIR
"${OVR_ROOT_DIR}"
CACHE
PATH
"Directory to search for Oculus SDK")
# The OVR library is built in a directory tree that varies based on platform,
# architecture, and compiler.
#
# The libraries live in one of the following locations:
#
# Lib/Win32/VS2012/libovrd.lib
# Lib/Win32/VS2012/libovr.lib
# Lib/Win32/VS2013/libovrd.lib
# Lib/Win32/VS2013/libovr.lib
# Lib/Win32/VS2010/libovrd.lib
# Lib/Win32/VS2010/libovr.lib
# Lib/x64/VS2012/libovr64d.lib
# Lib/x64/VS2012/libovr64.lib
# Lib/x64/VS2013/libovr64d.lib
# Lib/x64/VS2013/libovr64.lib
# Lib/x64/VS2010/libovr64d.lib
# Lib/x64/VS2010/libovr64.lib
# Lib/Linux/Release/x86_64/libovr.a
# Lib/Linux/Debug/x86_64/libovr.a
# Lib/Linux/Release/i386/libovr.a
# Lib/Linux/Debug/i386/libovr.a
# Lib/Mac/Release/libovr.a
# Lib/Mac/Debug/libovr.a
set(OVR_LIBRARY_PATH_SUFFIX "Lib")
# Test compiler
if(MSVC10) # Microsoft Visual Studio 2010
set(_ovr_library_compiler "VS2010")
elseif(MSVC11) # Microsoft Visual Studio 2012
set(_ovr_library_compiler "VS2012")
elseif(MSVC12) # Microsoft Visual Studio 2013
set(_ovr_library_compiler "VS2013")
endif()
# Test 32/64 bits
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(_ovr_library_arch "x86_64")
if (WIN32)
set(_ovr_library_arch "x64")
set(_ovr_libname_bitsuffix "64")
endif(WIN32)
else()
set(_ovr_library_arch "i386")
if (WIN32)
set(_ovr_library_arch "Win32")
set(_ovr_libname_bitsuffix "")
endif(WIN32)
endif()
# Test platform
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(OVR_LIBRARY_PATH_SUFFIX_START "Lib/Linux") # needs build type and arch
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(OVR_LIBRARY_PATH_SUFFIX_START "Lib/Mac") # needs build type
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(OVR_LIBRARY_PATH_SUFFIX "Lib/${_ovr_library_arch}/${_ovr_library_compiler}")
endif()
find_library(OVR_LIBRARY_RELEASE
NAMES
ovr${_ovr_libname_bitsuffix}
libovr${_ovr_libname_bitsuffix}
PATHS
"${OVR_ROOT_DIR}"
"${OVR_ROOT_DIR}/LibOVR"
c:/tools/oculus-sdk.install/OculusSDK/LibOVR
PATH_SUFFIXES
${OVR_LIBRARY_PATH_SUFFIX}
${OVR_LIBRARY_PATH_SUFFIX_START}/Release
${OVR_LIBRARY_PATH_SUFFIX_START}/Release/${_ovr_library_arch})
find_library(OVR_LIBRARY_DEBUG
NAMES
ovr${_ovr_libname_bitsuffix}d
libovr${_ovr_libname_bitsuffix}d
PATHS
"${OVR_ROOT_DIR}"
"${OVR_ROOT_DIR}/LibOVR"
c:/tools/oculus-sdk.install/OculusSDK/LibOVR
PATH_SUFFIXES
${OVR_LIBRARY_PATH_SUFFIX}
${OVR_LIBRARY_PATH_SUFFIX_START}/Debug
${OVR_LIBRARY_PATH_SUFFIX_START}/Debug/${_ovr_library_arch})
include(SelectLibraryConfigurations)
select_library_configurations(OVR)
if(OVR_LIBRARY_RELEASE)
get_filename_component(_libdir "${OVR_LIBRARY_RELEASE}" PATH)
endif()
find_path(OVR_INCLUDE_DIR
NAMES
OVR.h
HINTS
"${_libdir}"
"${_libdir}/.."
"${_libdir}/../.."
"${_libdir}/../../.."
PATHS
"${OVR_ROOT_DIR}"
PATH_SUFFIXES
include
Include
)
find_path(OVR_SOURCE_DIR
NAMES
OVR_CAPI.h
HINTS
"${_libdir}"
"${_libdir}/.."
"${_libdir}/../.."
"${_libdir}/../../.."
PATHS
"${OVR_ROOT_DIR}"
PATH_SUFFIXES
Src
)
# Dependencies
set(_ovr_dependency_libraries "")
set(_ovr_dependency_includes "")
if(NOT OPENGL_FOUND)
find_package(OpenGL)
list(APPEND _ovr_dependency_libraries ${OPENGL_LIBRARIES})
list(APPEND _ovr_dependency_includes ${OPENGL_INCLUDE_DIR})
list(APPEND _ovr_dependencies OPENGL_FOUND)
endif()
if(NOT THREADS_FOUND)
find_package(Threads)
list(APPEND _ovr_dependency_libraries ${CMAKE_THREAD_LIBS_INIT})
list(APPEND _ovr_dependencies THREADS_FOUND)
endif()
# Linux-only dependencies
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(NOT X11_FOUND)
find_package(X11)
list(APPEND _ovr_dependency_libraries ${X11_LIBRARIES})
list(APPEND _ovr_dependency_includes ${X11_INCLUDE_DIR})
list(APPEND _ovr_dependencies X11_FOUND)
endif()
if(NOT XRANDR_FOUND)
find_package(Xrandr)
list(APPEND _ovr_dependency_libraries ${XRANDR_LIBRARIES})
list(APPEND _ovr_dependency_includes ${XRANDR_INCLUDE_DIR})
list(APPEND _ovr_dependencies XRANDR_FOUND)
endif()
if(NOT UDEV_FOUND)
find_package(udev)
list(APPEND _ovr_dependency_libraries ${UDEV_LIBRARIES})
list(APPEND _ovr_dependency_includes ${UDEV_INCLUDE_DIR})
list(APPEND _ovr_dependencies UDEV_FOUND)
endif()
endif()
if(WIN32)
#find_library(OVR_WINMM_LIBRARY winmm)
#find_library(OVR_WS2_LIBRARY ws2_32)
list(APPEND _ovr_dependency_libraries winmm ws2_32)#${OVR_WINMM_LIBRARY} ${OVR_WS2_LIBRARY})
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OVR
DEFAULT_MSG
OVR_LIBRARY
OVR_INCLUDE_DIR
OVR_SOURCE_DIR
${_ovr_dependencies}
)
if(OVR_FOUND)
set(OVR_LIBRARIES ${OVR_LIBRARY} ${_ovr_dependency_libraries})
set(OVR_INCLUDE_DIRS ${OVR_INCLUDE_DIR} ${OVR_SOURCE_DIR} ${_ovr_dependency_includes})
mark_as_advanced(OVR_ROOT_DIR)
endif()
mark_as_advanced(OVR_INCLUDE_DIR
OVR_SOURCE_DIR
OVR_LIBRARY
OVR_WINMM_LIBRARY
OVR_WS2_LIBRARY)

View File

@ -0,0 +1,245 @@
# - Try to find OpenCV library installation
# See http://sourceforge.net/projects/opencvlibrary/
#
# The following variable is optionally searched for defaults
# OPENCV_ROOT_DIR: Base directory of OpenCv tree to use.
#
# OPENCV_NEW_LIBRARY_NAMES Set to YES before searching if you want to
# The following are set after configuration is done:
# OPENCV_FOUND
# OPENCV_INCLUDE_DIRS
# OPENCV_LIBRARIES
#
# 2004/05 Jan Woetzel, Friso, Daniel Grest
# 2006/01 complete rewrite by Jan Woetzel
# 2006/09 2nd rewrite introducing ROOT_DIR and PATH_SUFFIXES
# to handle multiple installed versions gracefully by Jan Woetzel
# 2010/02 Ryan Pavlik (Iowa State University) - partial rewrite to standardize
#
# tested with:
# -OpenCV 0.97 (beta5a): MSVS 7.1, gcc 3.3, gcc 4.1
# -OpenCV 0.99 (1.0rc1): MSVS 7.1
#
# www.mip.informatik.uni-kiel.de/~jw
# academic.cleardefinition.com
# --------------------------------
set(OPENCV_ROOT_DIR
"${OPENCV_ROOT_DIR}"
CACHE
PATH
"Path to search for OpenCV")
find_package(OpenCV QUIET NO_MODULE)
if(OpenCV_LIBS AND NOT OpenCV_LIBRARIES)
set(OPENCV_LIBRARIES ${OpenCV_LIBS})
set(OPENCV_FOUND true)
else()
include(ProgramFilesGlob)
# typical root dirs of installations, exactly one of them is used
program_files_glob(_dirs "/OpenCV*/")
#
# select exactly ONE OPENCV base directory/tree
# to avoid mixing different version headers and libs
#
find_path(OPENCV_BASE_DIR
NAMES
cv/include/cv.h
include/opencv/cv.h
include/cv/cv.h
include/cv.h
HINTS
"${OPENCV_ROOT_DIR}"
"$ENV{OPENCV_ROOT_DIR}"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Intel(R) Open Source Computer Vision Library_is1;Inno Setup: App Path]"
${_dirs})
# header include dir suffixes appended to OPENCV_BASE_DIR
set(OPENCV_INCDIR_SUFFIXES
include
include/cv
include/opencv
cv/include
cxcore/include
cvaux/include
otherlibs/cvcam/include
otherlibs/highgui
otherlibs/highgui/include
otherlibs/_graphics/include)
# library linkdir suffixes appended to OPENCV_BASE_DIR
set(OPENCV_LIBDIR_SUFFIXES
lib
lib64
OpenCV/lib
otherlibs/_graphics/lib)
#
# find incdir for each lib
#
find_path(OPENCV_cv_INCLUDE_DIR
NAMES
cv.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_cxcore_INCLUDE_DIR
NAMES
cxcore.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_cxcore_INCLUDE_DIR
NAMES
cvaux.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_highgui_INCLUDE_DIR
NAMES
highgui.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_cvcam_INCLUDE_DIR
NAMES
cvcam.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
#
# find sbsolute path to all libraries
# some are optionally, some may not exist on Linux
#
find_library(OPENCV_legacy_LIBRARY
NAMES
opencv_legacy
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_LIBDIR_SUFFIXES})
set(OPENCV_NEW_COMPONENTS calib3d contrib core features2d highgui imgproc legacy ml objdetect video)
set(OPENCV_OLD_COMPONENTS cv cvaux cvcam cvhaartraining cxcore cxts highgui ml trs)
set(opencv_components)
if(OPENCV_NEW_LIBRARY_NAMES OR OPENCV_legacy_LIBRARY)
# New-style library names
foreach(component ${OPENCV_NEW_COMPONENTS})
find_library(OPENCV_${component}_LIBRARY
NAMES
opencv_${component}
HINTS
${OPENCV_BASE_DIR}
PATH_SUFFIXES
${OPENCV_LIBDIR_SUFFIXES})
endforeach()
# cv components with header and library if COMPONENTS unspecified
if(NOT OpenCV_FIND_COMPONENTS)
# default
set(opencv_components core legacy imgproc highgui)
if(WIN32)
list(APPEND opencv_components video) # WIN32 only actually
endif()
else()
# TODO: clean up/convert to new components
string(TOLOWER "${OpenCV_FIND_COMPONENTS}" opencv_components)
endif()
else()
# Old-style lib names
if(NOT OpenCV_FIND_COMPONENTS)
# default
set(opencv_components cv cxcore cvaux highgui)
if(WIN32)
list(APPEND opencv_components cvcam) # WIN32 only actually
endif()
else()
string(TOLOWER "${OpenCV_FIND_COMPONENTS}" opencv_components)
endif()
foreach(component ${OPENCV_OLD_COMPONENTS})
find_library(OPENCV_${component}_LIBRARY
NAMES
${component}
HINTS
${OPENCV_BASE_DIR}
PATH_SUFFIXES
${OPENCV_LIBDIR_SUFFIXES})
endforeach()
endif()
#
# Logic selecting required libs and headers
#
set(_req_check)
set(_req_libs)
set(_req_includes)
foreach(component ${opencv_components})
#message(STATUS "Component requested: ${component}")
# only good if header and library both found
list(APPEND
_req_check
OPENCV_${component}_LIBRARY)
list(APPEND _req_libs "${OPENCV_${component}_LIBRARY}")
if(DEFINED OPENCV_${component}_INCLUDE_DIR)
list(APPEND
_req_check
OPENCV_${component}_INCLUDE_DIR)
list(APPEND _req_includes "${OPENCV_${component}_INCLUDE_DIR}")
endif()
endforeach()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenCV
DEFAULT_MSG
OPENCV_cv_INCLUDE_DIR
${_req_check})
if(OPENCV_FOUND)
set(OPENCV_LIBRARY_DIRS)
foreach(lib ${_req_libs})
get_filename_component(dir "${lib}" PATH)
list(APPEND OPENCV_LIBRARY_DIRS "${dir}")
endforeach()
list(REVERSE OPENCV_LIBRARY_DIRS)
list(REMOVE_DUPLICATES OPENCV_LIBRARY_DIRS)
list(REVERSE OPENCV_LIBRARY_DIRS)
set(OPENCV_INCLUDE_DIRS ${_req_includes})
set(OPENCV_LIBRARIES ${_req_libs})
mark_as_advanced(OPENCV_ROOT_DIR OpenCV_DIR)
endif()
mark_as_advanced(OPENCV_BASE_DIR)
foreach(component ${OPENCV_NEW_COMPONENTS} ${OPENCV_OLD_COMPONENTS})
mark_as_advanced(OPENCV_${component}_LIBRARY OPENCV_${component}_INCLUDE_DIR)
endforeach()
endif()

View File

@ -0,0 +1,481 @@
# - try to find OpenHaptics libraries
#
# Cache Variables: (probably not for direct use in your scripts)
# HDAPI_INCLUDE_DIR
# HDAPI_LIBRARY
# HDAPI_LIBRARY_RELEASE
# HDAPI_LIBRARY_DEBUG
# HDAPI_HDU_INCLUDE_DIR
# HDAPI_HDU_LIBRARY
# HDAPI_HDU_LIBRARY_RELEASE
# HDAPI_HDU_LIBRARY_DEBUG
# HLAPI_INCLUDE_DIR
# HLAPI_LIBRARY
# HLAPI_LIBRARY_RELEASE
# HLAPI_LIBRARY_DEBUG
# HLAPI_HLU_INCLUDE_DIR
# HLAPI_HLU_LIBRARY
# HLAPI_HLU_LIBRARY_RELEASE
# HLAPI_HLU_LIBRARY_DEBUG
#
# Non-cache variables you might use in your CMakeLists.txt:
# OPENHAPTICS_FOUND
# HDAPI_INCLUDE_DIRS
# HDAPI_LIBRARIES
# HDAPI_HDU_INCLUDE_DIRS
# HDAPI_HDU_LIBRARIES
# HLAPI_INCLUDE_DIRS
# HLAPI_LIBRARIES
# HLAPI_HLU_INCLUDE_DIRS
# HLAPI_HLU_LIBRARIES
# OPENHAPTICS_LIBRARIES - includes HD, HDU, HL, HLU
# OPENHAPTICS_RUNTIME_LIBRARY_DIRS
# OPENHAPTICS_ENVIRONMENT
# OPENHAPTICS_LIBRARY_DIRS
# OPENHAPTICS_INCLUDE_DIRS
#
# Requires these CMake modules:
# CleanDirectoryList
# CleanLibraryList
# ListCombinations
# ProgramFilesGlob
# SelectLibraryConfigurations (included with CMake >=2.8.0)
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
# CMake 2.6.3 (uses "unset")
#
# Original Author:
# 2009-2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
cmake_minimum_required(VERSION 2.6.3)
set(OPENHAPTICS_ROOT_DIR
"${OPENHAPTICS_ROOT_DIR}"
CACHE
PATH
"Path to search for OpenHaptics")
option(OPENHAPTICS_NESTED_TARGETS
"Whether we should compile HDU and HLU, if needed, as a part of the solution"
ON)
mark_as_advanced(OPENHAPTICS_NESTED_TARGETS)
###
# Configure OpenHaptics
###
include(SelectLibraryConfigurations)
include(ListCombinations)
include(CleanDirectoryList)
include(CleanLibraryList)
include(ProgramFilesGlob)
set(_nest_targets)
set(_incsearchdirs)
set(_libsearchdirs)
set(OPENHAPTICS_ENVIRONMENT)
set(OPENHAPTICS_RUNTIME_LIBRARY_DIRS)
set(_dirs)
if(NOT "$ENV{OH_SDK_BASE}" STREQUAL "")
list(APPEND _dirs "$ENV{OH_SDK_BASE}")
elseif(NOT "$ENV{3DTOUCH_BASE}" STREQUAL "")
list(APPEND _dirs "$ENV{3DTOUCH_BASE}")
endif()
if(WIN32)
program_files_fallback_glob(_pfdirs "/Sensable/3DTouch*/")
foreach(_OH_DEFAULT_LOCATION "C:/OpenHaptics/3.1" "C:/OpenHaptics/Academic/3.1")
if(EXISTS "${_OH_DEFAULT_LOCATION}")
list(APPEND _dirs "${_OH_DEFAULT_LOCATION}")
endif()
endforeach()
set(_dirs "${_dirs};${_pfdirs}")
if(MSVC60)
set(_vc "vc6")
elseif(MSVC70 OR MSVC71)
set(_vc "vc7")
elseif(MSVC80)
set(_vc "vc8")
endif()
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
# 64-bit
list_combinations(_libsearch
PREFIXES
"${OPENHAPTICS_ROOT_DIR}"
${_dirs}
SUFFIXES
"/lib/x64")
list_combinations(_libsearch2
PREFIXES
"${OPENHAPTICS_ROOT_DIR}"
${_dirs}
SUFFIXES
"/utilities/lib/x64")
else()
# 32-bit
list_combinations(_libsearch
PREFIXES
"${OPENHAPTICS_ROOT_DIR}"
${_dirs}
SUFFIXES
"/lib"
"/lib/win32")
list_combinations(_libsearch2
PREFIXES
"${OPENHAPTICS_ROOT_DIR}"
${_dirs}
SUFFIXES
"/utilities/lib/Win32"
"/utilities/lib"
"/utilities/lib/${_vc}")
endif()
clean_directory_list(_libsearchdirs ${_libsearch} ${_libsearch2})
endif()
list_combinations(_incsearch
PREFIXES
"${OPENHAPTICS_ROOT_DIR}"
${_dirs}
SUFFIXES
"/include")
list_combinations(_incsearch2
PREFIXES
"${OPENHAPTICS_ROOT_DIR}"
${_dirs}
SUFFIXES
"/utilities/include")
clean_directory_list(_incsearchdirs ${_incsearch} ${_incsearch2})
set(_deps_check)
set(_deps_libs)
###
# HDAPI: HD
###
if(UNIX)
find_library(HDAPI_PHANToMIO_LIBRARY
NAMES
PHANToMIO
HINTS
${_libsearchdirs})
mark_as_advanced(HDAPI_PHANToMIO_LIBRARY)
list(APPEND _deps_check HDAPI_PHANToMIO_LIBRARY)
list(APPEND _deps_libs "${HDAPI_PHANToMIO_LIBRARY}")
endif()
find_path(HDAPI_INCLUDE_DIR
NAMES
HD/hd.h
HINTS
${_incsearchdirs})
find_library(HDAPI_LIBRARY_RELEASE
NAMES
HD
PATH_SUFFIXES
ReleaseAcademicEdition
Release
HINTS
${_libsearchdirs})
find_library(HDAPI_LIBRARY_DEBUG
NAMES
HD
PATH_SUFFIXES
DebugAcademicEdition
Debug
HINTS
${_libsearchdirs})
select_library_configurations(HDAPI)
###
# HDAPI: HDU
###
find_path(HDAPI_HDU_INCLUDE_DIR
NAMES
HDU/hdu.h
HINTS
${_incsearchdirs})
find_library(HDAPI_HDU_LIBRARY_RELEASE
NAMES
HDU
PATH_SUFFIXES
ReleaseAcademicEdition
Release
HINTS
${_libsearchdirs})
find_library(HDAPI_HDU_LIBRARY_DEBUG
NAMES
HDU
PATH_SUFFIXES
DebugAcademicEdition
Debug
HINTS
${_libsearchdirs})
# Fallback
find_library(HDAPI_HDU_LIBRARY_DEBUG
NAMES
HDUD
PATH_SUFFIXES
DebugAcademicEdition
Debug
HINTS
${_libsearchdirs})
select_library_configurations(HDAPI_HDU)
if(OPENHAPTICS_NESTED_TARGETS OR NOT HDAPI_HDU_LIBRARY)
if(HDAPI_HDU_SOURCE_DIR AND NOT EXISTS "${HDAPI_HDU_SOURCE_DIR}/hdu.cpp")
unset(HDAPI_HDU_SOURCE_DIR)
endif()
find_path(HDAPI_HDU_SOURCE_DIR
NAMES
hdu.cpp
PATH_SUFFIXES
src
src/HDU
src/HDU/src
libsrc/HDU
HINTS
"${HDAPI_HDU_INCLUDE_DIR}/.."
"${HDAPI_HDU_INCLUDE_DIR}/../share/3DTouch")
list(APPEND _deps_check HDAPI_HDU_SOURCE_DIR)
if(HDAPI_HDU_SOURCE_DIR)
mark_as_advanced(HDAPI_HDU_SOURCE_DIR)
set(_nest_targets YES)
set(HDAPI_HDU_LIBRARY
"openhaptics_hdu_nested_target"
CACHE
STRING
"We will build the OpenHaptics HDU lib."
FORCE)
set(HDAPI_HDU_LIBRARIES ${HDAPI_HDU_LIBRARY})
endif()
endif()
###
# HLAPI: HL
###
find_path(HLAPI_INCLUDE_DIR
NAMES
HL/hl.h
HINTS
${_incsearchdirs})
find_library(HLAPI_LIBRARY_RELEASE
NAMES
HL
PATH_SUFFIXES
ReleaseAcademicEdition
Release
HINTS
${_libsearchdirs})
find_library(HLAPI_LIBRARY_DEBUG
NAMES
HL
PATH_SUFFIXES
DebugAcademicEdition
Debug
HINTS
${_libsearchdirs})
select_library_configurations(HLAPI)
###
# HLAPI: HLU
###
find_path(HLAPI_HLU_INCLUDE_DIR
NAMES
HLU/hlu.h
HINTS
${_incsearchdirs})
find_library(HLAPI_HLU_LIBRARY_RELEASE
NAMES
HLU
PATH_SUFFIXES
ReleaseAcademicEdition
Release
HINTS
${_libsearchdirs})
find_library(HLAPI_HLU_LIBRARY_DEBUG
NAMES
HLU
PATH_SUFFIXES
DebugAcademicEdition
Debug
HINTS
${_libsearchdirs})
# fallback
find_library(HLAPI_HLU_LIBRARY_DEBUG
NAMES
HLUD
PATH_SUFFIXES
DebugAcademicEdition
Debug
HINTS
${_libsearchdirs})
select_library_configurations(HLAPI_HLU)
if(OPENHAPTICS_NESTED_TARGETS OR NOT HLAPI_HLU_LIBRARY)
if(HLAPI_HLU_SOURCE_DIR AND NOT EXISTS "${HLAPI_HLU_SOURCE_DIR}/hlu.cpp")
unset(HLAPI_HLU_SOURCE_DIR)
endif()
find_path(HLAPI_HLU_SOURCE_DIR
NAMES
hlu.cpp
PATH_SUFFIXES
src
src/HLU
src/HLU/src
libsrc/HLU
HINTS
"${HLAPI_HLU_INCLUDE_DIR}/.."
"${HLAPI_HLU_INCLUDE_DIR}/../share/3DTouch")
list(APPEND _deps_check HLAPI_HLU_SOURCE_DIR)
if(HLAPI_HLU_SOURCE_DIR)
mark_as_advanced(HLAPI_HLU_SOURCE_DIR)
set(_nest_targets YES)
set(HLAPI_HLU_LIBRARY
"openhaptics_hlu_nested_target"
CACHE
STRING
"We will build the OpenHaptics HLU lib."
FORCE)
set(HLAPI_HLU_LIBRARIES ${HLAPI_HLU_LIBRARY})
endif()
endif()
###
# Add dependencies: Libraries
###
set(HDAPI_LIBRARIES "${HDAPI_LIBRARY}" ${_deps_libs})
if(HDAPI_HDU_LIBRARIES AND HDAPI_LIBRARIES)
list(APPEND HDAPI_HDU_LIBRARIES ${HDAPI_LIBRARIES})
else()
set(HDAPI_HDU_LIBRARIES)
endif()
if(HLAPI_LIBRARY AND HDAPI_LIBRARIES)
set(HLAPI_LIBRARIES ${HLAPI_LIBRARY} ${HDAPI_LIBRARIES})
else()
set(HLAPI_LIBRARIES)
endif()
if(HLAPI_HLU_LIBRARIES AND HLAPI_LIBRARIES)
list(APPEND HLAPI_HLU_LIBRARIES ${HLAPI_LIBRARIES})
else()
set(HLAPI_HLU_LIBRARIES)
endif()
###
# Add dependencies: Include dirs
###
if(HDAPI_INCLUDE_DIR)
set(HDAPI_INCLUDE_DIRS ${HDAPI_INCLUDE_DIR})
if(HDAPI_HDU_INCLUDE_DIR)
set(HDAPI_HDU_INCLUDE_DIRS
${HDAPI_INCLUDE_DIRS}
${HDAPI_HDU_INCLUDE_DIR})
if(HDAPI_HDU_INCLUDE_DIR)
set(HLAPI_INCLUDE_DIRS ${HDAPI_INCLUDE_DIRS} ${HLAPI_INCLUDE_DIR})
if(HLAPI_HLU_INCLUDE_DIR)
set(HLAPI_HLU_INCLUDE_DIRS
${HLAPI_INCLUDE_DIRS}
${HLAPI_HLU_INCLUDE_DIR})
endif()
endif()
endif()
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenHaptics
DEFAULT_MSG
HDAPI_LIBRARY
HDAPI_INCLUDE_DIR
HDAPI_HDU_INCLUDE_DIR
HDAPI_HDU_LIBRARY
HLAPI_INCLUDE_DIR
HLAPI_LIBRARY
HLAPI_HLU_INCLUDE_DIR
HLAPI_HLU_LIBRARY
${_deps_check})
if(OPENHAPTICS_FOUND)
# Recurse into the nested targets subdirectory if needed
if(_nest_targets)
get_filename_component(_moddir "${CMAKE_CURRENT_LIST_FILE}" PATH)
add_subdirectory("${_moddir}/nested_targets/OpenHaptics" "OpenHapticsNestedTargets")
endif()
set(OPENHAPTICS_LIBRARIES
${HDAPI_LIBRARY}
${HDAPI_HDU_LIBRARY}
${HLAPI_LIBRARY}
${HLAPI_HLU_LIBRARY})
set(OPENHAPTICS_LIBRARY_DIRS)
foreach(_lib
${_deps_check}
HDAPI_LIBRARY_RELEASE
HDAPI_LIBRARY_DEBUG
HDAPI_HDU_LIBRARY_RELEASE
HDAPI_HDU_LIBRARY_DEBUG
HLAPI_LIBRARY_RELEASE
HLAPI_LIBRARY_DEBUG
HLAPI_HLU_LIBRARY_RELEASE
HLAPI_HLU_LIBRARY_DEBUG)
get_filename_component(_libdir ${${_lib}} PATH)
list(APPEND OPENHAPTICS_LIBRARY_DIRS ${_libdir})
endforeach()
set(OPENHAPTICS_INCLUDE_DIRS
${HLAPI_HLU_INCLUDE_DIRS}
${HDAPI_HDU_INCLUDE_DIRS})
clean_directory_list(OPENHAPTICS_LIBRARY_DIRS)
clean_directory_list(OPENHAPTICS_INCLUDE_DIRS)
list(APPEND
OPENHAPTICS_RUNTIME_LIBRARY_DIRS
${OPENHAPTICS_LIBRARY_DIRS})
clean_library_list(OPENHAPTICS_LIBRARIES)
mark_as_advanced(OPENHAPTICS_ROOT_DIR)
endif()
mark_as_advanced(HDAPI_INCLUDE_DIR
HDAPI_LIBRARY_RELEASE
HDAPI_LIBRARY_DEBUG
HDAPI_HDU_INCLUDE_DIR
HDAPI_HDU_LIBRARY_RELEASE
HDAPI_HDU_LIBRARY_DEBUG
HLAPI_INCLUDE_DIR
HLAPI_LIBRARY_RELEASE
HLAPI_LIBRARY_DEBUG
HLAPI_HLU_INCLUDE_DIR
HLAPI_HLU_LIBRARY_RELEASE
HLAPI_HLU_LIBRARY_DEBUG)

View File

@ -0,0 +1,305 @@
# - try to find PARASOLID library
# Important note: If you are also using JtTk, do your
# find_package(JtTk)
# first, to avoid runtime PK_* errors!
#
# PARASOLID_LIBRARY_DIR, library search path
# PARASOLID_INCLUDE_DIR, include search path
# PARASOLID_{component}_LIBRARY, the library to link against
# PARASOLID_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Requires these CMake modules:
# CheckVersion
# ListCombinations
# ProgramFilesGlob
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
include(ListCombinations)
include(CheckVersion)
include(PrefixListGlob)
include(CleanDirectoryList)
if(WIN32)
include(ProgramFilesGlob)
endif()
set(PARASOLID_ROOT_DIR
"${PARASOLID_ROOT_DIR}"
CACHE
PATH
"Root directory to search for Parasolid")
file(TO_CMAKE_PATH "${PARASOLID_ROOT_DIR}" PARASOLID_ROOT_DIR)
# Do this by default
if(NOT DEFINED PARASOLID_NESTED_TARGETS)
set(PARASOLID_NESTED_TARGETS TRUE)
endif()
set(PARASOLID_NESTED_TARGETS
"${PARASOLID_NESTED_TARGETS}"
CACHE
BOOL
"Whether we should compile fg and frustrum as a part of the solution")
mark_as_advanced(PARASOLID_NESTED_TARGETS)
set(_nest_targets)
###
# Configure Parasolid
###
string(TOLOWER "${CMAKE_SYSTEM_NAME}" _lcsystem)
set(libsearchdirs)
if(WIN32)
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
# 64-bit
program_files_fallback_glob(dirs "/Parasolid*/kernel/x64_win/base")
program_files_fallback_glob(dirs2 "/Parasolid/kernel/*/x64_win/base")
list(APPEND dirs ${dirs2})
else()
# 32-bit
program_files_glob(dirs "/Parasolid*/kernel/intel_nt/base")
program_files_fallback_glob(dirs2 "/Parasolid/kernel/*/intel_nt/base")
list(APPEND dirs ${dirs2})
endif()
list_combinations(libsearchdirs
PREFIXES
${dirs}
"${PARASOLID_ROOT_DIR}"
SUFFIXES
"/dll")
list(APPEND libsearchdirs ${dirs} "${PARASOLID_ROOT_DIR}")
elseif("${_lcsystem}" MATCHES "linux")
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
# 64-bit
prefix_list_glob(libsearchdirs
"/Parasolid*/kernel/intel_linux/base_lx64"
"${PARASOLID_ROOT_DIR}"
"/usr"
"/usr/local"
"/usr/local/ugs")
else()
# 32-bit
prefix_list_glob(libsearchdirs
"/Parasolid*/kernel/intel_linux/base_lx32"
"${PARASOLID_ROOT_DIR}"
"/usr"
"/usr/local"
"/usr/local/ugs")
endif()
endif()
###
# Find the link library
###
find_library(PARASOLID_pskernel_LIBRARY
NAMES
pskernel
PATH_SUFFIXES
dll
shared_object
HINTS
${libsearchdirs}
PATHS
"${PARASOLID_ROOT_DIR}")
# Don't add this library to the default list of libraries
find_library(PARASOLID_pskernel_archive_LIBRARY
NAMES
pskernel_archive
pskernel_archive.lib
HINTS
${libsearchdirs}
PATHS
"${PARASOLID_ROOT_DIR}")
mark_as_advanced(PARASOLID_pskernel_archive_LIBRARY)
###
# Prepare for the rest of our search based off of where we found the link library
###
get_filename_component(PARASOLID_LIBRARY_DIR
"${PARASOLID_pskernel_LIBRARY}"
PATH)
# Setup include search path
get_filename_component(_includedir
"${PARASOLID_LIBRARY_DIR}/../include"
ABSOLUTE)
get_filename_component(_includedir2
"${PARASOLID_LIBRARY_DIR}/.."
ABSOLUTE)
set(includesearchdirs
"${PARASOLID_LIBRARY_DIR}"
"${_includedir}"
"${_includedir2}")
clean_directory_list(includesearchdirs)
###
# Find the headers
###
find_path(PARASOLID_INCLUDE_DIR
NAMES
parasolid_kernel.h
HINTS
${includesearchdirs}
PATHS
"${PARASOLID_ROOT_DIR}")
###
# Find remaining libs
###
# Default libs
foreach(lib fg frustrum)
find_library(PARASOLID_${lib}_LIBRARY
NAMES
${lib}
PATH_SUFFIXES
dll
HINTS
"${PARASOLID_LIBRARY_DIR}"
${libsearchdirs}
PATHS
"${PARASOLID_ROOT_DIR}")
endforeach()
if(PARASOLID_pskernel_LIBRARY OR PARASOLID_INCLUDE_DIR)
get_filename_component(_libdir "${PARASOLID_pskernel_LIBRARY}" PATH)
get_filename_component(_incdir "${PARASOLID_INCLUDE_DIR}" PATH)
if(PARASOLID_NESTED_TARGETS OR NOT PARASOLID_fg_LIBRARY)
find_file(PARASOLID_FG_C
NAMES
fg.c
HINTS
"${_libdir}"
"${_libdir}/.."
"${_incdir}")
if(PARASOLID_FG_C)
mark_as_advanced(PARASOLID_FG_C)
set(_nest_targets YES)
set(PARASOLID_fg_LIBRARY
"parasolid_fg_nested_target"
CACHE
STRING
"We will build the Parasolid fg lib."
FORCE)
endif()
endif()
if(PARASOLID_NESTED_TARGETS OR NOT PARASOLID_frustrum_LIBRARY)
find_file(PARASOLID_FRUSTRUM_C
NAMES
frustrum.c
HINTS
"${_libdir}"
"${_libdir}/.."
"${_incdir}")
if(PARASOLID_FRUSTRUM_C)
mark_as_advanced(PARASOLID_FRUSTRUM_C)
set(_nest_targets YES)
set(PARASOLID_frustrum_LIBRARY
"parasolid_frustrum_nested_target"
CACHE
STRING
"We will build the Parasolid frustrum lib."
FORCE)
endif()
endif()
endif()
# Non-default libs
foreach(lib testfr)
find_library(PARASOLID_${lib}_LIBRARY
NAMES
${lib}
PATH_SUFFIXES
dll
HINTS
${PARASOLID_LIBRARY_DIR}
${libsearchdirs}
PATHS
"${PARASOLID_ROOT_DIR}")
mark_as_advanced(PARASOLID_${lib}_LIBRARY)
endforeach()
###
# Find the DLL's
###
if(JTTK_FOUND AND JTTK_pskernel_DLL)
# If we have JtTk, must use the dll there or we'll have weird runtime errors
# in parasolid
set(PARASOLID_pskernel_DLL "${JTTK_pskernel_DLL}")
else()
# Find the unversioned DLL
set(dll pskernel)
find_file(PARASOLID_${dll}_DLL
NAMES
${dll}.dll
PATH_SUFFIXES
dll
HINTS
${PARASOLID_LIBRARY_DIR}
${libsearchdirs}
PATHS
"${PARASOLID_ROOT_DIR}")
list(APPEND PARASOLID_DLLS ${PARASOLID_${dll}_DLL})
mark_as_advanced(PARASOLID_${dll}_DLL)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Parasolid
DEFAULT_MSG
PARASOLID_pskernel_LIBRARY
PARASOLID_fg_LIBRARY
PARASOLID_frustrum_LIBRARY
PARASOLID_INCLUDE_DIR)
if(PARASOLID_FOUND)
# Recurse into the nested targets subdirectory if needed
if(_nest_targets)
get_filename_component(_moddir "${CMAKE_CURRENT_LIST_FILE}" PATH)
add_subdirectory("${_moddir}/nested_targets/Parasolid")
endif()
set(PARASOLID_INCLUDE_DIRS "${PARASOLID_INCLUDE_DIR}")
set(PARASOLID_LIBRARIES
"${PARASOLID_pskernel_LIBRARY}"
"${PARASOLID_fg_LIBRARY}"
"${PARASOLID_frustrum_LIBRARY}")
if(PARASOLID_pskernel_DLL)
get_filename_component(PARASOLID_RUNTIME_LIBRARY_DIRS
"${PARASOLID_pskernel_DLL}"
PATH)
endif()
mark_as_advanced(PARASOLID_ROOT_DIR)
endif()
mark_as_advanced(PARASOLID_pskernel_LIBRARY
PARASOLID_pskernel_archive_LIBRARY
PARASOLID_fg_LIBRARY
PARASOLID_frustrum_LIBRARY
PARASOLID_INCLUDE_DIR
PARASOLID_FRUSTRUM_C
PARASOLID_FG_C)

View File

@ -0,0 +1,153 @@
# - try to find the OpenGL Performer library
#
# Users may optionally supply:
# PERFORMER_ROOT_DIR - a prefix to start searching.
#
# Cache Variables: (probably not for direct use in your scripts)
# PERFORMER_INCLUDE_DIR
# PERFORMER_LIBRARY
# PERFORMER_PFUI_LIBRARY - doesn't get included in PERFORMER_LIBRARIES
# PERFORMER_PFDU_UTIL_LIBRARY - doesn't get included in PERFORMER_LIBRARIES
# PERFORMER_PFV_LIBRARY - doesn't get included in PERFORMER_LIBRARIES
#
# Non-cache variables you might use in your CMakeLists.txt:
# PERFORMER_FOUND
# PERFORMER_INCLUDE_DIRS
# PERFORMER_LIBRARIES
# PERFORMER_RUNTIME_LIBRARY_DIRS
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(PERFORMER_ROOT_DIR
"${PERFORMER_ROOT_DIR}"
CACHE
PATH
"Path to search for OpenGL Performer library")
find_path(PERFORMER_INCLUDE_DIR
NAMES
pf.h
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
include
include/Performer
Performer
PATHS
$ENV{PFROOT})
mark_as_advanced(PERFORMER_INCLUDE_DIR)
if(WIN32)
set(_pf_libnameprefix lib)
find_library(PERFORMER_PFDU_UTIL_LIBRARY
NAMES
libpfdu-util
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
else()
set(_pf_libnameprefix)
find_library(PERFORMER_PFDU_LIBRARY
NAMES
pfdu
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
find_library(PERFORMER_PFUTIL_LIBRARY
NAMES
pfutil
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
if(PERFORMER_PFDU_LIBRARY AND PERFORMER_PFUTIL_LIBRARY)
set(PERFORMER_PFDU_UTIL_LIBRARY
${PERFORMER_PFDU_LIBRARY}
${PERFORMER_PFUTIL_LIBRARY})
endif()
endif()
find_library(PERFORMER_LIBRARY
NAMES
${_pf_libnameprefix}pf
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
find_library(PERFORMER_PFUI_LIBRARY
NAMES
${_pf_libnameprefix}pfui
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
find_library(PERFORMER_PFV_LIBRARY
NAMES
${_pf_libnameprefix}pfv
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
###
# Prereq: OpenGL
###
find_package(OpenGL QUIET)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Performer
DEFAULT_MSG
PERFORMER_LIBRARY
PERFORMER_PFUI_LIBRARY
PERFORMER_PFV_LIBRARY
PERFORMER_PFDU_UTIL_LIBRARY
PERFORMER_INCLUDE_DIR
OPENGL_FOUND)
if(PERFORMER_FOUND)
set(PERFORMER_INCLUDE_DIRS
"${OPENGL_INCLUDE_DIR}"
"${PERFORMER_INCLUDE_DIR}")
if(PERFORMER_INCLUDE_DIR MATCHES ".*Performer.*")
list(APPEND PERFORMER_INCLUDE_DIRS "${PERFORMER_INCLUDE_DIR}/..")
endif()
set(PERFORMER_LIBRARIES "${OPENGL_LIBRARY}" "${PERFORMER_LIBRARY}")
mark_as_advanced(PERFORMER_ROOT_DIR)
endif()
mark_as_advanced(PERFORMER_LIBRARY
PERFORMER_PFUI_LIBRARY
PERFORMER_PFV_LIBRARY
PERFORMER_PFDU_LIBRARY
PERFORMER_PFUTIL_LIBRARY
PERFORMER_PFDU_UTIL_LIBRARY
PERFORMER_INCLUDE_DIR)

View File

@ -0,0 +1,78 @@
# - try to find perl modules, passed as COMPONENTS
#
# Non-cache variable you might use in your CMakeLists.txt:
# PERLMODULES_FOUND
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(NOT PERL_FOUND)
find_package(Perl QUIET)
endif()
set(_deps_check)
if(PERL_FOUND)
foreach(module ${PerlModules_FIND_COMPONENTS})
string(REPLACE "::" "/" modfilename "${module}.pm")
string(REPLACE "::" "_" modvarname "PERLMODULES_${module}_MODULE")
string(TOUPPER "${modvarname}" modvarname)
list(APPEND _deps_check ${modvarname})
if(NOT ${modvarname})
if(NOT PerlModules_FIND_QUIETLY)
message(STATUS "Checking for perl module ${module}")
endif()
execute_process(COMMAND
"${PERL_EXECUTABLE}"
"-e"
"use ${module}; print \$INC{\"${modfilename}\"}"
RESULT_VARIABLE result_code
OUTPUT_VARIABLE filename
ERROR_VARIABLE error_info
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(result_code EQUAL 0)
if(NOT PerlModules_FIND_QUIETLY)
message(STATUS
"Checking for perl module ${module} - found at ${filename}")
endif()
set(${modvarname}
"${filename}"
CACHE
FILEPATH
"Location found for module ${module}"
FORCE)
mark_as_advanced(${modvarname})
else()
if(NOT PerlModules_FIND_QUIETLY)
message(STATUS "Checking for perl module ${module} - failed")
endif()
set(${modvarname}
"NOTFOUND"
CACHE
FILEPATH
"No location found for module ${module}"
FORCE)
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Perl module ${module} exists failed with the following error output:\n"
"${error_info}\n\n")
endif()
endif()
endforeach()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PerlModules
DEFAULT_MSG
PERL_FOUND
${_deps_check})

View File

@ -0,0 +1,81 @@
# - try to find QVRPN library
#
# Of course, you may also just choose to make QVRPN a submodule of your
# project itself.
#
# Cache Variables:
# QVRPN_LIBRARY
# QVRPN_INCLUDE_DIR
#
# Non-cache variables you might use in your CMakeLists.txt:
# QVRPN_FOUND
# QVRPN_LIBRARIES
# QVRPN_INCLUDE_DIRS
#
# QVRPN_ROOT_DIR is searched preferentially for these files
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Refactored from FindVRPN.cmake by:
# Juan Sebastian Casallas <casallas@iastate.edu>
#
# FindVRPN.cmake Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(QVRPN_ROOT_DIR
"${QVRPN_ROOT_DIR}"
CACHE
PATH
"Root directory to search for QVRPN")
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(_LIBSUFFIXES /lib64 /lib)
else()
set(_LIBSUFFIXES /lib)
endif()
###
# Configure QVRPN
###
find_path(QVRPN_INCLUDE_DIR
NAMES
vrpn_QMainloopContainer.h
PATH_SUFFIXES
include
include/qvrpn
HINTS
"${QVRPN_ROOT_DIR}")
find_library(QVRPN_LIBRARY
NAMES
qvrpn
PATH_SUFFIXES
${_libsuffixes}
HINTS
"${QVRPN_ROOT_DIR}")
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QVRPN
DEFAULT_MSG
QVRPN_LIBRARY
QVRPN_INCLUDE_DIR)
if(QVRPN_FOUND)
set(QVRPN_INCLUDE_DIRS "${QVRPN_INCLUDE_DIR}")
set(QVRPN_LIBRARIES "${QVRPN_LIBRARY}")
mark_as_advanced(QVRPN_ROOT_DIR)
endif()
mark_as_advanced(QVRPN_LIBRARY QVRPN_INCLUDE_DIR)

View File

@ -0,0 +1,249 @@
# - Find SDL2
# Find the SDL2 headers and libraries
#
# SDL2::SDL2 - Imported target to use for building a library
# SDL2::SDL2main - Imported interface target to use if you want SDL and SDLmain.
# SDL2_FOUND - True if SDL2 was found.
# SDL2_DYNAMIC - If we found a DLL version of SDL (meaning you might want to copy a DLL from SDL2::SDL2)
#
# Original Author:
# 2015 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
#
# Copyright Sensics, Inc. 2015.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Set up architectures (for windows) and prefixes (for mingw builds)
if(WIN32)
if(MINGW)
include(MinGWSearchPathExtras OPTIONAL)
if(MINGWSEARCH_TARGET_TRIPLE)
set(SDL2_PREFIX ${MINGWSEARCH_TARGET_TRIPLE})
endif()
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(SDL2_LIB_PATH_SUFFIX lib/x64)
if(NOT MSVC AND NOT SDL2_PREFIX)
set(SDL2_PREFIX x86_64-w64-mingw32)
endif()
else()
set(SDL2_LIB_PATH_SUFFIX lib/x86)
if(NOT MSVC AND NOT SDL2_PREFIX)
set(SDL2_PREFIX i686-w64-mingw32)
endif()
endif()
endif()
if(SDL2_PREFIX)
set(SDL2_ORIGPREFIXPATH ${CMAKE_PREFIX_PATH})
if(SDL2_ROOT_DIR)
list(APPEND CMAKE_PREFIX_PATH "${SDL2_ROOT_DIR}")
endif()
if(CMAKE_PREFIX_PATH)
foreach(_prefix ${CMAKE_PREFIX_PATH})
list(APPEND CMAKE_PREFIX_PATH "${_prefix}/${SDL2_PREFIX}")
endforeach()
endif()
if(MINGWSEARCH_PREFIXES)
list(APPEND CMAKE_PREFIX_PATH ${MINGWSEARCH_PREFIXES})
endif()
endif()
# Invoke pkgconfig for hints
find_package(PkgConfig QUIET)
set(SDL2_INCLUDE_HINTS)
set(SDL2_LIB_HINTS)
if(PKG_CONFIG_FOUND)
pkg_search_module(SDL2PC QUIET sdl2)
if(SDL2PC_INCLUDE_DIRS)
set(SDL2_INCLUDE_HINTS ${SDL2PC_INCLUDE_DIRS})
endif()
if(SDL2PC_LIBRARY_DIRS)
set(SDL2_LIB_HINTS ${SDL2PC_LIBRARY_DIRS})
endif()
endif()
include(FindPackageHandleStandardArgs)
find_library(SDL2_LIBRARY
NAMES
SDL2
HINTS
${SDL2_LIB_HINTS}
PATHS
${SDL2_ROOT_DIR}
ENV SDL2DIR
PATH_SUFFIXES lib SDL2 ${SDL2_LIB_PATH_SUFFIX})
set(_sdl2_framework FALSE)
# Some special-casing if we've found/been given a framework.
# Handles whether we're given the library inside the framework or the framework itself.
if(APPLE AND "${SDL2_LIBRARY}" MATCHES "(/[^/]+)*.framework(/.*)?$")
set(_sdl2_framework TRUE)
set(SDL2_FRAMEWORK "${SDL2_LIBRARY}")
# Move up in the directory tree as required to get the framework directory.
while("${SDL2_FRAMEWORK}" MATCHES "(/[^/]+)*.framework(/.*)$" AND NOT "${SDL2_FRAMEWORK}" MATCHES "(/[^/]+)*.framework$")
get_filename_component(SDL2_FRAMEWORK "${SDL2_FRAMEWORK}" DIRECTORY)
endwhile()
if("${SDL2_FRAMEWORK}" MATCHES "(/[^/]+)*.framework$")
set(SDL2_FRAMEWORK_NAME ${CMAKE_MATCH_1})
# If we found a framework, do a search for the header ahead of time that will be more likely to get the framework header.
find_path(SDL2_INCLUDE_DIR
NAMES
SDL_haptic.h # this file was introduced with SDL2
HINTS
"${SDL2_FRAMEWORK}/Headers/")
else()
# For some reason we couldn't get the framework directory itself.
# Shouldn't happen, but might if something is weird.
unset(SDL2_FRAMEWORK)
endif()
endif()
find_path(SDL2_INCLUDE_DIR
NAMES
SDL_haptic.h # this file was introduced with SDL2
HINTS
${SDL2_INCLUDE_HINTS}
PATHS
${SDL2_ROOT_DIR}
ENV SDL2DIR
PATH_SUFFIXES include include/sdl2 include/SDL2 SDL2)
if(WIN32 AND SDL2_LIBRARY)
find_file(SDL2_RUNTIME_LIBRARY
NAMES
SDL2.dll
libSDL2.dll
HINTS
${SDL2_LIB_HINTS}
PATHS
${SDL2_ROOT_DIR}
ENV SDL2DIR
PATH_SUFFIXES bin lib ${SDL2_LIB_PATH_SUFFIX})
endif()
if(WIN32 OR ANDROID OR IOS OR (APPLE AND NOT _sdl2_framework))
set(SDL2_EXTRA_REQUIRED SDL2_SDLMAIN_LIBRARY)
find_library(SDL2_SDLMAIN_LIBRARY
NAMES
SDL2main
PATHS
${SDL2_ROOT_DIR}
ENV SDL2DIR
PATH_SUFFIXES lib ${SDL2_LIB_PATH_SUFFIX})
endif()
if(MINGW AND NOT SDL2PC_FOUND)
find_library(SDL2_MINGW_LIBRARY mingw32)
find_library(SDL2_MWINDOWS_LIBRARY mwindows)
endif()
if(SDL2_PREFIX)
# Restore things the way they used to be.
set(CMAKE_PREFIX_PATH ${SDL2_ORIGPREFIXPATH})
endif()
# handle the QUIETLY and REQUIRED arguments and set QUATLIB_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SDL2
DEFAULT_MSG
SDL2_LIBRARY
SDL2_INCLUDE_DIR
${SDL2_EXTRA_REQUIRED})
if(SDL2_FOUND)
if(NOT TARGET SDL2::SDL2)
# Create SDL2::SDL2
if(WIN32 AND SDL2_RUNTIME_LIBRARY)
set(SDL2_DYNAMIC TRUE)
add_library(SDL2::SDL2 SHARED IMPORTED)
set_target_properties(SDL2::SDL2
PROPERTIES
IMPORTED_IMPLIB "${SDL2_LIBRARY}"
IMPORTED_LOCATION "${SDL2_RUNTIME_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
)
else()
add_library(SDL2::SDL2 UNKNOWN IMPORTED)
if(SDL2_FRAMEWORK AND SDL2_FRAMEWORK_NAME)
# Handle the case that SDL2 is a framework and we were able to decompose it above.
set_target_properties(SDL2::SDL2 PROPERTIES
IMPORTED_LOCATION "${SDL2_FRAMEWORK}/${SDL2_FRAMEWORK_NAME}")
elseif(_sdl2_framework AND SDL2_LIBRARY MATCHES "(/[^/]+)*.framework$")
# Handle the case that SDL2 is a framework and SDL_LIBRARY is just the framework itself.
# This takes the basename of the framework, without the extension,
# and sets it (as a child of the framework) as the imported location for the target.
# This is the library symlink inside of the framework.
set_target_properties(SDL2::SDL2 PROPERTIES
IMPORTED_LOCATION "${SDL2_LIBRARY}/${CMAKE_MATCH_1}")
else()
# Handle non-frameworks (including non-Mac), as well as the case that we're given the library inside of the framework
set_target_properties(SDL2::SDL2 PROPERTIES
IMPORTED_LOCATION "${SDL2_LIBRARY}")
endif()
set_target_properties(SDL2::SDL2
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
)
endif()
if(APPLE)
# Need Cocoa here, is always a framework
find_library(SDL2_COCOA_LIBRARY Cocoa)
list(APPEND SDL2_EXTRA_REQUIRED SDL2_COCOA_LIBRARY)
if(SDL2_COCOA_LIBRARY)
set_target_properties(SDL2::SDL2 PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES ${SDL2_COCOA_LIBRARY})
endif()
endif()
# Compute what to do with SDL2main
set(SDL2MAIN_LIBRARIES SDL2::SDL2)
add_library(SDL2::SDL2main INTERFACE IMPORTED)
if(SDL2_SDLMAIN_LIBRARY)
add_library(SDL2::SDL2main_real STATIC IMPORTED)
set_target_properties(SDL2::SDL2main_real
PROPERTIES
IMPORTED_LOCATION "${SDL2_SDLMAIN_LIBRARY}")
set(SDL2MAIN_LIBRARIES SDL2::SDL2main_real ${SDL2MAIN_LIBRARIES})
endif()
if(MINGW)
# MinGW requires some additional libraries to appear earlier in the link line.
if(SDL2PC_LIBRARIES)
# Use pkgconfig-suggested extra libraries if available.
list(REMOVE_ITEM SDL2PC_LIBRARIES SDL2main SDL2)
set(SDL2MAIN_LIBRARIES ${SDL2PC_LIBRARIES} ${SDL2MAIN_LIBRARIES})
else()
# fall back to extra libraries specified in pkg-config in
# an official binary distro of SDL2 for MinGW I downloaded
if(SDL2_MINGW_LIBRARY)
set(SDL2MAIN_LIBRARIES ${SDL2_MINGW_LIBRARY} ${SDL2MAIN_LIBRARIES})
endif()
if(SDL2_MWINDOWS_LIBRARY)
set(SDL2MAIN_LIBRARIES ${SDL2_MWINDOWS_LIBRARY} ${SDL2MAIN_LIBRARIES})
endif()
endif()
set_target_properties(SDL2::SDL2main
PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "main=SDL_main")
endif()
set_target_properties(SDL2::SDL2main
PROPERTIES
INTERFACE_LINK_LIBRARIES "${SDL2MAIN_LIBRARIES}")
endif()
mark_as_advanced(SDL2_ROOT_DIR)
endif()
mark_as_advanced(SDL2_LIBRARY
SDL2_RUNTIME_LIBRARY
SDL2_INCLUDE_DIR
SDL2_SDLMAIN_LIBRARY
SDL2_COCOA_LIBRARY
SDL2_MINGW_LIBRARY
SDL2_MWINDOWS_LIBRARY)

View File

@ -0,0 +1,162 @@
# - try to find Sonix 1.2 library
# Requires VPR 2.0 and GMTL (thus FindVPR20.cmake and FindGMTL.cmake)
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 2.2 - you probably want to use
# find_package(VRJuggler22) instead, for an easy interface to this and
# related scripts. See FindVRJuggler22.cmake for more information.
#
# SONIX12_LIBRARY_DIR, library search path
# SONIX12_INCLUDE_DIR, include search path
# SONIX12_LIBRARY, the library to link against
# SONIX12_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# SONIX12_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_HUMAN "Sonix 1.2")
set(_RELEASE_NAMES sonix-1_2 libsonix-1_2)
set(_DEBUG_NAMES sonix_d-1_2 libsonix_d-1_2)
set(_DIR sonix-1.2)
set(_HEADER snx/sonix.h)
set(_FP_PKG_NAME sonix)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(Sonix12_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(SONIX12_ROOT_DIR
"${SONIX12_ROOT_DIR}"
CACHE
PATH
"Root directory to search for Sonix")
if(DEFINED VRJUGGLER22_ROOT_DIR)
mark_as_advanced(SONIX12_ROOT_DIR)
endif()
if(NOT SONIX12_ROOT_DIR)
set(SONIX12_ROOT_DIR "${VRJUGGLER22_ROOT_DIR}")
endif()
set(_ROOT_DIR "${SONIX12_ROOT_DIR}")
find_path(SONIX12_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(SONIX12_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(SONIX12_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(SONIX12)
# Dependencies
if(NOT VPR20_FOUND)
find_package(VPR20 ${_FIND_FLAGS})
endif()
if(NOT GMTL_FOUND)
find_package(GMTL ${_FIND_FLAGS})
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Sonix12
DEFAULT_MSG
SONIX12_LIBRARY
SONIX12_INCLUDE_DIR
VPR20_FOUND
VPR20_LIBRARIES
VPR20_INCLUDE_DIR
GMTL_FOUND
GMTL_INCLUDE_DIR)
if(SONIX12_FOUND)
set(_DEPS ${VPR20_LIBRARIES})
set(SONIX12_INCLUDE_DIRS ${SONIX12_INCLUDE_DIR})
list(APPEND
SONIX12_INCLUDE_DIRS
${VPR20_INCLUDE_DIRS}
${GMTL_INCLUDE_DIRS})
clean_directory_list(SONIX12_INCLUDE_DIRS)
if(VRJUGGLER22_CREATE_IMPORTED_TARGETS)
create_imported_target(SONIX12 ${_DEPS})
else()
clean_library_list(SONIX12_LIBRARIES ${_DEPS})
endif()
mark_as_advanced(SONIX12_ROOT_DIR)
endif()
mark_as_advanced(SONIX12_LIBRARY_RELEASE
SONIX12_LIBRARY_DEBUG
SONIX12_INCLUDE_DIR)

View File

@ -0,0 +1,163 @@
# - try to find Sonix 1.4 library
# Requires VPR 2.2 and GMTL (thus FindVPR22.cmake and FindGMTL.cmake)
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 3.0 - you probably want to use
# find_package(VRJuggler30) instead, for an easy interface to this and
# related scripts. See FindVRJuggler30.cmake for more information.
#
# SONIX14_LIBRARY_DIR, library search path
# SONIX14_INCLUDE_DIR, include search path
# SONIX14_LIBRARY, the library to link against
# SONIX14_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# SONIX14_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
# Updated for VR Juggler 3.0 by:
# Brandon Newendorp <brandon@newendorp.com>
set(_HUMAN "Sonix 1.4")
set(_FP_PKG_NAME sonix)
set(_RELEASE_NAMES)
set(_DEBUG_NAMES)
foreach(VER 1_4 1_4_0 1_4_1 1_4_2)
list(APPEND _RELEASE_NAMES ${_FP_PKG_NAME}-${VER})
list(APPEND _DEBUG_NAMES ${_FP_PKG_NAME}_d-${VER})
endforeach()
set(_DIR sonix-1.4)
set(_HEADER snx/sonix.h)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(SONIX14_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(SONIX14_ROOT_DIR
"${SONIX14_ROOT_DIR}"
CACHE
PATH
"Root directory to search for Sonix")
if(DEFINED VRJUGGLER30_ROOT_DIR)
mark_as_advanced(SONIX14_ROOT_DIR)
endif()
if(NOT SONIX14_ROOT_DIR)
set(SONIX14_ROOT_DIR "${VRJUGGLER30_ROOT_DIR}")
endif()
set(_ROOT_DIR "${SONIX14_ROOT_DIR}")
find_path(SONIX14_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(SONIX14_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(SONIX14_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(SONIX14)
# Dependencies
if(NOT VPR22_FOUND)
find_package(VPR22 ${_FIND_FLAGS})
endif()
if(NOT GMTL_FOUND)
find_package(GMTL ${_FIND_FLAGS})
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SONIX14
DEFAULT_MSG
SONIX14_LIBRARY
SONIX14_INCLUDE_DIR
VPR22_FOUND
VPR22_LIBRARIES
VPR22_INCLUDE_DIR
GMTL_FOUND
GMTL_INCLUDE_DIR)
if(SONIX14_FOUND)
set(_DEPS ${VPR22_LIBRARIES})
set(SONIX14_INCLUDE_DIRS ${SONIX14_INCLUDE_DIR})
list(APPEND
SONIX14_INCLUDE_DIRS
${VPR22_INCLUDE_DIRS}
${GMTL_INCLUDE_DIRS})
clean_directory_list(SONIX14_INCLUDE_DIRS)
if(VRJUGGLER30_CREATE_IMPORTED_TARGETS)
create_imported_target(SONIX14 ${_DEPS})
else()
clean_library_list(SONIX14_LIBRARIES ${_DEPS})
endif()
mark_as_advanced(SONIX14_ROOT_DIR)
endif()
mark_as_advanced(SONIX14_LIBRARY_RELEASE
SONIX14_LIBRARY_DEBUG
SONIX14_INCLUDE_DIR)

View File

@ -0,0 +1,73 @@
# - Try to find C++ TR1 headers and libraries
# Once done, this will define
#
# TR1_USE_FILE, which you may "include" in your CMake file to be able
# to use TR1 features transparently
# TR1_INCLUDE_DIRS, any directories needed to access TR1 headers
# TR1_LIBRARY_DIRS, any directories needed to access (auto-link) TR1 libraries
# TR1_FOUND, If false, do not try to use TR1 features.
#
# If TR1 features are not built-in, we will try to use Boost to
# substitute for them.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# If we were sought quietly, any dependencies should be quiet as well
if(TR1_FIND_QUIETLY)
set(_findflags QUIET)
else()
set(_findflags)
endif()
set(_check)
set(TR1_INCLUDE_DIRS)
set(TR1_LIBRARY_DIRS)
get_filename_component(_findtr1moddir
${CMAKE_CURRENT_LIST_FILE}
PATH)
set(TR1_USE_FILE "${_findtr1moddir}/UseTR1.cmake")
if(WIN32)
if(MSVC)
set(PLATFORM "Visual Studio - no workarounds")
else()
set(PLATFORM "Unknown Windows platform - no workarounds set")
endif()
if(MSVC_VERSION LESS 1600)
# Earlier than VS 2010
# Missing stdint.h/cstdint
set(PLATFORM "Visual Studio older than Visual Studio 2010")
endif()
if(MSVC_VERSION LESS 1500)
# Earlier than VS 2008
# Missing all of TR1
# (The feature pack or SP1 is required for VS2008 TR support)
set(PLATFORM "Visual Studio older than Visual Studio 2008")
list(APPEND _check Boost_FOUND)
find_package(Boost COMPONENTS math_c99 math_tr1 ${_findflags})
list(APPEND
TR1_INCLUDE_DIRS
"${Boost_INCLUDE_DIR}/boost/tr1/tr1"
"${Boost_INCLUDE_DIR}/boost/tr1"
"${Boost_INCLUDE_DIR}")
list(APPEND TR1_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
endif()
else()
set(PLATFORM "Non-Windows Platform - no workarounds set")
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TR1 DEFAULT_MSG PLATFORM ${_check})

View File

@ -0,0 +1,68 @@
# - try to find TooN headers
#
# Users may optionally supply:
# TOON_ROOT_DIR - a prefix to start searching for the toon headers.
#
# Cache Variables: (probably not for direct use in your scripts)
# TOON_INCLUDE_DIR
#
# Non-cache variables you might use in your CMakeLists.txt:
# TOON_FOUND
# TOON_INCLUDE_DIRS
# TOON_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(TOON_ROOT_DIR
"${TOON_ROOT_DIR}"
CACHE
PATH
"Path to search for TooN")
###
# Dependencies
###
if(NOT LAPACKLIBS_ROOT_DIR)
set(LAPACKLIBS_ROOT_DIR "${TOON_ROOT_DIR}")
endif()
find_package(LAPACKLibs QUIET)
###
# Configure TooN
###
find_path(TOON_INCLUDE_DIR
NAMES
TooN/TooN.h
HINTS
"${TOON_ROOT_DIR}"
PATH_SUFFIXES
include)
mark_as_advanced(TOON_INCLUDE_DIR)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TooN
DEFAULT_MSG
TOON_INCLUDE_DIR
LAPACKLIBS_FOUND)
if(TOON_FOUND)
set(TOON_INCLUDE_DIRS "${TOON_INCLUDE_DIR}")
set(TOON_LIBRARIES ${LAPACKLIBS_LIBRARIES})
mark_as_advanced(TOON_ROOT_DIR)
endif()

View File

@ -0,0 +1,84 @@
# - try to find tag algorithm library (built on TooN)
#
# Users may optionally supply:
# TAG_ROOT_DIR - a prefix to start searching for the toon headers.
#
# Cache Variables: (probably not for direct use in your scripts)
# TAG_INCLUDE_DIR
# TAG_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# TOONTAG_FOUND
# TOONTAG_INCLUDE_DIRS
# TOONTAG_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(TOONTAG_ROOT_DIR
"${TOONTAG_ROOT_DIR}"
CACHE
PATH
"Path to search for tag")
###
# Dependencies
###
if(NOT TOON_ROOT_DIR)
set(TOON_ROOT_DIR "${TOONTAG_ROOT_DIR}")
endif()
find_package(TooN QUIET)
find_package(TR1 QUIET)
include("${TR1_USE_FILE}")
###
# Configure tag
###
find_path(TOONTAG_INCLUDE_DIR
NAMES
tag/helpers.h
HINTS
"${TOONTAG_ROOT_DIR}"
PATH_SUFFIXES
tag
include)
mark_as_advanced(TOONTAG_INCLUDE_DIR)
find_library(TOONTAG_LIBRARY
NAMES
toontag
HINTS
"${TOONTAG_ROOT_DIR}"
PATH_SUFFIXES
lib
lib64)
mark_as_advanced(TOONTAG_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TooNtag
DEFAULT_MSG
TOONTAG_LIBRARY
TOONTAG_INCLUDE_DIR
TOON_FOUND)
if(TOONTAG_FOUND)
set(TOONTAG_INCLUDE_DIRS "${TOONTAG_INCLUDE_DIR}" ${TOON_INCLUDE_DIRS})
set(TOONTAG_LIBRARIES "${TOONTAG_LIBRARY}" ${TOON_LIBRARIES})
mark_as_advanced(TOONTAG_ROOT_DIR)
endif()

View File

@ -0,0 +1,153 @@
# - try to find Tweek 1.2 library
# Requires VPR 2.0 (thus FindVPR20.cmake)
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 2.2 - you probably want to use
# find_package(VRJuggler22) instead, for an easy interface to this and
# related scripts. See FindVRJuggler22.cmake for more information.
#
# TWEEK12_LIBRARY_DIR, library search path
# TWEEK12_INCLUDE_DIR, include search path
# TWEEK12_LIBRARY, the library to link against
# TWEEK12_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# TWEEK12_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_HUMAN "Tweek 1.2")
set(_RELEASE_NAMES tweek-1_2 libtweek-1_2)
set(_DEBUG_NAMES tweek_d-1_2 libtweek_d-1_2)
set(_DIR tweek-1.2)
set(_HEADER tweek/tweek.h)
set(_FP_PKG_NAME tweek)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(Tweek12_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(TWEEK12_ROOT_DIR
"${TWEEK12_ROOT_DIR}"
CACHE
PATH
"Root directory to search for Tweek")
if(DEFINED VRJUGGLER22_ROOT_DIR)
mark_as_advanced(TWEEK12_ROOT_DIR)
endif()
if(NOT TWEEK12_ROOT_DIR)
set(TWEEK12_ROOT_DIR "${VRJUGGLER22_ROOT_DIR}")
endif()
set(_ROOT_DIR "${TWEEK12_ROOT_DIR}")
find_path(TWEEK12_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(TWEEK12_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(TWEEK12_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(TWEEK12)
# Dependency
if(NOT VPR20_FOUND)
find_package(VPR20 ${_FIND_FLAGS})
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Tweek12
DEFAULT_MSG
TWEEK12_LIBRARY
TWEEK12_INCLUDE_DIR
VPR20_FOUND
VPR20_LIBRARIES
VPR20_INCLUDE_DIR)
if(TWEEK12_FOUND)
set(_DEPS ${VPR20_LIBRARIES})
set(TWEEK12_INCLUDE_DIRS ${TWEEK12_INCLUDE_DIR})
list(APPEND TWEEK12_INCLUDE_DIRS ${VPR20_INCLUDE_DIRS})
clean_directory_list(TWEEK12_INCLUDE_DIRS)
if(VRJUGGLER22_CREATE_IMPORTED_TARGETS)
create_imported_target(TWEEK12 ${_DEPS})
else()
clean_library_list(TWEEK12_LIBRARIES ${_DEPS})
endif()
mark_as_advanced(TWEEK12_ROOT_DIR)
endif()
mark_as_advanced(TWEEK12_LIBRARY_RELEASE
TWEEK12_LIBRARY_DEBUG
TWEEK12_INCLUDE_DIR)

View File

@ -0,0 +1,154 @@
# - try to find Tweek 1.4 library
# Requires VPR 2.2 (thus FindVPR22.cmake)
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 3.0 - you probably want to use
# find_package(VRJuggler30) instead, for an easy interface to this and
# related scripts. See FindVRJuggler30.cmake for more information.
#
# TWEEK14_LIBRARY_DIR, library search path
# TWEEK14_INCLUDE_DIR, include search path
# TWEEK14_LIBRARY, the library to link against
# TWEEK14_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# TWEEK14_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
# Updated for VR Juggler 3.0 by:
# Brandon Newendorp <brandon@newendorp.com>
set(_HUMAN "Tweek 1.4")
set(_FP_PKG_NAME sonix)
set(_RELEASE_NAMES)
set(_DEBUG_NAMES)
foreach(VER 1_4 1_4_0 1_4_1 1_4_2)
list(APPEND _RELEASE_NAMES ${_FP_PKG_NAME}-${VER})
list(APPEND _DEBUG_NAMES ${_FP_PKG_NAME}_d-${VER})
endforeach()
set(_DIR tweek-1.4)
set(_HEADER tweek/tweek.h)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(TWEEK14_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(TWEEK14_ROOT_DIR
"${TWEEK14_ROOT_DIR}"
CACHE
PATH
"Root directory to search for Tweek")
if(DEFINED VRJUGGLER30_ROOT_DIR)
mark_as_advanced(TWEEK14_ROOT_DIR)
endif()
if(NOT TWEEK14_ROOT_DIR)
set(TWEEK14_ROOT_DIR "${VRJUGGLER30_ROOT_DIR}")
endif()
set(_ROOT_DIR "${TWEEK14_ROOT_DIR}")
find_path(TWEEK14_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(TWEEK14_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(TWEEK14_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(TWEEK14)
# Dependency
if(NOT VPR22_FOUND)
find_package(VPR22 ${_FIND_FLAGS})
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TWEEK14
DEFAULT_MSG
TWEEK14_LIBRARY
TWEEK14_INCLUDE_DIR
VPR22_FOUND
VPR22_LIBRARIES
VPR22_INCLUDE_DIR)
if(TWEEK14_FOUND)
set(_DEPS ${VPR22_LIBRARIES})
set(TWEEK14_INCLUDE_DIRS ${TWEEK14_INCLUDE_DIR})
list(APPEND TWEEK14_INCLUDE_DIRS ${VPR22_INCLUDE_DIRS})
clean_directory_list(TWEEK14_INCLUDE_DIRS)
if(VRJUGGLER30_CREATE_IMPORTED_TARGETS)
create_imported_target(TWEEK14 ${_DEPS})
else()
clean_library_list(TWEEK14_LIBRARIES ${_DEPS})
endif()
mark_as_advanced(TWEEK14_ROOT_DIR)
endif()
mark_as_advanced(TWEEK14_LIBRARY_RELEASE
TWEEK14_LIBRARY_DEBUG
TWEEK14_INCLUDE_DIR)

View File

@ -0,0 +1,276 @@
# - try to find VPR 2.0 library
# Requires Boost 1.33.1 or greater (including filesystem and signals libraries)
# (and thus FindBoost.cmake from 2.8rc3 or newer, preferably)
# Requires NSPR4 (and PLC4) on Windows
# Requires pthreads on Unix (Mac or Linux)
# Requires libuuid on Linux
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 2.2 - you probably want to use
# find_package(VRJuggler22) instead, for an easy interface to this and
# related scripts. See FindVRJuggler22.cmake for more information.
#
# VPR20_LIBRARY_DIR, library search path
# VPR20_INCLUDE_DIR, include search path
# VPR20_LIBRARY, the library to link against
# VPR20_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# VPR20_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_HUMAN "VPR 2.0")
set(_RELEASE_NAMES vpr-2_0 libvpr-2_0)
set(_DEBUG_NAMES vpr_d-2_0 libvpr_d-2_0)
set(_DIR vpr-2.0)
set(_HEADER vpr/vpr.h)
set(_FP_PKG_NAME vpr)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(VPR20_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_extra_libs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(VPR20_ROOT_DIR
"${VPR20_ROOT_DIR}"
CACHE
PATH
"Root directory to search for VPR")
if(DEFINED VRJUGGLER22_ROOT_DIR)
mark_as_advanced(VPR20_ROOT_DIR)
endif()
if(NOT VPR20_ROOT_DIR)
set(VPR20_ROOT_DIR "${VRJUGGLER22_ROOT_DIR}")
endif()
set(_ROOT_DIR "${VPR20_ROOT_DIR}")
find_path(VPR20_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(VPR20_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(VPR20_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(VPR20)
# Dependencies
set(_deps_libs)
set(_deps_includes)
set(_deps_check)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0011 NEW)
cmake_policy(SET CMP0012 NEW)
endif()
if((NOT "${Boost_FOUND}")
OR (NOT "${Boost_FILESYSTEM_FOUND}")
OR (NOT "${Boost_SIGNALS_FOUND}")
OR (Boost_VERSION GREATER 103401 AND NOT Boost_SYSTEM_FOUND))
if(VPR20_LIBRARY_RELEASE)
# Find Boost in the same place as VPR
get_filename_component(VPR20_LIBRARY_DIR
${VPR20_LIBRARY_RELEASE}
PATH)
set(BOOST_ROOT ${VPR20_LIBRARY_DIR}/../)
if(APPLE)
# VR Juggler 2.2.1 binaries for Mac are built against single-threaded boost.
set(Boost_USE_STATIC_LIBS ON)
#set(Boost_USE_MULTITHREADED OFF)
endif()
find_package(Boost
1.33.1
${_FIND_FLAGS}
COMPONENTS
filesystem
signals)
mark_as_advanced(Boost_LIB_DIAGNOSTIC_DEFINITIONS)
if(WIN32 AND NOT Boost_FOUND)
if(NOT VPR20_FIND_QUIETLY)
message(STATUS
"Searching for Boost using forced '-vc80' override...")
endif()
set(Boost_COMPILER "-vc80")
find_package(Boost
1.33.1
${_FIND_FLAGS}
COMPONENTS
filesystem
signals)
endif()
if(Boost_VERSION GREATER 103401)
find_package(Boost
${_FIND_FLAGS}
COMPONENTS
filesystem
system
signals)
endif()
endif()
endif()
list(APPEND
_deps_libs
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_SIGNALS_LIBRARY})
list(APPEND _deps_includes ${Boost_INCLUDE_DIRS})
list(APPEND
_deps_check
Boost_FILESYSTEM_LIBRARY
Boost_SIGNALS_LIBRARY
Boost_INCLUDE_DIRS)
if(NOT CPPDOM_FOUND)
find_package(CPPDOM ${_FIND_FLAGS})
endif()
list(APPEND _deps_libs ${CPPDOM_LIBRARIES})
list(APPEND _deps_includes ${CPPDOM_INCLUDE_DIRS})
list(APPEND _deps_check CPPDOM_LIBRARIES CPPDOM_INCLUDE_DIRS)
if(UNIX AND NOT WIN32)
if(NOT THREADS_FOUND)
find_package(Threads ${_FIND_FLAGS})
endif()
list(APPEND _deps_check THREADS_FOUND)
list(APPEND _deps_libs ${CMAKE_THREAD_LIBS_INIT})
if(NOT APPLE)
find_library(VPR20_libuuid_LIBRARY NAMES uuid)
mark_as_advanced(VPR20_libuuid_LIBRARY)
list(APPEND _deps_check VPR20_libuuid_LIBRARY)
list(APPEND _deps_libs ${VPR20_libuuid_LIBRARY})
endif()
endif()
if(WIN32)
find_library(VPR20_libnspr4_LIBRARY
NAMES
nspr4
libnspr4
HINTS
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
"${_ROOT_DIR}"
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} NSPR4 library full path")
find_library(VPR20_libplc4_LIBRARY
NAMES
plc4
libplc4
HINTS
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
"${_ROOT_DIR}"
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} PLC4 library full path")
mark_as_advanced(VPR20_libnspr4_LIBRARY VPR20_libplc4_LIBRARY)
list(APPEND _deps_check VPR20_libnspr4_LIBRARY VPR20_libplc4_LIBRARY)
list(APPEND
_deps_libs
${VPR20_libnspr4_LIBRARY}
${VPR20_libplc4_LIBRARY})
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VPR20
DEFAULT_MSG
VPR20_LIBRARY
VPR20_INCLUDE_DIR
${_deps_check})
if(VPR20_FOUND)
set(VPR20_INCLUDE_DIRS "${VPR20_INCLUDE_DIR}" ${_deps_includes})
clean_directory_list(VPR20_INCLUDE_DIRS)
if(VRJUGGLER22_CREATE_IMPORTED_TARGETS)
create_imported_target(VPR20 ${_deps_libs})
else()
clean_library_list(VPR20_LIBRARIES ${VPR20_LIBRARY} ${_deps_libs})
endif()
mark_as_advanced(VPR20_ROOT_DIR)
endif()
mark_as_advanced(VPR20_LIBRARY_RELEASE
VPR20_LIBRARY_DEBUG
VPR20_INCLUDE_DIR)

View File

@ -0,0 +1,232 @@
# - try to find VPR 2.2 library
# Requires Boost 1.33.1 or greater (including filesystem and signals libraries)
# (and thus FindBoost.cmake from 2.8rc3 or newer, preferably)
# Requires NSPR4 (and PLC4) on Windows
# Requires pthreads on Unix (Mac or Linux)
# Requires libuuid on Linux
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 3.0 - you probably want to use
# find_package(VRJuggler30) instead, for an easy interface to this and
# related scripts. See FindVRJuggler30.cmake for more information.
#
# VPR22_LIBRARY_DIR, library search path
# VPR22_INCLUDE_DIR, include search path
# VPR22_LIBRARY, the library to link against
# VPR22_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# VPR22_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
# Updated for VR Juggler 3.0 by:
# Brandon Newendorp <brandon@newendorp.com>
set(_HUMAN "VPR 2.2")
set(_FP_PKG_NAME vpr)
set(_RELEASE_NAMES)
set(_DEBUG_NAMES)
foreach(VER 2_2 2_2_0 2_2_1 2_2_2)
list(APPEND _RELEASE_NAMES ${_FP_PKG_NAME}-${VER})
list(APPEND _DEBUG_NAMES ${_FP_PKG_NAME}_d-${VER})
endforeach()
set(_DIR vpr-2.2)
set(_HEADER vpr/vpr.h)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(VPR22_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_extra_libs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(VPR22_ROOT_DIR
"${VPR22_ROOT_DIR}"
CACHE
PATH
"Root directory to search for VPR")
if(DEFINED VRJUGGLER30_ROOT_DIR)
mark_as_advanced(VPR22_ROOT_DIR)
endif()
if(NOT VPR22_ROOT_DIR)
set(VPR22_ROOT_DIR "${VRJUGGLER30_ROOT_DIR}")
endif()
set(_ROOT_DIR "${VPR22_ROOT_DIR}")
find_path(VPR22_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(VPR22_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(VPR22_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(VPR22)
# Dependencies
set(_deps_libs)
set(_deps_includes)
set(_deps_check)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0011 NEW)
cmake_policy(SET CMP0012 NEW)
endif()
if((NOT Boost_FOUND)
OR (NOT Boost_FILESYSTEM_FOUND)
OR (NOT Boost_SIGNALS_FOUND)
OR (NOT Boost_SYSTEM_FOUND)
OR (NOT Boost_PROGRAM_OPTIONS_FOUND)
OR (NOT Boost_DATE_TIME_FOUND)
OR (NOT Boost_REGEX_FOUND))
if(VPR22_LIBRARY_RELEASE)
# Find Boost in the same place as VPR
get_filename_component(VPR22_LIBRARY_DIR
${VPR22_LIBRARY_RELEASE}
PATH)
set(BOOST_ROOT ${VPR22_LIBRARY_DIR}/../)
find_package(Boost
1.40.0
${_FIND_FLAGS}
COMPONENTS
filesystem
system
signals
program_options
date_time
regex)
mark_as_advanced(Boost_LIB_DIAGNOSTIC_DEFINITIONS)
endif()
endif()
list(APPEND
_deps_libs
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_SIGNALS_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_REGEX_LIBRARY})
list(APPEND _deps_includes ${Boost_INCLUDE_DIRS})
list(APPEND
_deps_check
Boost_FILESYSTEM_LIBRARY
Boost_SYSTEM_LIBRARY
Boost_SIGNALS_LIBRARY
Boost_PROGRAM_OPTIONS_LIBRARY
Boost_DATE_TIME_LIBRARY
Boost_REGEX_LIBRARY
Boost_INCLUDE_DIRS)
if(NOT CPPDOM_FOUND)
find_package(CPPDOM ${_FIND_FLAGS})
endif()
list(APPEND _deps_libs ${CPPDOM_LIBRARIES})
list(APPEND _deps_includes ${CPPDOM_INCLUDE_DIRS})
list(APPEND _deps_check CPPDOM_LIBRARIES CPPDOM_INCLUDE_DIRS)
if(UNIX AND NOT WIN32)
if(NOT THREADS_FOUND)
find_package(Threads ${_FIND_FLAGS})
endif()
list(APPEND _deps_check THREADS_FOUND)
list(APPEND _deps_libs ${CMAKE_THREAD_LIBS_INIT})
if(NOT APPLE)
find_library(VPR22_libuuid_LIBRARY NAMES uuid)
mark_as_advanced(VPR22_libuuid_LIBRARY)
if(VPR22_libuuid_LIBRARY)
list(APPEND _deps_libs ${VPR22_libuuid_LIBRARY})
endif()
endif()
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VPR22
DEFAULT_MSG
VPR22_LIBRARY
VPR22_INCLUDE_DIR
${_deps_check})
if(VPR22_FOUND)
set(VPR22_INCLUDE_DIRS ${VPR22_INCLUDE_DIR} ${_deps_includes})
clean_directory_list(VPR22_INCLUDE_DIRS)
if(VRJUGGLER30_CREATE_IMPORTED_TARGETS)
create_imported_target(VPR22 ${_deps_libs})
else()
clean_library_list(VPR22_LIBRARIES ${VPR22_LIBRARY} ${_deps_libs})
endif()
mark_as_advanced(VPR22_ROOT_DIR)
endif()
mark_as_advanced(VPR22_LIBRARY_RELEASE
VPR22_LIBRARY_DEBUG
VPR22_INCLUDE_DIR)

View File

@ -0,0 +1,304 @@
# - try to find VPS library
#
# VPS_LIBRARY_DIR, library search path
# VPS_INCLUDE_DIR, include search path
# VPS_{component}_LIBRARY, the library to link against
# VPS_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# VPS_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
include(SelectLibraryConfigurations)
include(ListCombinations)
include(CheckVersion)
include(ListFilter)
set(VPS_ROOT_DIR
"${VPS_ROOT_DIR}"
CACHE
PATH
"Root directory to search for VPS")
# Try the config file mode.
find_package(VPS QUIET NO_MODULE)
if(VPS_FOUND)
mark_as_advanced(VPS_DIR VPS_ROOT_DIR)
return()
endif()
if(NOT BITS)
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(BITS 64)
else()
set(BITS 32)
endif()
endif()
set(_vpslibnames)
set(_grviewerlibnames)
###
# Cray MTA(Multi-Threaded Architecture) family: CMake build not tested
if("${CMAKE_SYSTEM_NAME}" STREQUAL "MTX")
set(VPS_PLATFORM MTX)
set(_VPS_FLAGS_32 "-pl all.pl -par")
set(_VPS_FLAGS_64 "-pl all.pl -par")
###
# Linux
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(VPS_PLATFORM LINUX)
set(_VPS_FLAGS_32 "-O2 -Wno-write-strings")
set(_VPS_FLAGS_64 "-m64 -O3 -ffast-math -funroll-all-loops -Wno-write-strings")
###
# IBM-AIX: CMake build not tested
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "AIX")
set(VPS_PLATFORM AIX)
set(_VPS_FLAGS_32 "-q32")
set(_VPS_FLAGS_64 "-q64")
###
# HP-UX: CMake build not tested
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "HP-UX")
set(VPS_PLATFORM HPUX)
set(_VPS_FLAGS_32 "-O")
###
# SunOS: CMake build not tested
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
set(VPS_PLATFORM SOLARIS)
set(_VPS_FLAGS_32 "-O")
###
# IRIX: CMake build not tested
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "IRIX")
set(VPS_PLATFORM IRIX)
set(_VPS_FLAGS_32 "-O2 -OPT")
set(_VPS_FLAGS_64 "-64 -O2 -OPT")
###
# Mac OS X
elseif(APPLE AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(VPS_PLATFORM MACOSX)
set(_VPS_FLAGS_32 "-O2 -lm -lobjc -lstdc++ -Wno-write-strings")
set(_VPS_FLAGS_64 "-m64 -O3 -ffast-math -funroll-all-loops -lm -lobjc -lstdc++ -Wno-write-strings")
###
# Windows
elseif(WIN32)
set(VPS_PLATFORM WINDOWS)
set(_VPS_FLAGS_32 "-O2")
set(_VPS_FLAGS_64 "-O2")
if(MSVC)
set(DEFS_32 -D_CRT_SECURE_NO_DEPRECATE)
set(DEFS_64 -D_CRT_SECURE_NO_DEPRECATE)
if(MSVC60)
set(VPS_CRT "VC6")
elseif(MSVC70)
set(VPS_CRT "VC7")
elseif(MSVC71)
set(VPS_CRT "VC71")
elseif(MSVC80)
set(VPS_CRT "VC8")
elseif(MSVC90)
set(VPS_CRT "VC9")
elseif(MSVC10)
set(VPS_CRT "VC10")
else()
set(VPS_CRT "VC")
endif()
endif()
endif()
if(WIN32 AND MSVC)
set(PLATFORM win${BITS})
set(_threadsuffix Mt)
if(MSVC71)
set(VC_VER vc71)
set(VC_VER_LONG vc71)
elseif(MSVC80)
set(VC_SHORT VC8)
set(VC_LONG MSVC80)
elseif(MSVC90)
set(VC_SHORT VC9)
set(VC_LONG MSVC90)
endif()
list(APPEND
_vpslibnames
"Vps${VC_SHORT}_${BITS}"
"Vps${VC_SHORT}_${BITS}${_threadsuffix}")
endif()
list(APPEND _vpslibnames "Vps${VPS_PLATFORM}${VPS_CRT}_${BITS}")
list(APPEND
_grviewerlibnames
"Viewer"
"GrViewer${VPS_PLATFORM}${VPS_CRT}_${BITS}")
###
# Configure VPS
###
set(_incsearchdirs)
set(_libsearchdirs)
if(WIN32)
include(ProgramFilesGlob)
program_files_glob(_dirs "/VPS*/")
program_files_glob(_dirs2 "/VPS/*/")
list(APPEND _dirs ${_dirs2})
endif()
list_combinations(_libsearchdirs
PREFIXES
"${VPS_ROOT_DIR}"
"${_dirs}"
SUFFIXES
"/lib"
"/Viewer")
list_combinations(_libsearchdirs2
PREFIXES
${_libsearchdirs}
SUFFIXES
"/Release"
"/RelWithDebInfo"
"/MinSizeRel"
"/Debug")
clean_directory_list(_libsearchdirs ${_libsearchdirs2})
list_combinations(_incsearchdirs
PREFIXES
"${VPS_ROOT_DIR}"
"${_dirs}"
SUFFIXES
"/include"
"/include/vps"
"/src"
"/../src"
"/Viewer"
"/../Viewer")
clean_directory_list(_incsearchdirs)
# If a version was specified, the least we can do is remove any directories
# from our search that contain too low of versions
if(VPS_FIND_VERSION)
set(_badversions)
foreach(_dir ${_libsearchdirs})
string(REGEX MATCH "([0-9]).([0-9]).([0-9])" _ver "${_dir}")
if(_ver)
string(REGEX
REPLACE
"([0-9]).([0-9]).([0-9])"
"\\1.\\2.\\3"
_verstd
"${_ver}")
check_version(_result VPS "${_verstd}")
if(NOT _result)
list(APPEND _badversions "${_verstd}")
endif()
endif()
endforeach()
foreach(_badver ${_badversions})
list_filter_out(_libsearchdirs ${_badver} ${_libsearchdirs})
list_filter_out(_incsearchdirs ${_badver} ${_incsearchdirs})
endforeach()
endif()
if(_libsearchdirs)
list(SORT _libsearchdirs)
list(REVERSE _libsearchdirs)
endif()
if(_incsearchdirs)
list(SORT _incsearchdirs)
list(REVERSE _incsearchdirs)
endif()
find_library(VPS_vps_LIBRARY
NAMES
${_vpslibnames}
PATH_SUFFIXES
LP
HINTS
${_libsearchdirs}
PATHS
${VPS_ROOT_DIR}
${VPS_ROOT_DIR}/src
${VPS_ROOT_DIR}/lib)
find_path(VPS_vps_INCLUDE_DIR
NAMES
Vps.h
HINTS
${_incsearchdirs}
PATHS
${VPS_ROOT_DIR}
PATH_SUFFIXES
include
include/vps
src)
find_library(VPS_grviewer_LIBRARY
NAMES
${_grviewerlibnames}
HINTS
${_libsearchdirs}
PATHS
${VPS_ROOT_DIR}
PATH_SUFFIXES
lib
Viewer)
find_path(VPS_grviewer_INCLUDE_DIR
NAMES
grViewerLib.h
HINTS
${_incsearchdirs}
PATHS
${VPS_ROOT_DIR}
PATH_SUFFIXES
include
include/vps
Viewer)
mark_as_advanced(VPS_vps_LIBRARY
VPS_vps_INCLUDE_DIR
VPS_grviewer_LIBRARY
VPS_grviewer_INCLUDE_DIR)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VPS
DEFAULT_MSG
VPS_vps_LIBRARY
VPS_vps_INCLUDE_DIR)
if(VPS_FOUND)
set(VPS_vps_INCLUDE_DIRS "${VPS_vps_INCLUDE_DIR}")
set(VPS_INCLUDE_DIRS "${VPS_vps_INCLUDE_DIR}")
set(VPS_grviewer_INCLUDE_DIRS
"${VPS_vps_INCLUDE_DIR}"
"${VPS_grviewer_INCLUDE_DIR}")
set(VPS_LIBRARIES "${VPS_vps_LIBRARY}")
set(VPS_grviewer_LIBRARIES
"${VPS_vps_LIBRARY}"
"${VPS_grviewer_LIBRARY}")
mark_as_advanced(VPS_ROOT_DIR VPS_DIR)
endif()

View File

@ -0,0 +1,210 @@
# - try to find VR Juggler 2.2 core library
# Requires JCCL 1.2, Gadgeteer 1.2, VPR 2.0, and Sonix 1.2
# (thus FindJCCL12.cmake, FindGadgeteer12.cmake, FindVPR20.cmake,
# and FindSonix12.cmake)
# Requires X11 if not on Mac or Windows.
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 2.2 - you probably want to use
# find_package(VRJuggler22) instead, for an easy interface to this and
# related scripts. See FindVRJuggler22.cmake for more information.
#
# VRJ22_LIBRARY_DIR, library search path
# VRJ22_INCLUDE_DIR, include search path
# VRJ22_LIBRARY, the library to link against
# VRJ22_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# VRJ22_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_HUMAN "VR Juggler 2.2 Core")
set(_RELEASE_NAMES vrj-2_2 libvrj-2_2)
set(_DEBUG_NAMES vrj_d-2_2 libvrj_d-2_2)
set(_DIR vrjuggler-2.2)
set(_HEADER vrj/Kernel/Kernel.h)
set(_FP_PKG_NAME vrjuggler)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(VRJ22_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_extra_libs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(VRJ22_ROOT_DIR
"${VRJ22_ROOT_DIR}"
CACHE
PATH
"Root directory to search for VRJ")
if(DEFINED VRJUGGLER22_ROOT_DIR)
mark_as_advanced(VRJ22_ROOT_DIR)
endif()
if(NOT VRJ22_ROOT_DIR)
set(VRJ22_ROOT_DIR "${VRJUGGLER22_ROOT_DIR}")
endif()
set(_ROOT_DIR "${VRJ22_ROOT_DIR}")
find_path(VRJ22_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(VRJ22_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(VRJ22_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(VRJ22)
# Dependencies
if(NOT JCCL12_FOUND)
find_package(JCCL12 ${_FIND_FLAGS})
endif()
if(NOT GADGETEER12_FOUND)
find_package(Gadgeteer12 ${_FIND_FLAGS})
endif()
if(NOT VPR20_FOUND)
find_package(VPR20 ${_FIND_FLAGS})
endif()
if(NOT SONIX12_FOUND)
find_package(Sonix12 ${_FIND_FLAGS})
endif()
if(UNIX AND NOT APPLE AND NOT WIN32)
if(NOT X11_FOUND)
find_package(X11 ${_FIND_FLAGS})
endif()
set(_CHECK_EXTRAS
X11_FOUND
X11_X11_LIB
X11_ICE_LIB
X11_SM_LIB
X11_INCLUDE_DIR)
endif()
if(UNIX AND NOT WIN32)
find_library(VRJ22_libm_LIBRARY m)
mark_as_advanced(VRJ22_libm_LIBRARY)
list(APPEND _CHECK_EXTRAS VRJ22_libm_LIBRARY)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VRJ22
DEFAULT_MSG
VRJ22_LIBRARY
VRJ22_INCLUDE_DIR
JCCL12_FOUND
JCCL12_LIBRARIES
JCCL12_INCLUDE_DIR
GADGETEER12_FOUND
GADGETEER12_LIBRARIES
GADGETEER12_INCLUDE_DIR
VPR20_FOUND
VPR20_LIBRARIES
VPR20_INCLUDE_DIR
SONIX12_FOUND
SONIX12_LIBRARIES
SONIX12_INCLUDE_DIR
${_CHECK_EXTRAS})
if(VRJ22_FOUND)
set(_DEPS
${JCCL12_LIBRARIES}
${GADGETEER12_LIBRARIES}
${VPR20_LIBRARIES}
${SONIX12_LIBRARIES})
if(UNIX AND NOT APPLE AND NOT WIN32)
list(APPEND _DEPS ${X11_X11_LIB} ${X11_ICE_LIB} ${X11_SM_LIB})
endif()
if(UNIX AND NOT WIN32)
list(APPEND _DEPS ${VRJ22_libm_LIBRARY})
endif()
set(VRJ22_INCLUDE_DIRS "${VRJ22_INCLUDE_DIR}")
list(APPEND
VRJ22_INCLUDE_DIRS
${JCCL12_INCLUDE_DIRS}
${GADGETEER12_INCLUDE_DIRS}
${VPR20_INCLUDE_DIRS}
${SONIX12_INCLUDE_DIRS})
clean_directory_list(VRJ22_INCLUDE_DIRS)
if(VRJUGGLER22_CREATE_IMPORTED_TARGETS)
create_imported_target(VRJ22 ${_DEPS})
else()
clean_library_list(VRJ22_LIBRARIES ${_DEPS})
endif()
mark_as_advanced(VRJ22_ROOT_DIR)
endif()
mark_as_advanced(VRJ22_LIBRARY_RELEASE
VRJ22_LIBRARY_DEBUG
VRJ22_INCLUDE_DIR)

View File

@ -0,0 +1,216 @@
# - try to find VR Juggler 3.0 core library
# Requires JCCL 1.4, Gadgeteer 1.4, VPR 2.2, and Sonix 1.4
# (thus FindJCCL14.cmake, FindGadgeteer20.cmake, FindVPR22.cmake,
# and FindSonix14.cmake)
# Requires X11 if not on Mac or Windows.
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 3.0 - you probably want to use
# find_package(VRJuggler30) instead, for an easy interface to this and
# related scripts. See FindVRJuggler30.cmake for more information.
#
# VRJ30_LIBRARY_DIR, library search path
# VRJ30_INCLUDE_DIR, include search path
# VRJ30_LIBRARY, the library to link against
# VRJ30_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# VRJ30_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
# Updated for VR Juggler 3.0 by:
# Brandon Newendorp <brandon@newendorp.com>
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_HUMAN "VR Juggler 3.0 Core")
set(_FP_PKG_NAME vrjuggler)
set(_RELEASE_NAMES)
set(_DEBUG_NAMES)
foreach(VER 3_0 3_0_0 3_0_1 3_0_2)
list(APPEND _RELEASE_NAMES vrj-${VER})
list(APPEND _DEBUG_NAMES vrj_d-${VER})
endforeach()
set(_DIR vrjuggler-3.0)
set(_HEADER vrj/Kernel/Kernel.h)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(VRJ30_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_include_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_extra_libs(${_FP_PKG_NAME} NO_DEPS)
endif()
set(VRJ30_ROOT_DIR
"${VRJ30_ROOT_DIR}"
CACHE
PATH
"Root directory to search for VRJ")
if(DEFINED VRJUGGLER30_ROOT_DIR)
mark_as_advanced(VRJ30_ROOT_DIR)
endif()
if(NOT VRJ30_ROOT_DIR)
set(VRJ30_ROOT_DIR "${VRJUGGLER30_ROOT_DIR}")
endif()
set(_ROOT_DIR "${VRJ30_ROOT_DIR}")
find_path(VRJ30_INCLUDE_DIR
${_HEADER}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_INCLUDE_DIRS}
PATH_SUFFIXES
${_DIR}
include/${_DIR}
include/
DOC
"Path to ${_HUMAN} includes root")
find_library(VRJ30_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(VRJ30_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(VRJ30)
# Dependencies
if(NOT JCCL14_FOUND)
find_package(JCCL14 ${_FIND_FLAGS})
endif()
if(NOT GADGETEER20_FOUND)
find_package(Gadgeteer20 ${_FIND_FLAGS})
endif()
if(NOT VPR22_FOUND)
find_package(VPR22 ${_FIND_FLAGS})
endif()
if(NOT SONIX14_FOUND)
find_package(Sonix14 ${_FIND_FLAGS})
endif()
if(UNIX AND NOT APPLE AND NOT WIN32)
if(NOT X11_FOUND)
find_package(X11 ${_FIND_FLAGS})
endif()
set(_CHECK_EXTRAS
X11_FOUND
X11_X11_LIB
X11_ICE_LIB
X11_SM_LIB
X11_INCLUDE_DIR)
endif()
if(UNIX AND NOT WIN32)
find_library(VRJ30_libm_LIBRARY m)
mark_as_advanced(VRJ30_libm_LIBRARY)
list(APPEND _CHECK_EXTRAS VRJ30_libm_LIBRARY)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VRJ30
DEFAULT_MSG
VRJ30_LIBRARY
VRJ30_INCLUDE_DIR
JCCL14_FOUND
JCCL14_LIBRARIES
JCCL14_INCLUDE_DIR
GADGETEER20_FOUND
GADGETEER20_LIBRARIES
GADGETEER20_INCLUDE_DIR
VPR22_FOUND
VPR22_LIBRARIES
VPR22_INCLUDE_DIR
SONIX14_FOUND
SONIX14_LIBRARIES
SONIX14_INCLUDE_DIR
${_CHECK_EXTRAS})
if(VRJ30_FOUND)
set(_DEPS
${JCCL14_LIBRARIES}
${GADGETEER20_LIBRARIES}
${VPR22_LIBRARIES}
${SONIX14_LIBRARIES})
if(UNIX AND NOT APPLE AND NOT WIN32)
list(APPEND _DEPS ${X11_X11_LIB} ${X11_ICE_LIB} ${X11_SM_LIB})
endif()
if(UNIX AND NOT WIN32)
list(APPEND _DEPS ${VRJ30_libm_LIBRARY})
endif()
set(VRJ30_INCLUDE_DIRS ${VRJ30_INCLUDE_DIR})
list(APPEND
VRJ30_INCLUDE_DIRS
${JCCL14_INCLUDE_DIRS}
${GADGETEER20_INCLUDE_DIRS}
${VPR22_INCLUDE_DIRS}
${SONIX14_INCLUDE_DIRS})
clean_directory_list(VRJ30_INCLUDE_DIRS)
if(VRJUGGLER30_CREATE_IMPORTED_TARGETS)
create_imported_target(VRJ30 ${_DEPS})
else()
clean_library_list(VRJ30_LIBRARIES ${_DEPS})
endif()
mark_as_advanced(VRJ30_ROOT_DIR)
endif()
mark_as_advanced(VRJ30_LIBRARY_RELEASE
VRJ30_LIBRARY_DEBUG
VRJ30_INCLUDE_DIR)

View File

@ -0,0 +1,161 @@
# - try to find VRJuggler 2.2 OpenGL library
# Requires VRJ core 2.2 (thus FindVRJ22.cmake)
# Requires OpenGL.
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 2.2 - you probably want to use
# find_package(VRJuggler22) instead, for an easy interface to this and
# related scripts. See FindVRJuggler22.cmake for more information.
#
# VRJOGL22_LIBRARY_DIR, library search path
# VRJOGL22_INCLUDE_DIRS, include search path for dependencies
# VRJOGL22_LIBRARY, the library to link against
# VRJOGL22_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# VRJOGL22_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(_HUMAN "VR Juggler 2.2 OpenGL Core")
set(_RELEASE_NAMES vrj_ogl-2_2 libvrj_ogl-2_2)
set(_DEBUG_NAMES vrj_ogl_d-2_2 libvrj_ogl_d-2_2)
set(_DIR vrjuggler-2.2)
set(_FP_PKG_NAME vrjuggler-opengl)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(VRJOGL22_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_names(${_FP_PKG_NAME} NO_DEPS)
endif()
set(VRJOGL22_ROOT_DIR
"${VRJOGL22_ROOT_DIR}"
CACHE
PATH
"Root directory to search for VRJOGL")
if(DEFINED VRJUGGLER22_ROOT_DIR)
mark_as_advanced(VRJOGL22_ROOT_DIR)
endif()
if(NOT VRJOGL22_ROOT_DIR)
set(VRJOGL22_ROOT_DIR "${VRJUGGLER22_ROOT_DIR}")
endif()
set(_ROOT_DIR "${VRJOGL22_ROOT_DIR}")
find_library(VRJOGL22_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(VRJOGL22_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(VRJOGL22)
# Dependency
if(NOT VRJ22_FOUND)
find_package(VRJ22 ${_FIND_FLAGS})
endif()
if(NOT OPENGL_FOUND)
find_package(OpenGL ${_FIND_FLAGS})
endif()
if(APPLE)
set(VRJOGL22_AppKit_LIBRARY
"-framework AppKit"
CACHE
STRING
"AppKit framework for OSX")
set(VRJOGL22_Cocoa_LIBRARY
"-framework Cocoa"
CACHE
STRING
"Cocoa framework for OSX")
mark_as_advanced(VRJOGL22_AppKit_LIBRARY VRJOGL22_Cocoa_LIBRARY)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VRJOGL22
DEFAULT_MSG
VRJOGL22_LIBRARY
VRJ22_FOUND
VRJ22_LIBRARIES
VRJ22_INCLUDE_DIRS
OPENGL_FOUND
OPENGL_LIBRARIES)
if(VRJOGL22_FOUND)
set(_DEPS ${VRJ22_LIBRARIES} ${OPENGL_LIBRARIES})
if(APPLE)
list(APPEND
_DEPS
${VRJOGL22_AppKit_LIBRARY}
${VRJOGL22_Cocoa_LIBRARY})
endif()
set(VRJOGL22_INCLUDE_DIRS ${VRJ22_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS})
if(VRJUGGLER22_CREATE_IMPORTED_TARGETS)
create_imported_target(VRJOGL22 ${_DEPS})
else()
clean_library_list(VRJOGL22_LIBRARIES ${_DEPS})
endif()
mark_as_advanced(VRJOGL22_ROOT_DIR)
endif()
mark_as_advanced(VRJOGL22_LIBRARY_RELEASE VRJOGL22_LIBRARY_DEBUG)

View File

@ -0,0 +1,162 @@
# - try to find VRJuggler 3.0 OpenGL library
# Requires VRJ core 3.0 (thus FindVRJ30.cmake)
# Requires OpenGL.
# Optionally uses Flagpoll and FindFlagpoll.cmake
#
# This library is a part of VR Juggler 3.0 - you probably want to use
# find_package(VRJuggler30) instead, for an easy interface to this and
# related scripts. See FindVRJuggler30.cmake for more information.
#
# VRJOGL30_LIBRARY_DIR, library search path
# VRJOGL30_INCLUDE_DIRS, include search path for dependencies
# VRJOGL30_LIBRARY, the library to link against
# VRJOGL30_FOUND, If false, do not try to use this library.
#
# Plural versions refer to this library and its dependencies, and
# are recommended to be used instead, unless you have a good reason.
#
# Useful configuration variables you might want to add to your cache:
# VRJOGL30_ROOT_DIR - A directory prefix to search
# (a path that contains include/ as a subdirectory)
#
# This script will use Flagpoll, if found, to provide hints to the location
# of this library, but does not use the compiler flags returned by Flagpoll
# directly.
#
# The VJ_BASE_DIR environment variable is also searched (preferentially)
# when searching for this component, so most sane build environments should
# "just work." Note that you need to manually re-run CMake if you change
# this environment variable, because it cannot auto-detect this change
# and trigger an automatic re-run.
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
# Updated for VR Juggler 3.0 by:
# Brandon Newendorp <brandon@newendorp.com>
set(_HUMAN "VR Juggler 3.0 OpenGL Core")
set(_FP_PKG_NAME vrjuggler-opengl)
set(_RELEASE_NAMES)
set(_DEBUG_NAMES)
foreach(VER 3_0 3_0_0 3_0_1 3_0_2)
list(APPEND _RELEASE_NAMES vrj_ogl-${VER})
list(APPEND _DEBUG_NAMES vrj_ogl_d-${VER})
endforeach()
set(_DIR vrjuggler-3.0)
include(SelectLibraryConfigurations)
include(CreateImportedTarget)
include(CleanLibraryList)
include(CleanDirectoryList)
if(VRJOGL30_FIND_QUIETLY)
set(_FIND_FLAGS "QUIET")
else()
set(_FIND_FLAGS "")
endif()
# Try flagpoll.
find_package(Flagpoll QUIET)
if(FLAGPOLL)
flagpoll_get_library_dirs(${_FP_PKG_NAME} NO_DEPS)
flagpoll_get_library_names(${_FP_PKG_NAME} NO_DEPS)
endif()
set(VRJOGL30_ROOT_DIR
"${VRJOGL30_ROOT_DIR}"
CACHE
PATH
"Root directory to search for VRJOGL")
if(DEFINED VRJUGGLER30_ROOT_DIR)
mark_as_advanced(VRJOGL30_ROOT_DIR)
endif()
if(NOT VRJOGL30_ROOT_DIR)
set(VRJOGL30_ROOT_DIR "${VRJUGGLER30_ROOT_DIR}")
endif()
set(_ROOT_DIR "${VRJOGL30_ROOT_DIR}")
find_library(VRJOGL30_LIBRARY_RELEASE
NAMES
${_RELEASE_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBSUFFIXES}
DOC
"${_HUMAN} release library full path")
find_library(VRJOGL30_LIBRARY_DEBUG
NAMES
${_DEBUG_NAMES}
HINTS
"${_ROOT_DIR}"
${${_FP_PKG_NAME}_FLAGPOLL_LIBRARY_DIRS}
PATH_SUFFIXES
${_VRJ_LIBDSUFFIXES}
DOC
"${_HUMAN} debug library full path")
select_library_configurations(VRJOGL30)
# Dependency
if(NOT VRJ30_FOUND)
find_package(VRJ30 ${_FIND_FLAGS})
endif()
if(NOT OPENGL_FOUND)
find_package(OpenGL ${_FIND_FLAGS})
endif()
if(APPLE)
set(VRJOGL30_AppKit_LIBRARY
"-framework AppKit"
CACHE
STRING
"AppKit framework for OSX")
set(VRJOGL30_Cocoa_LIBRARY
"-framework Cocoa"
CACHE
STRING
"Cocoa framework for OSX")
mark_as_advanced(VRJOGL30_AppKit_LIBRARY VRJOGL30_Cocoa_LIBRARY)
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VRJOGL30
DEFAULT_MSG
VRJOGL30_LIBRARY
VRJ30_FOUND
VRJ30_LIBRARIES
VRJ30_INCLUDE_DIRS
OPENGL_FOUND
OPENGL_LIBRARIES)
if(VRJOGL30_FOUND)
set(_DEPS ${VRJ30_LIBRARIES} ${OPENGL_LIBRARIES})
if(APPLE)
list(APPEND
_DEPS
${VRJOGL30_AppKit_LIBRARY}
${VRJOGL30_Cocoa_LIBRARY})
endif()
set(VRJOGL30_INCLUDE_DIRS ${VRJ30_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS})
if(VRJUGGLER30_CREATE_IMPORTED_TARGETS)
create_imported_target(VRJOGL30 ${_DEPS})
else()
clean_library_list(VRJOGL30_LIBRARIES ${_DEPS})
endif()
mark_as_advanced(VRJOGL30_ROOT_DIR)
endif()
mark_as_advanced(VRJOGL30_LIBRARY_RELEASE VRJOGL30_LIBRARY_DEBUG)

Some files were not shown because too many files have changed in this diff Show More