From: <pat...@us...> - 2012-07-04 20:30:54
|
Revision: 690 http://xml-cppdom.svn.sourceforge.net/xml-cppdom/?rev=690&view=rev Author: patrickh Date: 2012-07-04 20:30:43 +0000 (Wed, 04 Jul 2012) Log Message: ----------- Add the CMake build developed by Ryan Pavlik. Modified Paths: -------------- trunk/ChangeLog Added Paths: ----------- trunk/CMakeLists.txt trunk/cmake/ trunk/cmake/AboutTheseModules.cmake trunk/cmake/BoostTestTargets.cmake trunk/cmake/BoostTestTargetsDynamic.h trunk/cmake/BoostTestTargetsIncluded.h trunk/cmake/BoostTestTargetsStatic.h trunk/cmake/BundleOSGPlugins.cmake trunk/cmake/BundleOSGRuntime.cmake trunk/cmake/BundleVRJ22Runtime.cmake trunk/cmake/BundleVRJ30Runtime.cmake trunk/cmake/CheckMacHIDAPI.cmake trunk/cmake/CheckMacHIDAPI.cpp trunk/cmake/CheckVersion.cmake trunk/cmake/CleanDirectoryList.cmake trunk/cmake/CleanLibraryList.cmake trunk/cmake/CopyResourcesToBuildTree.cmake trunk/cmake/CppcheckTargets.cmake trunk/cmake/CreateDashboardScripts.cmake trunk/cmake/CreateImportedTarget.cmake trunk/cmake/CreateLaunchers.cmake trunk/cmake/DashboardScript.cmake.in trunk/cmake/DoxygenTargets.cmake trunk/cmake/DoxygenTargets.doxyfile.in trunk/cmake/EnableExtraCompilerWarnings.cmake trunk/cmake/EnableProfiling.cmake trunk/cmake/FileCopyTargets.cmake trunk/cmake/FindALUT.cmake trunk/cmake/FindBluez.cmake trunk/cmake/FindCPPDOM.cmake trunk/cmake/FindDCubed.cmake trunk/cmake/FindFlagpoll.cmake trunk/cmake/FindGDB.cmake trunk/cmake/FindGHOST.cmake trunk/cmake/FindGLUI.cmake trunk/cmake/FindGLUT.cmake trunk/cmake/FindGMTL.cmake trunk/cmake/FindGPM.cmake trunk/cmake/FindGadgeteer12.cmake trunk/cmake/FindGadgeteer20.cmake trunk/cmake/FindGlove5DT.cmake trunk/cmake/FindHIDAPI.cmake trunk/cmake/FindJCCL12.cmake trunk/cmake/FindJCCL14.cmake trunk/cmake/FindJtTk.cmake trunk/cmake/FindJtTk.stampkey.cmake.in trunk/cmake/FindLAPACKLibs.cmake trunk/cmake/FindLibusb1.cmake trunk/cmake/FindLuabind.cmake trunk/cmake/FindLyX.cmake trunk/cmake/FindMacHID.cmake trunk/cmake/FindOpenCV.cmake trunk/cmake/FindOpenHaptics.cmake trunk/cmake/FindOpenHaptics.cpp trunk/cmake/FindParasolid.cmake trunk/cmake/FindSonix12.cmake trunk/cmake/FindSonix14.cmake trunk/cmake/FindTR1.cmake trunk/cmake/FindTooN.cmake trunk/cmake/FindTooNtag.cmake trunk/cmake/FindTweek12.cmake trunk/cmake/FindTweek14.cmake trunk/cmake/FindVPR20.cmake trunk/cmake/FindVPR22.cmake trunk/cmake/FindVPS.cmake trunk/cmake/FindVRJ22.cmake trunk/cmake/FindVRJ30.cmake trunk/cmake/FindVRJOGL22.cmake trunk/cmake/FindVRJOGL30.cmake trunk/cmake/FindVRJuggler.cmake trunk/cmake/FindVRJuggler22.cmake trunk/cmake/FindVRJuggler30.cmake trunk/cmake/FindVRPN.cmake trunk/cmake/FindVirtuoseAPI.cmake trunk/cmake/FindVirtuoseVPP.cmake trunk/cmake/FindWiiSCAAT.cmake trunk/cmake/FindWiiUse.cmake trunk/cmake/FindWinHID.cmake trunk/cmake/Findargp.cmake trunk/cmake/Findcppcheck.cmake trunk/cmake/Findcppcheck.cpp trunk/cmake/Findcppunit.cmake trunk/cmake/Findcutil.cmake trunk/cmake/Finddb2pdf.cmake trunk/cmake/FindosgLua.cmake trunk/cmake/Findquatlib.cmake trunk/cmake/GetCPUDetails.cmake trunk/cmake/GetCompilerInfoString.cmake trunk/cmake/GetDirectoryList.cmake trunk/cmake/GetFileList.cmake trunk/cmake/GetForceIncludeDefinitions.cmake trunk/cmake/GetGitRevisionDescription.cmake trunk/cmake/GetGitRevisionDescription.cmake.in trunk/cmake/GetSubprojectStatus.cmake trunk/cmake/LICENSE_1_0.txt trunk/cmake/Licensing.cmake trunk/cmake/ListCombinations.cmake trunk/cmake/ListFilter.cmake trunk/cmake/LuaTargets.cmake trunk/cmake/MSVCMultipleProcessCompile.cmake trunk/cmake/MSVCStaticRuntime.cmake trunk/cmake/MSVCVerboseLinking.cmake trunk/cmake/MakeVRJugglerAppBundle.cmake trunk/cmake/MakeVRJugglerAppBundle30.cmake trunk/cmake/OptionRequires.cmake trunk/cmake/PrefixListGlob.cmake trunk/cmake/ProgramFilesGlob.cmake trunk/cmake/README.markdown trunk/cmake/ResetConfigurations.cmake trunk/cmake/SearchProgramFilesForOpenSceneGraph.cmake trunk/cmake/SetDefaultBuildType.cmake trunk/cmake/SplitLibraryList.cmake trunk/cmake/StampSourcesWithVersion.cmake trunk/cmake/StampSourcesWithVersion.sed.in trunk/cmake/TCHARWorkaround.cmake trunk/cmake/UseBackportedModules.cmake trunk/cmake/UseTR1.cmake trunk/cmake/WarningDev.cmake trunk/cmake/cmake-2.8.0-modules/ trunk/cmake/cmake-2.8.0-modules/features/ trunk/cmake/cmake-2.8.0-modules/features/SelectLibraryConfigurations.cmake trunk/cmake/cmake-2.8.0-modules/osg/ trunk/cmake/cmake-2.8.0-modules/osg/FindOpenSceneGraph.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindOpenThreads.cmake trunk/cmake/cmake-2.8.0-modules/osg/Findosg.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgAnimation.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgDB.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgFX.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgGA.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgIntrospection.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgManipulator.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgParticle.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgProducer.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgShadow.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgSim.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgTerrain.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgText.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgUtil.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgViewer.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgVolume.cmake trunk/cmake/cmake-2.8.0-modules/osg/FindosgWidget.cmake trunk/cmake/cmake-2.8.0-modules/osg/Findosg_functions.cmake trunk/cmake/cmake-2.8.1-modules/ trunk/cmake/cmake-2.8.1-modules/patchctestbug10149/ trunk/cmake/cmake-2.8.1-modules/patchctestbug10149/CTest.cmake trunk/cmake/cmake-2.8.1-modules/patchctestbug10149/CTestScriptMode.cmake trunk/cmake/cmake-2.8.1-modules/patchctestbug10149/CTestTargets.cmake trunk/cmake/cmake-2.8.3-modules/ trunk/cmake/cmake-2.8.3-modules/FixWinInstallPrefix.cmake trunk/cmake/cmake-2.8.3-modules/autoinclude.cmake trunk/cmake/cmake-2.8.4-modules/ trunk/cmake/cmake-2.8.4-modules/ImproveEclipseGCCErrors.cmake trunk/cmake/cmake-2.8.4-modules/autoinclude.cmake trunk/cmake/cmake-2.8.4-modules/boost/ trunk/cmake/cmake-2.8.4-modules/boost/FindBoost.cmake trunk/cmake/cmake-2.9.0-modules/ trunk/cmake/cmake-2.9.0-modules/RequireOutOfSourceBuild.cmake trunk/cmake/cmake-2.9.0-modules/autoinclude.cmake trunk/cmake/export-to-directory.sh trunk/cmake/ghost-fake-stl/ trunk/cmake/ghost-fake-stl/iostream.h trunk/cmake/ghost-fake-stl/list.h trunk/cmake/ghost-fake-stl/set.h trunk/cmake/ghost-fake-stl/vector.h trunk/cmake/launcher-templates/ trunk/cmake/launcher-templates/genericlauncher.cmd.in trunk/cmake/launcher-templates/genericlauncher.sh.in trunk/cmake/launcher-templates/launcher.env.cmd.in trunk/cmake/launcher-templates/launcher.env.sh.in trunk/cmake/launcher-templates/perconfig.vcproj.user.in trunk/cmake/launcher-templates/targetlauncher.cmd.in trunk/cmake/launcher-templates/targetlauncher.sh.in trunk/cmake/launcher-templates/vcproj.user.in trunk/cmake/module-docs/ trunk/cmake/module-docs/AllModuleDependencies.dot trunk/cmake/module-docs/Example-FindMyPackage-UsingImportedTargets.cmake trunk/cmake/module-docs/Example-FindMyPackage.cmake trunk/cmake/module-docs/Example-FindMySimplePackage.cmake trunk/cmake/module-help.html trunk/cmake/module-help.txt trunk/cmake/nested_targets/ trunk/cmake/nested_targets/DCubed/ trunk/cmake/nested_targets/DCubed/CMakeLists.txt trunk/cmake/nested_targets/DCubed/d3ew_p/ trunk/cmake/nested_targets/DCubed/d3ew_p/CMakeLists.txt trunk/cmake/nested_targets/DCubed/d3ew_scene/ trunk/cmake/nested_targets/DCubed/d3ew_scene/CMakeLists.txt trunk/cmake/nested_targets/OpenHaptics/ trunk/cmake/nested_targets/OpenHaptics/CMakeLists.txt trunk/cmake/nested_targets/Parasolid/ trunk/cmake/nested_targets/Parasolid/CMakeLists.txt trunk/cmake/nested_targets/cutil/ trunk/cmake/nested_targets/cutil/CMakeLists.txt trunk/cmake/package/ trunk/cmake/package/macosx/ trunk/cmake/package/macosx/Resources/ trunk/cmake/package/macosx/Resources/en.lproj/ trunk/cmake/package/macosx/Resources/en.lproj/MainMenu.nib/ trunk/cmake/package/macosx/Resources/en.lproj/MainMenu.nib/classes.nib trunk/cmake/package/macosx/Resources/en.lproj/MainMenu.nib/info.nib trunk/cmake/package/macosx/Resources/vrjuggler.plist trunk/cmake/package/macosx/VRJuggler22BundleInfo.plist.in trunk/cmake/package/macosx/VRJuggler30BundleInfo.plist.in trunk/cmake/package/macosx/fixupbundle.cmake.in trunk/cmake/package-licensing/ trunk/cmake/package-licensing/Boost.cmake trunk/cmake/package-licensing/Eigen.cmake trunk/cmake/package-licensing/FLTK.cmake trunk/cmake/package-licensing/Lua.cmake trunk/cmake/package-licensing/LuaBind.cmake trunk/cmake/package-licensing/OpenHapticsAcademicEdition.cmake trunk/cmake/package-licensing/OpenSceneGraph.cmake trunk/cmake/package-licensing/PhysicalModelingUtils.cmake trunk/cmake/package-licensing/Qt-LGPL.cmake trunk/cmake/package-licensing/VPS.cmake trunk/cmake/package-licensing/VRJuggLua.cmake trunk/cmake/package-licensing/VRJuggler.cmake trunk/cmake/package-licensing/VirtuoseAPI.cmake trunk/cmake/package-licensing/osgLua.cmake trunk/cmake/update-help.sh trunk/cmake/workarounds/ trunk/cmake/workarounds/mac-alut-framework/ trunk/cmake/workarounds/mac-alut-framework/AL/ trunk/cmake/workarounds/mac-alut-framework/AL/alut.h trunk/cmake/workarounds/mac-gl/ trunk/cmake/workarounds/mac-gl/GL/ trunk/cmake/workarounds/mac-gl/GL/gl.h trunk/cmake/workarounds/mac-gl/GL/glui.h trunk/cmake/workarounds/mac-gl/GL/glut.h trunk/cmake/workarounds/mac-openal/ trunk/cmake/workarounds/mac-openal/AL/ trunk/cmake/workarounds/mac-openal/AL/al.h trunk/cmake/workarounds/mac-openal/AL/alc.h trunk/cmake/workarounds/tchar/ trunk/cmake/workarounds/tchar/tchar.h trunk/cppdom/CMakeLists.txt trunk/test/CMakeLists.txt trunk/test/suite/CMakeLists.txt Added: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt (rev 0) +++ trunk/CMakeLists.txt 2012-07-04 20:30:43 UTC (rev 690) @@ -0,0 +1,100 @@ +# CMake-based build system for cppdom +# 2009-2011 Ryan Pavlik <rp...@ia...> +# http://academic.cleardefinition.com/ +# Iowa State University HCI Graduate Program/VRAC + +cmake_minimum_required(VERSION 2.6.2) + +# Set package properties +project(cppdom) + +set(CPACK_PACKAGE_VERSION_MAJOR "1") +set(CPACK_PACKAGE_VERSION_MINOR "0") +set(CPACK_PACKAGE_VERSION_PATCH "3") +set(CPACK_PACKAGE_VERSION + "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") +set(VERSION_UNDERSCORES "${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR}_${CPACK_PACKAGE_VERSION_PATCH}") +### +# Set up options +### + +# Define directories +set(BIN_DIR bin) +set(ARCH_DIR lib) +set(FLAGPOLL_INFO_DIR share/flagpoll) +if(WIN32) + set(LIB_DIR bin) + set(INCLUDE_DIR include) +else() + set(LIB_DIR lib) + set(INCLUDE_DIR include/cppdom-${CPACK_PACKAGE_VERSION}) +endif() + +# Create flagpoll file +set(provides "cppdom") +set(version "${CPACK_PACKAGE_VERSION}") +set(prefix "\${fp_file_cwd}/../..") +set(exec_prefix "\${prefix}") +set(includedir "\${fp_file_cwd}/../../${INCLUDE_DIR}") +set(libdir "\${fp_file_cwd}/../../${LIB_DIR}") +# TODO this is not ideal/complete +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(arch "x86_64") +else() + set(arch "x86") +endif() +if(CMAKE_COMPILER_IS_GNUCXX) + set(cppdom_cxxflags "-Wno-deprecated") + set(include_path_flag "-I") + set(cppdom_libs "-lcppdom-${VERSION_UNDERSCORES}") + set(lib_path_flag "-L") +elseif(MSVC) + set(include_path_flag "/I") + set(lib_path_flag "/L") +else() + message(FATAL_ERROR "Compiler not recognized - can't generate values for Flagpoll file") +endif() + +configure_file(cppdom.fpc.in "${CMAKE_CURRENT_BINARY_DIR}/cppdom.fpc" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cppdom.fpc" + DESTINATION ${FLAGPOLL_INFO_DIR} + COMPONENT Development) + +### +# Perform build configuration of dependencies +### +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +include(UseBackportedModules) +include(CTest) + +find_package(Boost) + +### +# Build the project +### + +include_directories(.) +add_subdirectory(cppdom) + +add_subdirectory(test) + +### +# Set packaging options (for CPack) +### + +# Choose desired package generators +if(APPLE) + set(CPACK_GENERATOR DragNDrop) + set(CPACK_SOURCE_GENERATOR ZIP) +elseif(WIN32) + set(CPACK_SOURCE_GENERATOR ZIP) +else() + set(CPACK_SOURCE_GENERATOR TARGZ) +endif() + +# Include the packaging system now that we have it all set up +include(CPack) + +### +# End Packaging +### Property changes on: trunk/CMakeLists.txt ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2012-07-04 20:24:18 UTC (rev 689) +++ trunk/ChangeLog 2012-07-04 20:30:43 UTC (rev 690) @@ -1,5 +1,8 @@ DATE AUTHOR CHANGE ---------- ----------- ------------------------------------------------------- +2012-07-04 patrickh Add CMake build. + Developed by Ryan Pavlik. + [Version 1.2.0 released - 5.1.2011]============================================ 2011-04-23 patrickh SCons 2.0 is now the minimum required version. Added: trunk/cmake/AboutTheseModules.cmake =================================================================== --- trunk/cmake/AboutTheseModules.cmake (rev 0) +++ trunk/cmake/AboutTheseModules.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -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) + Property changes on: trunk/cmake/AboutTheseModules.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/BoostTestTargets.cmake =================================================================== --- trunk/cmake/BoostTestTargets.cmake (rev 0) +++ trunk/cmake/BoostTestTargets.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -0,0 +1,274 @@ +# - 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 <rp...@ia...> <ab...@ry...> +# 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() + if("${CMAKE_VERSION}" VERSION_LESS "2.8.0") + if(NOT "${_boost_test_cmakever_pestered}x" EQUALS "${CMAKE_VERSION}x") + message(STATUS + "Not adding boost::test targets - CMake 2.8.0 or newer required, using ${CMAKE_VERSION}") + set(_boost_test_cmakever_pestered + "${CMAKE_VERSION}" + CACHE + INTERNAL + "" + FORCE) + endif() + 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 + ${_name}-${_test} + COMMAND + ${_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 + ${_name}-boost_test + COMMAND + ${_test_command} + ${Boost_TEST_FLAGS}) + if(FAIL_REGULAR_EXPRESSION) + set_tests_properties(${_name}-${_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() Property changes on: trunk/cmake/BoostTestTargets.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/BoostTestTargetsDynamic.h =================================================================== --- trunk/cmake/BoostTestTargetsDynamic.h (rev 0) +++ trunk/cmake/BoostTestTargetsDynamic.h 2012-07-04 20:30:43 UTC (rev 690) @@ -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> + Property changes on: trunk/cmake/BoostTestTargetsDynamic.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/BoostTestTargetsIncluded.h =================================================================== --- trunk/cmake/BoostTestTargetsIncluded.h (rev 0) +++ trunk/cmake/BoostTestTargetsIncluded.h 2012-07-04 20:30:43 UTC (rev 690) @@ -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> Property changes on: trunk/cmake/BoostTestTargetsIncluded.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/BoostTestTargetsStatic.h =================================================================== --- trunk/cmake/BoostTestTargetsStatic.h (rev 0) +++ trunk/cmake/BoostTestTargetsStatic.h 2012-07-04 20:30:43 UTC (rev 690) @@ -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> Property changes on: trunk/cmake/BoostTestTargetsStatic.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/BundleOSGPlugins.cmake =================================================================== --- trunk/cmake/BundleOSGPlugins.cmake (rev 0) +++ trunk/cmake/BundleOSGPlugins.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -0,0 +1,83 @@ +# - 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 <rp...@ia...> <ab...@ry...> +# 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}") + get_filename_component(name "${plugin}" NAME) + list(APPEND INSTALLEDPLUGINS "${OSG_PATH_TO_PLUGINS}/${name}") + endforeach() + set(${var} ${INSTALLEDPLUGINS} PARENT_SCOPE) +endfunction() Property changes on: trunk/cmake/BundleOSGPlugins.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/BundleOSGRuntime.cmake =================================================================== --- trunk/cmake/BundleOSGRuntime.cmake (rev 0) +++ trunk/cmake/BundleOSGRuntime.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -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 <rp...@ia...> <ab...@ry...> +# 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() Property changes on: trunk/cmake/BundleOSGRuntime.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/BundleVRJ22Runtime.cmake =================================================================== --- trunk/cmake/BundleVRJ22Runtime.cmake (rev 0) +++ trunk/cmake/BundleVRJ22Runtime.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -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 <rp...@ia...> <ab...@ry...> +# 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() Property changes on: trunk/cmake/BundleVRJ22Runtime.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/BundleVRJ30Runtime.cmake =================================================================== --- trunk/cmake/BundleVRJ30Runtime.cmake (rev 0) +++ trunk/cmake/BundleVRJ30Runtime.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -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 <rp...@ia...> <ab...@ry...> +# http://academic.cleardefinition.com +# Iowa State University HCI Graduate Program/VRAC +# Updated for VR Juggler 3.0 by: +# Brandon Newendorp <br...@ne...> + +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() Property changes on: trunk/cmake/BundleVRJ30Runtime.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/CheckMacHIDAPI.cmake =================================================================== --- trunk/cmake/CheckMacHIDAPI.cmake (rev 0) +++ trunk/cmake/CheckMacHIDAPI.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -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 <rp...@ia...> <ab...@ry...> +# 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() Property changes on: trunk/cmake/CheckMacHIDAPI.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/CheckMacHIDAPI.cpp =================================================================== --- trunk/cmake/CheckMacHIDAPI.cpp (rev 0) +++ trunk/cmake/CheckMacHIDAPI.cpp 2012-07-04 20:30:43 UTC (rev 690) @@ -0,0 +1,47 @@ +/** + * \file CheckMacHIDAPI.cpp + * \brief C++ source file used by CMake module CheckMacHIDAPI.cmake + * + * \author + * Ryan Pavlik, 2009-2010 + * <rp...@ia...> + * 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; + bool _gotdata; + int _gotsize; + unsigned char _buffer[512]; + IOReturn result = (*_interface)->setInterruptReportHandlerCallback(_interface, + _buffer, 512, + ReaderReportCallback, + NULL, 0); +#endif + return 0; +} Property changes on: trunk/cmake/CheckMacHIDAPI.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/CheckVersion.cmake =================================================================== --- trunk/cmake/CheckVersion.cmake (rev 0) +++ trunk/cmake/CheckVersion.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -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 <rp...@ia...> <ab...@ry...> +# 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() Property changes on: trunk/cmake/CheckVersion.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/CleanDirectoryList.cmake =================================================================== --- trunk/cmake/CleanDirectoryList.cmake (rev 0) +++ trunk/cmake/CleanDirectoryList.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -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 <rp...@ia...> <ab...@ry...> +# 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() Property changes on: trunk/cmake/CleanDirectoryList.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/CleanLibraryList.cmake =================================================================== --- trunk/cmake/CleanLibraryList.cmake (rev 0) +++ trunk/cmake/CleanLibraryList.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -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 <rp...@ia...> <ab...@ry...> +# 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() Property changes on: trunk/cmake/CleanLibraryList.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/CopyResourcesToBuildTree.cmake =================================================================== --- trunk/cmake/CopyResourcesToBuildTree.cmake (rev 0) +++ trunk/cmake/CopyResourcesToBuildTree.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -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 <rp...@ia...> <ab...@ry...> +# 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() Property changes on: trunk/cmake/CopyResourcesToBuildTree.cmake ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cmake/CppcheckTargets.cmake =================================================================== --- trunk/cmake/CppcheckTargets.cmake (rev 0) +++ trunk/cmake/CppcheckTargets.cmake 2012-07-04 20:30:43 UTC (rev 690) @@ -0,0 +1,213 @@ +# - Run cppcheck on c++ source files as a custom target and a test +# +# include(CppcheckTargets) +# add_cppcheck(<target-name> [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR] [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] [FAIL_ON_WARNINGS]) - +# Create a target to check standalone sources with cppcheck and the indicated options +# +# Requires these CMake modules: +# Findcppcheck +# +# Requires CMake 2.6 or newer (uses the 'function' command) +# +# Original Author: +# 2009-2010 Ryan Pavlik <rp...@ia...> <ab...@ry...> +# 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_cppcheck) + return() +endif() +set(__add_cppcheck YES) + +if(NOT CPPCHECK_FOUND) + find_package(cppcheck QUIET) +endif() + +if(CPPCHECK_FOUND) + if(NOT TARGET all_cppcheck) + add_custom_target(all_cppcheck) + set_target_properties(all_cppcheck PROPERTIES EXCLUDE_FROM_ALL TRUE) + endif() +endif() + +function(add_cppcheck_sources _targetname) + if(CPPCHECK_FOUND) + set(_cppcheck_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 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}" MATCHES "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_command(TARGET + all_cppcheck + PRE_BUILD + 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) + 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) + + 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 _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_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}" M... [truncated message content] |