Squashed 'cmake/' content from commit 2d25566
git-subtree-dir: cmake git-subtree-split: 2d25566a1c5162ce3fd6bfc268d5665de182af89
This commit is contained in:
72
module-docs/AllModuleDependencies.dot
Normal file
72
module-docs/AllModuleDependencies.dot
Normal file
@@ -0,0 +1,72 @@
|
||||
digraph {
|
||||
size="7.5,10"
|
||||
nodesep = .25
|
||||
ranksep = 1.0
|
||||
label = "Dependencies of CMake Modules - All require CMake 2.6 or newer";
|
||||
|
||||
subgraph cluster_upstream {
|
||||
label = "Included with upstream 2.8.0 or cmake-2.8.0-modules";
|
||||
SelectLibraryConfigurations;
|
||||
FindBoost;
|
||||
FindOpenSceneGraph -> { FindOpenThreads; FindosgALL [label = "Findosg*"]; }
|
||||
}
|
||||
|
||||
// Directories
|
||||
PackageMacosxDirectory [label = "cmake/package/macosx/"];
|
||||
workaroundsTcharDirectory [label = "cmake/workarounds/tchar/"];
|
||||
cmakeUpstreamModulesDirectories [label = "cmake/cmake-*-modules/"];
|
||||
|
||||
// other Modules
|
||||
BundleOSGRuntime;
|
||||
BundleVRJ22Runtime;
|
||||
CheckMacHIDAPI;
|
||||
CheckVersion;
|
||||
CleanDirectoryList;
|
||||
CleanLibraryList;
|
||||
CreateMSVCUserFiles -> { ListFilter; ProgramFilesGlob; CleanDirectoryList; }
|
||||
FixWinInstallPrefix;
|
||||
GetCompilerInfoString;
|
||||
GetForceIncludeDefinitions;
|
||||
ListCombinations;
|
||||
ListFilter;
|
||||
MakeVRJugglerAppBundle -> PackageMacosxDirectory;
|
||||
PrefixListGlob;
|
||||
ProgramFilesGlob -> { PrefixListGlob; CleanDirectoryList;}
|
||||
SearchProgramFilesForOpenSceneGraph -> { ProgramFilesGlob; ListFilter; PrefixListGlob; CleanDirectoryList; }
|
||||
|
||||
|
||||
subgraph cluster_findmodules {
|
||||
label = "find_package Find Modules";
|
||||
|
||||
subgraph cluster_vrjuggler22 {
|
||||
label = "VR Juggler 2.2 suite: All require CleanLibraryList and CleanDirectoryList, and recommend FindFlagpoll";
|
||||
FindTweek12 -> FindVPR20;
|
||||
FindJCCL12 -> FindVPR20;
|
||||
FindGadgeteer12 -> { FindJCCL12; FindVPR20; }
|
||||
FindSonix12 -> FindVPR20;
|
||||
FindVRJ22 -> { FindJCCL12; FindGadgeteer12; FindSonix12; FindVPR20; }
|
||||
FindVRJOGL22 -> FindVRJ22;
|
||||
FindVRJuggler22 -> FindVRJOGL22;
|
||||
} -> {FindFlagpoll; CleanLibraryList; CleanDirectoryList;}
|
||||
FindVPR20 -> { FindBoost; FindCPPDOM; }
|
||||
FindGadgeteer12 -> FindGMTL;
|
||||
FindSonix12 -> FindGMTL;
|
||||
//cluster_vrjuggler22 -> {FindFlagpoll; CleanLibraryList;}
|
||||
BundleVRJ22Runtime -> FindVRJuggler22;
|
||||
|
||||
FindGLUI;
|
||||
FindGPM;
|
||||
FindJtTk -> { ListCombinations; CheckVersion; PrefixListGlob; ProgramFilesGlob; }
|
||||
FindMacHID -> CheckMacHIDAPI;
|
||||
FindOpenHaptics -> { SelectLibraryConfigurations; CleanDirectoryList; CleanLibraryList; ListCombinations; ProgramFilesGlob; }
|
||||
FindParasolid -> { ListCombinations; CheckVersion; ProgramFilesGlob; }
|
||||
Findquatlib;
|
||||
FindVPS -> { SelectLibraryConfigurations; ListCombinations; CheckVersion; ListFilter; }
|
||||
FindWiiUse;
|
||||
}
|
||||
|
||||
|
||||
|
||||
TCHARWorkaround -> workaroundsTcharDirectory;
|
||||
UseBackportedModules -> cmakeUpstreamModulesDirectories;
|
||||
}
|
||||
BIN
module-docs/AllModuleDependencies.jpg
Normal file
BIN
module-docs/AllModuleDependencies.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
module-docs/AllModuleDependencies.pdf
Normal file
BIN
module-docs/AllModuleDependencies.pdf
Normal file
Binary file not shown.
BIN
module-docs/AllModuleDependencies.png
Normal file
BIN
module-docs/AllModuleDependencies.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
193
module-docs/Example-FindMyPackage-UsingImportedTargets.cmake
Normal file
193
module-docs/Example-FindMyPackage-UsingImportedTargets.cmake
Normal file
@@ -0,0 +1,193 @@
|
||||
# - try to find MyPackage library
|
||||
#
|
||||
# Example-FindMyPackage-UsingImportedTargets.cmake
|
||||
#
|
||||
# This module does the same thing as Example-FindMyPackage.cmake
|
||||
# except that rather than passing along full path names for libraries,
|
||||
# it creates imported targets. The end result is roughly the same to
|
||||
# the end-user. Please see that other file for the full documentation
|
||||
# of the example.
|
||||
#
|
||||
# Note that if you're going to be installing target export files, this
|
||||
# is probably what you should prefer. See cmake mailing list archives.
|
||||
#
|
||||
# Start of what would be a minimal module documentation block:
|
||||
#
|
||||
# Cache Variables: (not for direct use in CMakeLists.txt)
|
||||
# MYPACKAGE_ROOT
|
||||
# MYPACKAGE_LIBRARY
|
||||
# MYPACKAGE_INCLUDE_DIR
|
||||
# MYPACKAGE_a_LIBRARY
|
||||
# MYPACKAGE_a_INCLUDE_DIR
|
||||
# MYPACKAGE_b_LIBRARY
|
||||
# MYPACKAGE_b_INCLUDE_DIR
|
||||
# MYPACKAGE_c_LIBRARY
|
||||
# MYPACKAGE_c_INCLUDE_DIR
|
||||
#
|
||||
# Non-cache variables you might use in your CMakeLists.txt:
|
||||
# MYPACKAGE_FOUND
|
||||
#
|
||||
# MYPACKAGE_LIBRARIES
|
||||
# MYPACKAGE_INCLUDE_DIRS
|
||||
# MYPACKAGE_LINKER_FLAGS
|
||||
#
|
||||
# MYPACKAGE_a_LIBRARIES
|
||||
# MYPACKAGE_a_INCLUDE_DIRS
|
||||
# MYPACKAGE_a_LINKER_FLAGS
|
||||
#
|
||||
# MYPACKAGE_b_LIBRARIES
|
||||
# MYPACKAGE_b_INCLUDE_DIRS
|
||||
# MYPACKAGE_b_LINKER_FLAGS
|
||||
#
|
||||
# MYPACKAGE_c_LIBRARIES
|
||||
# MYPACKAGE_c_INCLUDE_DIRS
|
||||
# MYPACKAGE_c_LINKER_FLAGS
|
||||
#
|
||||
# Use this module this way:
|
||||
# find_package(MyPackage)
|
||||
# include_directories(${MYPACKAGE_INCLUDE_DIRS})
|
||||
# add_executable(myapp ${SOURCES})
|
||||
# target_link_libraries(myapp ${MYPACKAGE_LIBRARIES})
|
||||
# set_property(TARGET myapp PROPERTY LINK_FLAGS ${MYPACKAGE_LINKER_FLAGS})
|
||||
#
|
||||
# Requires these CMake modules:
|
||||
# FindPackageHandleStandardArgs (CMake standard module)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
|
||||
set(MYPACKAGE_ROOT
|
||||
"${MYPACKAGE_ROOT}"
|
||||
CACHE
|
||||
PATH
|
||||
"Root directory to look in")
|
||||
|
||||
find_library(MYPACKAGE_LIBRARY
|
||||
NAMES
|
||||
mypackagecore
|
||||
PATHS
|
||||
"${MYPACKAGE_ROOT}"
|
||||
PATH_SUFFIXES
|
||||
lib)
|
||||
|
||||
find_path(MYPACKAGE_INCLUDE_DIR
|
||||
NAMES
|
||||
mypackage/mypackage.h
|
||||
PATHS
|
||||
"${MYPACKAGE_ROOT}"
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
|
||||
# Assuming that the components are named libmypackagea, libmypackageb, etc
|
||||
foreach(lib a b c)
|
||||
find_library(MYPACKAGE_${lib}_LIBRARY
|
||||
NAMES
|
||||
mypackage${lib}
|
||||
PATHS
|
||||
"${MYPACKAGE_ROOT}"
|
||||
PATH_SUFFIXES
|
||||
lib)
|
||||
|
||||
find_path(MYPACKAGE_${lib}_INCLUDE_DIR
|
||||
NAMES
|
||||
mypackage/${lib}/${lib}.h
|
||||
PATHS
|
||||
"${MYPACKAGE_ROOT}"
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
|
||||
endforeach()
|
||||
|
||||
# see /usr/share/cmake-2.x/Modules/FindBLAS.cmake for the variables this will define
|
||||
if(NOT BLAS_FOUND)
|
||||
find_package(BLAS QUIETLY)
|
||||
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(MyPackage
|
||||
DEFAULT_MSG
|
||||
MYPACKAGE_LIBRARY
|
||||
MYPACKAGE_INCLUDE_DIR
|
||||
MYPACKAGE_a_LIBRARY
|
||||
MYPACKAGE_a_INCLUDE_DIR
|
||||
MYPACKAGE_b_LIBRARY
|
||||
MYPACKAGE_b_INCLUDE_DIR
|
||||
MYPACKAGE_c_LIBRARY
|
||||
MYPACKAGE_c_INCLUDE_DIR
|
||||
BLAS_FOUND)
|
||||
|
||||
if(MYPACKAGE_FOUND)
|
||||
# Set variables containing libraries and their dependencies
|
||||
# Always use the plural form for the variables defined by other find modules:
|
||||
# they might have dependencies too!
|
||||
|
||||
add_library(mypackage_c IMPORTED)
|
||||
set_target_properties(mypackage_c
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${MYPACKAGE_c_LIBRARY}
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES
|
||||
${BLAS_LIBRARIES})
|
||||
set(MYPACKAGE_c_LIBRARIES mypackage_c)
|
||||
set(MYPACKAGE_c_INCLUDE_DIRS ${MYPACKAGE_c_INCLUDE_DIR}) # No include dir for BLAS?
|
||||
set(MYPACKAGE_c_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
|
||||
|
||||
add_library(mypackage_b IMPORTED)
|
||||
set_target_properties(mypackage_b
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${MYPACKAGE_b_LIBRARY}
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES
|
||||
${MYPACKAGE_c_LIBRARIES})
|
||||
set(MYPACKAGE_b_LIBRARIES mypackage_b)
|
||||
set(MYPACKAGE_b_INCLUDE_DIRS
|
||||
${MYPACKAGE_b_INCLUDE_DIR}
|
||||
${MYPACKAGE_c_INCLUDE_DIRS})
|
||||
set(MYPACKAGE_b_LINKER_FLAGS ${MYPACKAGE_c_LINKER_FLAGS})
|
||||
|
||||
add_library(mypackage_a IMPORTED)
|
||||
set_target_properties(mypackage_a
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${MYPACKAGE_a_LIBRARY}
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES
|
||||
${MYPACKAGE_b_LIBRARIES})
|
||||
set(MYPACKAGE_a_LIBRARIES mypackage_a)
|
||||
set(MYPACKAGE_a_INCLUDE_DIRS
|
||||
${MYPACKAGE_a_INCLUDE_DIR}
|
||||
${MYPACKAGE_b_INCLUDE_DIRS})
|
||||
set(MYPACKAGE_a_LINKER_FLAGS ${MYPACKAGE_b_LINKER_FLAGS})
|
||||
|
||||
add_library(mypackage_core IMPORTED)
|
||||
set_target_properties(mypackage_core
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION
|
||||
${MYPACKAGE_LIBRARY}
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES
|
||||
${MYPACKAGE_a_LIBRARIES})
|
||||
set(MYPACKAGE_LIBRARIES mypackage_core)
|
||||
set(MYPACKAGE_INCLUDE_DIRS
|
||||
${MYPACKAGE_INCLUDE_DIR}
|
||||
${MYPACKAGE_a_INCLUDE_DIRS})
|
||||
set(MYPACKAGE_LINKER_FLAGS ${MYPACKAGE_a_LINKER_FLAGS})
|
||||
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MYPACKAGE_LIBRARY
|
||||
MYPACKAGE_INCLUDE_DIR
|
||||
MYPACKAGE_a_LIBRARY
|
||||
MYPACKAGE_a_INCLUDE_DIR
|
||||
MYPACKAGE_b_LIBRARY
|
||||
MYPACKAGE_b_INCLUDE_DIR
|
||||
MYPACKAGE_c_LIBRARY
|
||||
MYPACKAGE_c_INCLUDE_DIR)
|
||||
|
||||
if(MYPACKAGE_FOUND)
|
||||
mark_as_advanced(MYPACKAGE_ROOT)
|
||||
endif()
|
||||
|
||||
# End of Example-FindMyPackage-UsingImportedTargets.cmake
|
||||
189
module-docs/Example-FindMyPackage.cmake
Normal file
189
module-docs/Example-FindMyPackage.cmake
Normal file
@@ -0,0 +1,189 @@
|
||||
# - try to find MyPackage library
|
||||
#
|
||||
# Example-FindMyPackage.cmake
|
||||
#
|
||||
# This example is for a fairly in-depth library that has four
|
||||
# internal dependencies as well as an external dependency.
|
||||
# The dependency tree is described below, in graphviz/dot format, and you
|
||||
# can remove the #'s from the following lines and run it through graphviz,
|
||||
# with this command: dot dependencies.dot -O -Tpdf
|
||||
#
|
||||
# --- start of dependencies.dot ---
|
||||
# digraph {
|
||||
# BLAS;
|
||||
# subgraph cluster_mypackage {
|
||||
# label = "Components that are part of MyPackage";
|
||||
# libmypackagecore -> libmypackagea;
|
||||
# libmypackagea -> libmypackageb;
|
||||
# libmypackageb -> libmypackagec;
|
||||
# libmypackagec -> BLAS;
|
||||
# }
|
||||
# }
|
||||
# --- end of dependencies.dot ---
|
||||
#
|
||||
# Because our imaginary component "c" requires BLAS and BLAS needs some
|
||||
# linker flags, MYPACKAGE_..._LINKER_FLAGS joins the usual group of
|
||||
# _LIBRARY/_LIBRARIES and _INCLUDE_DIR/_INCLUDE_DIRS variables. If
|
||||
# you don't use a library like that, you don't need to include the
|
||||
# lines dealing with that group of variables.
|
||||
#
|
||||
# Most library aren't nearly this complex - but some are, and many
|
||||
# have some parts of the complexity handled here.
|
||||
#
|
||||
# Start of what would be a minimal module documentation block:
|
||||
#
|
||||
# Cache Variables: (not for direct use in CMakeLists.txt)
|
||||
# MYPACKAGE_ROOT
|
||||
# MYPACKAGE_LIBRARY
|
||||
# MYPACKAGE_INCLUDE_DIR
|
||||
# MYPACKAGE_a_LIBRARY
|
||||
# MYPACKAGE_a_INCLUDE_DIR
|
||||
# MYPACKAGE_b_LIBRARY
|
||||
# MYPACKAGE_b_INCLUDE_DIR
|
||||
# MYPACKAGE_c_LIBRARY
|
||||
# MYPACKAGE_c_INCLUDE_DIR
|
||||
#
|
||||
# Non-cache variables you might use in your CMakeLists.txt:
|
||||
# MYPACKAGE_FOUND
|
||||
#
|
||||
# MYPACKAGE_LIBRARIES
|
||||
# MYPACKAGE_INCLUDE_DIRS
|
||||
# MYPACKAGE_LINKER_FLAGS
|
||||
#
|
||||
# MYPACKAGE_a_LIBRARIES
|
||||
# MYPACKAGE_a_INCLUDE_DIRS
|
||||
# MYPACKAGE_a_LINKER_FLAGS
|
||||
#
|
||||
# MYPACKAGE_b_LIBRARIES
|
||||
# MYPACKAGE_b_INCLUDE_DIRS
|
||||
# MYPACKAGE_b_LINKER_FLAGS
|
||||
#
|
||||
# MYPACKAGE_c_LIBRARIES
|
||||
# MYPACKAGE_c_INCLUDE_DIRS
|
||||
# MYPACKAGE_c_LINKER_FLAGS
|
||||
#
|
||||
# Use this module this way:
|
||||
# find_package(MyPackage)
|
||||
# include_directories(${MYPACKAGE_INCLUDE_DIRS})
|
||||
# add_executable(myapp ${SOURCES})
|
||||
# target_link_libraries(myapp ${MYPACKAGE_LIBRARIES})
|
||||
# set_property(TARGET myapp PROPERTY LINK_FLAGS ${MYPACKAGE_LINKER_FLAGS})
|
||||
#
|
||||
# Requires these CMake modules:
|
||||
# FindPackageHandleStandardArgs (CMake standard module)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
|
||||
set(MYPACKAGE_ROOT
|
||||
"${MYPACKAGE_ROOT}"
|
||||
CACHE
|
||||
PATH
|
||||
"Root directory to look in")
|
||||
|
||||
find_library(MYPACKAGE_LIBRARY
|
||||
NAMES
|
||||
mypackagecore
|
||||
PATHS
|
||||
"${MYPACKAGE_ROOT}"
|
||||
PATH_SUFFIXES
|
||||
lib)
|
||||
|
||||
find_path(MYPACKAGE_INCLUDE_DIR
|
||||
NAMES
|
||||
mypackage/mypackage.h
|
||||
PATHS
|
||||
"${MYPACKAGE_ROOT}"
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
|
||||
# Assuming that the components are named libmypackagea, libmypackageb, etc
|
||||
foreach(lib a b c)
|
||||
find_library(MYPACKAGE_${lib}_LIBRARY
|
||||
NAMES
|
||||
mypackage${lib}
|
||||
PATHS
|
||||
"${MYPACKAGE_ROOT}"
|
||||
PATH_SUFFIXES
|
||||
lib)
|
||||
|
||||
find_path(MYPACKAGE_${lib}_INCLUDE_DIR
|
||||
NAMES
|
||||
mypackage/${lib}/${lib}.h
|
||||
PATHS
|
||||
"${MYPACKAGE_ROOT}"
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
|
||||
endforeach()
|
||||
|
||||
# Searching for dependencies here - always quiet.
|
||||
# see /usr/share/cmake-2.x/Modules/FindBLAS.cmake for the variables this will define
|
||||
if(NOT BLAS_FOUND)
|
||||
find_package(BLAS QUIETLY)
|
||||
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(MyPackage
|
||||
DEFAULT_MSG
|
||||
MYPACKAGE_LIBRARY
|
||||
MYPACKAGE_INCLUDE_DIR
|
||||
MYPACKAGE_a_LIBRARY
|
||||
MYPACKAGE_a_INCLUDE_DIR
|
||||
MYPACKAGE_b_LIBRARY
|
||||
MYPACKAGE_b_INCLUDE_DIR
|
||||
MYPACKAGE_c_LIBRARY
|
||||
MYPACKAGE_c_INCLUDE_DIR
|
||||
BLAS_FOUND)
|
||||
|
||||
if(MYPACKAGE_FOUND)
|
||||
# Set variables containing libraries and their dependencies
|
||||
# Always use the plural form for the variables defined by other find modules:
|
||||
# they might have dependencies too!
|
||||
|
||||
set(MYPACKAGE_c_LIBRARIES ${MYPACKAGE_c_LIBRARY} ${BLAS_LIBRARIES})
|
||||
set(MYPACKAGE_c_INCLUDE_DIRS ${MYPACKAGE_c_INCLUDE_DIR}) # No include dir for BLAS?
|
||||
set(MYPACKAGE_c_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
|
||||
|
||||
set(MYPACKAGE_b_LIBRARIES
|
||||
${MYPACKAGE_b_LIBRARY}
|
||||
${MYPACKAGE_c_LIBRARIES})
|
||||
set(MYPACKAGE_b_INCLUDE_DIRS
|
||||
${MYPACKAGE_b_INCLUDE_DIR}
|
||||
${MYPACKAGE_c_INCLUDE_DIRS})
|
||||
set(MYPACKAGE_b_LINKER_FLAGS ${MYPACKAGE_c_LINKER_FLAGS})
|
||||
|
||||
set(MYPACKAGE_a_LIBRARIES
|
||||
${MYPACKAGE_a_LIBRARY}
|
||||
${MYPACKAGE_b_LIBRARIES})
|
||||
set(MYPACKAGE_a_INCLUDE_DIRS
|
||||
${MYPACKAGE_a_INCLUDE_DIR}
|
||||
${MYPACKAGE_b_INCLUDE_DIRS})
|
||||
set(MYPACKAGE_a_LINKER_FLAGS ${MYPACKAGE_b_LINKER_FLAGS})
|
||||
|
||||
set(MYPACKAGE_LIBRARIES ${MYPACKAGE_LIBRARY} ${MYPACKAGE_a_LIBRARIES})
|
||||
set(MYPACKAGE_INCLUDE_DIRS
|
||||
${MYPACKAGE_INCLUDE_DIR}
|
||||
${MYPACKAGE_a_INCLUDE_DIRS})
|
||||
set(MYPACKAGE_LINKER_FLAGS ${MYPACKAGE_a_LINKER_FLAGS})
|
||||
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MYPACKAGE_LIBRARY
|
||||
MYPACKAGE_INCLUDE_DIR
|
||||
MYPACKAGE_a_LIBRARY
|
||||
MYPACKAGE_a_INCLUDE_DIR
|
||||
MYPACKAGE_b_LIBRARY
|
||||
MYPACKAGE_b_INCLUDE_DIR
|
||||
MYPACKAGE_c_LIBRARY
|
||||
MYPACKAGE_c_INCLUDE_DIR)
|
||||
|
||||
if(MYPACKAGE_FOUND)
|
||||
mark_as_advanced(MYPACKAGE_ROOT)
|
||||
endif()
|
||||
|
||||
# End of Example-FindMyPackage.cmake
|
||||
101
module-docs/Example-FindMySimplePackage.cmake
Normal file
101
module-docs/Example-FindMySimplePackage.cmake
Normal file
@@ -0,0 +1,101 @@
|
||||
# - try to find MySimplePackage library
|
||||
#
|
||||
# Example-MySimplePackage.cmake
|
||||
#
|
||||
# This example is for a pretty simple library but that is still fairly
|
||||
# common in its complexity.
|
||||
#
|
||||
# Cache Variables: (probably not for direct use in your scripts)
|
||||
# MYSIMPLEPACKAGE_INCLUDE_DIR
|
||||
# MYSIMPLEPACKAGE_LIBRARY
|
||||
#
|
||||
# Non-cache variables you might use in your CMakeLists.txt:
|
||||
# MYSIMPLEPACKAGE_FOUND
|
||||
# MYSIMPLEPACKAGE_INCLUDE_DIRS
|
||||
# MYSIMPLEPACKAGE_LIBRARIES
|
||||
# MYSIMPLEPACKAGE_RUNTIME_LIBRARIES - aka the dll for installing
|
||||
# MYSIMPLEPACKAGE_RUNTIME_LIBRARY_DIRS
|
||||
#
|
||||
# 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(MYSIMPLEPACKAGE_ROOT_DIR
|
||||
"${MYSIMPLEPACKAGE_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(MYSIMPLEPACKAGE_LIBRARY
|
||||
NAMES
|
||||
mysimplepackage
|
||||
PATHS
|
||||
"${MYSIMPLEPACKAGE_ROOT_DIR}"
|
||||
PATH_SUFFIXES
|
||||
"${_LIBSUFFIXES}")
|
||||
|
||||
# Might want to look close to the library first for the includes.
|
||||
get_filename_component(_libdir "${MYSIMPLEPACKAGE_LIBRARY}" PATH)
|
||||
|
||||
find_path(MYSIMPLEPACKAGE_INCLUDE_DIR
|
||||
NAMES
|
||||
mysimplepackage.h
|
||||
HINTS
|
||||
"${_libdir}" # the library I based this on was sometimes bundled right next to its include
|
||||
"${_libdir}/.."
|
||||
PATHS
|
||||
"${MYSIMPLEPACKAGE_ROOT_DIR}"
|
||||
PATH_SUFFIXES
|
||||
include/)
|
||||
|
||||
# There's a DLL to distribute on Windows - find where it is.
|
||||
set(_deps_check)
|
||||
if(WIN32)
|
||||
find_file(MYSIMPLEPACKAGE_RUNTIME_LIBRARY
|
||||
NAMES
|
||||
mysimplepackage.dll
|
||||
HINTS
|
||||
"${_libdir}")
|
||||
set(MYSIMPLEPACKAGE_RUNTIME_LIBRARIES
|
||||
"${MYSIMPLEPACKAGE_RUNTIME_LIBRARY}")
|
||||
get_filename_component(MYSIMPLEPACKAGE_RUNTIME_LIBRARY_DIRS
|
||||
"${MYSIMPLEPACKAGE_RUNTIME_LIBRARY}"
|
||||
PATH)
|
||||
list(APPEND _deps_check MYSIMPLEPACKAGE_RUNTIME_LIBRARY)
|
||||
else()
|
||||
get_filename_component(MYSIMPLEPACKAGE_RUNTIME_LIBRARY_DIRS
|
||||
"${MYSIMPLEPACKAGE_LIBRARY}"
|
||||
PATH)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MySimplePackage
|
||||
DEFAULT_MSG
|
||||
MYSIMPLEPACKAGE_LIBRARY
|
||||
MYSIMPLEPACKAGE_INCLUDE_DIR
|
||||
${_deps_check})
|
||||
|
||||
if(MYSIMPLEPACKAGE_FOUND)
|
||||
set(MYSIMPLEPACKAGE_LIBRARIES "${MYSIMPLEPACKAGE_LIBRARY}")
|
||||
set(MYSIMPLEPACKAGE_INCLUDE_DIRS "${MYSIMPLEPACKAGE_INCLUDE_DIR}")
|
||||
mark_as_advanced(MYSIMPLEPACKAGE_ROOT_DIR)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MYSIMPLEPACKAGE_INCLUDE_DIR
|
||||
MYSIMPLEPACKAGE_LIBRARY
|
||||
MYSIMPLEPACKAGE_RUNTIME_LIBRARY)
|
||||
34
module-docs/Makefile
Normal file
34
module-docs/Makefile
Normal file
@@ -0,0 +1,34 @@
|
||||
#! make
|
||||
#
|
||||
# Automatically generate PDF, PNG, and JPG files from DOT files.
|
||||
#
|
||||
# Original Author:
|
||||
# 2009 Ryan Pavlik <rpavlik@iastate.edu>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
|
||||
pdfs := $(patsubst %.dot,%.pdf,$(wildcard *.dot))
|
||||
pngs := $(patsubst %.dot,%.png,$(wildcard *.dot))
|
||||
jpgs := $(patsubst %.dot,%.jpg,$(wildcard *.dot))
|
||||
|
||||
all: $(pdfs) $(pngs) $(jpgs)
|
||||
pdf: $(pdfs)
|
||||
png: $(pngs)
|
||||
jpg: $(jpgs)
|
||||
|
||||
clean:
|
||||
-rm -f $(pdfs) $(pngs) $(jpgs)
|
||||
realclean: clean
|
||||
-rm -f *~
|
||||
|
||||
.PHONY: all pdf png jpg clean realclean
|
||||
|
||||
$(pdfs): %.pdf: %.dot
|
||||
dot -Tpdf $< -o$@
|
||||
|
||||
$(pngs): %.png: %.dot
|
||||
dot -Tpng $< -o$@
|
||||
|
||||
$(jpgs): %.jpg: %.dot
|
||||
dot -Tjpg $< -o$@
|
||||
|
||||
Reference in New Issue
Block a user