File: FindSimbody.cmake

package info (click to toggle)
molmodel 3.1.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,384 kB
  • sloc: cpp: 39,830; perl: 526; ansic: 107; makefile: 41
file content (90 lines) | stat: -rw-r--r-- 3,550 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# FindSimbody.cmake
# 
# Simbios National Center for Physics Based Simulation of Biological Structures
# Stanford University
# This cmake file created 2012 by Michael Sherman and is in the public 
# domain; Simbody itself is open source under the Apache 2.0 license.
#
# This is a CMake "find" module that will try to find the Simbody multibody 
# dynamics (physics) package installed somewhere on your computer. Simbody
# is part of the SimTK biosimulation toolkit. For more information, see
# https://simtk.org/home/simbody.
#
# To use this in a find_package() command from your own CMakeLists.txt file, 
# make sure this file is in a directory that is in the CMAKE_MODULE_PATH. 
# You can add a directory to that path with a line like this:
#     list(APPEND CMAKE_MODULE_PATH "myModuleDir")
#
# Then, to use Simbody include these lines:
#
#     find_package(Simbody REQUIRED)
#     include_directories(${Simbody_INCLUDE_DIR})
#     link_directories(${Simbody_LIB_DIR})
#     add_executable(myexe ${my_source_files} ${my_header_files})
#     target_link_libraries(myexe ${Simbody_LIBRARIES})
#
# If you don't want to make it REQUIRED, you can check Simbody_FOUND after
# find_package() returns.
# TODO: no version selection is implemented here yet; if you provide it
# to find_package() it will be ignored.
#
# This includes several libraries:
#     SimTKsimbody
#     SimTKmath
#     SimTKcommon
#     Windows only: liblapack libblas pthreadVC2[_x64]
# The above will be in Simbody_ROOT_DIR/lib.
#
# On Mac and Linux we don't provide our own lapack but expect it to be 
# available.
#     Mac/Linux only: lapack blas
#
# Once done this will define:
#
#   Simbody_FOUND - Whether search for Simbody libraries and headers succeeded.
#   Simbody_ROOT_DIR - the installation directory; all the pieces must be
#                      found together
#   Simbody_INCLUDE_DIR - location of Simbody.h
#   Simbody_LIB_DIR     - location of libSimTKsimbody.{a,so,dylib} or SimTKsimbody.lib
#   Simbody_BIN_DIR     - location of VisualizerGUI and .dll's on Windows
#   Simbody_LIBRARIES   - suitable for target_link_libraries(); includes
#                           both optimized and debug libraries if both are
#                           available
#   Simbody_STATIC_LIBRARIES - suitable for target_link_libraries(); includes
#                              both optimized and debug static libraries if
#                              both are available
#
# The following environment variables are used if set, in order of decreasing
# preference:
#   SIMBODY_HOME
#   SimTK_INSTALL_DIR
#
# Otherwise we look in platform-specific standard places, in this order:
#   <standardPlaces>/Simbody, /simbody
#   <standardPlaces>/SimTK, /simtk
#
# This module looks for certain CMake variables on input and behaves 
# accordingly if they are present:
#
#   SimTK_INSTALL_DIR
#       This is commonly set by other SimTK software and overrides the
#       environment variables if present. Note that this has the same name
#       as one of the environment variables but is distinct.

cmake_minimum_required(VERSION 3.10)

# Get values of relevant environment variables for convenient testing.
set(ENV_SIMBODY_HOME_VALUE $ENV{SIMBODY_HOME})
set(ENV_SimTK_INSTALL_DIR_VALUE $ENV{SimTK_INSTALL_DIR})

if(ENV_SIMBODY_HOME_VALUE)
    set(HINT_DIR ${ENV_SIMBODY_HOME_VALUE})
else()
    set(HINT_DIR ${ENV_SimTK_INSTALL_DIR_VALUE})
endif()

if (HINT_DIR)
    find_package(Simbody CONFIG REQUIRED HINTS "${HINT_DIR}")
else()
    find_package(Simbody CONFIG REQUIRED)
endif()