FindPhySim.cmake 1.23 KB
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1 2 3 4
# - Try to find PHYSIM
# Once done this will define
#  
#  PHYSIM_FOUND        - system has PHYSIM
5
#  PHYSIM_INCLUDE_DIRS - the PHYSIM include directory
Jan Möbius's avatar
Jan Möbius committed
6 7 8
#  PHYSIM_LIBRARY_DIR  - where the libraries are
#  PHYSIM_LIBRARY      - Link these to use PHYSIM
#   
Jan Möbius's avatar
Jan Möbius committed
9
IF (PHYSIM_INCLUDE_DIRS)
Jan Möbius's avatar
Jan Möbius committed
10 11
  # Already in cache, be silent
  SET(PHYSIM_FIND_QUIETLY TRUE)
Jan Möbius's avatar
Jan Möbius committed
12
ENDIF (PHYSIM_INCLUDE_DIRS)
Jan Möbius's avatar
Jan Möbius committed
13

14 15 16 17 18 19 20 21
# search all lib directories in packages for OpenFlipper
file (
  GLOB _libdirs
           "${CMAKE_SOURCE_DIR}/libs"
           "${CMAKE_SOURCE_DIR}/Package-*/libs"
)


22
FIND_PATH(PHYSIM_INCLUDE_DIR PhySim/Config/PhySimDefines.hh
23 24
           PATHS "${_libdirs}" 
                 "${CMAKE_SOURCE_DIR}/libs" )
Jan Möbius's avatar
Jan Möbius committed
25 26 27

add_definitions (-DPHYSIMDLL -DUSEPHYSIM )

28 29 30 31 32
if (QT5_FOUND)
	SET( PHYSIM_DEPS "Qwt6;GMP" )
else ()
	SET( PHYSIM_DEPS "Qwt5;GMP" )
endif ()
33

34

35
IF (PHYSIM_INCLUDE_DIR)
Jan Möbius's avatar
Jan Möbius committed
36
  SET(PHYSIM_FOUND TRUE)
Jan Möbius's avatar
Jan Möbius committed
37
  SET( PHYSIM_LIBRARY_DIR "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}" )
Jan Möbius's avatar
Jan Möbius committed
38
  SET( PHYSIM_LIBRARY "PhySim")
39 40 41
  file(RELATIVE_PATH rel_path ${CMAKE_SOURCE_DIR} ${PHYSIM_INCLUDE_DIR})
  SET(PHYSIM_INCLUDE_DIRS "${PHYSIM_INCLUDE_DIR}" "${CMAKE_BINARY_DIR}/${rel_path}/PhySim")
ELSE (PHYSIM_INCLUDE_DIR)
Jan Möbius's avatar
Jan Möbius committed
42 43
  SET( PHYSIM_FOUND FALSE )
  SET( PHYSIM_LIBRARY_DIR )
44
ENDIF (PHYSIM_INCLUDE_DIR)