Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include(FindPackageHandleStandardArgs)
- #=============================================================
- #
- # The following suffixes cause searching for header files and libraries:
- #
- #=============================================================
- set(_suffixes
- # If these ever change, things will break.
- dxf_parser
- fb_abstraction
- ini_parser
- kinematics/model_core
- kinematics/model1
- kinematics/model2
- file_manager/file_manager_core
- file_manager/file_manager_core_types
- file_manager/file_manager_proxy_client
- file_manager/file_manager_proxy_server
- file_manager/file_manager_proxy_types
- fingerprint/fingerprint_core
- fingerprint/fingerprint_core_types
- fingerprint/fingerprint_proxy_client
- fingerprint/fingerprint_proxy_server
- fingerprint/fingerprint_proxy_types
- message_buffer/message_buffer_core
- message_buffer/message_buffer_core_types
- motion/motion_core_types
- motion/motion_core
- motion/motion_proxy_client
- motion/motion_proxy_server
- motion/motion_proxy_types
- proxy/client_proxy
- proxy/server_proxy
- proxy/proxy_core
- osal
- ref_registry
- busal
- busal/profile_ds402/profile_ds402_core_types
- busal/profile_ds402/profile_ds402_core
- busal/service_ecatmkpa15/service_ecatmkpa15_core/dmkpa_support
- busal/service_ecatmkpa15/service_ecatmkpa15_core_types
- busal/service_ecatmkpa15/service_ecatmkpa15_core
- busal/service_ecatmkpa15/service_ecatmkpa15_proxy_client
- busal/service_ecatmkpa15/service_ecatmkpa15_proxy_server
- busal/service_ecatmkpa15/service_ecatmkpa15_proxy_types
- busal/profile_simulation/profile_simulation_types
- busal/profile_simulation/profile_simulation_core
- busal/profile_vrep/profile_vrep_types
- busal/profile_vrep/profile_vrep_core
- busal/profile_vrep/profile_vrep_client
- cycle_proc
- )
- set(_modk_paths "${MODK_SEARCH_PATH}/"
- "${CMAKE_HOME_DIRECTORY}../../")
- function(_MoDK_FIND_COMPONENT _var _hdr _hdr_only)
- set(_version "@VERSION@")
- set(MoDK_VERSION_STRING ${_version})
- set(CMAKE_FIND_LIBRARY_SUFFIXES .a;.so;.a.${_version};.so.${_version};.lib)
- find_path(MoDK_${_var}_INCLUDE_DIR ${_hdr}
- PATHS
- ${_modk_paths}
- ${_modk_paths}/include
- PATH_SUFFIXES
- ${_suffixes}
- )
- if(NOT ${_hdr_only})
- find_library(MoDK_${_var}_LIBRARY
- NAMES ${_var}
- PATHS
- ${_modk_paths}
- ${_modk_paths}/lib
- PATH_SUFFIXES
- ${_suffixes}
- )
- set(LIBRARY_ARG MoDK_${_var}_LIBRARY)
- endif()
- unset(MoDK_FOUND) # avoid parent scope variable usage
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(MoDK REQUIRED_VARS MoDK_${_var}_INCLUDE_DIR ${LIBRARY_ARG} VERSION_VAR MoDK_VERSION_STRING
- # MoDK_INCLUDE_DIRS MoDK_LIBRARIES
- )
- mark_as_advanced(MoDK_${_var}_INCLUDE_DIR MoDK_VERSION_STRING ${LIBRARY_ARG}
- # MoDK_INCLUDE_DIRS MoDK_LIBRARIES
- )
- if(MoDK_FOUND OR MODK_FOUND) # old CMake versions set 'all upper' variable as FOUND
- set(MoDK_FOUND "TRUE" PARENT_SCOPE)
- set(MoDK_INCLUDE_DIRS ${MoDK_INCLUDE_DIRS} ${MoDK_${_var}_INCLUDE_DIR} PARENT_SCOPE)
- set(MoDK_LIBRARIES ${MoDK_LIBRARIES} ${MoDK_${_var}_LIBRARY} PARENT_SCOPE)
- endif()
- endfunction()
- if(NOT MoDK_FIND_COMPONENTS)
- _MoDK_FIND_COMPONENT(dmkpa_support dmkpa_unified.h 1)
- _MoDK_FIND_COMPONENT(dxf_parser dxf_parser.h 0)
- _MoDK_FIND_COMPONENT(ini_parser ini_parser.h 0)
- _MoDK_FIND_COMPONENT(model_core kin_transform.h 1)
- _MoDK_FIND_COMPONENT(model1 model1_nearestpoint.h 0)
- _MoDK_FIND_COMPONENT(model2 model2_nearestpoint.h 0)
- _MoDK_FIND_COMPONENT(fingerprint_core get_act.h 0)
- _MoDK_FIND_COMPONENT(fingerprint_core_types fingerprint_types.h 1)
- _MoDK_FIND_COMPONENT(fingerprint_proxy_client pc_get_act.h 0)
- _MoDK_FIND_COMPONENT(fingerprint_proxy_server ps_get_act.h 0)
- _MoDK_FIND_COMPONENT(fingerprint_proxy_types proxy_get_act.h 1)
- _MoDK_FIND_COMPONENT(file_manager_core create_file.h 0)
- _MoDK_FIND_COMPONENT(file_manager_core_types file_manager_result.h 1)
- _MoDK_FIND_COMPONENT(file_manager_proxy_client pc_create_file.h 0)
- _MoDK_FIND_COMPONENT(file_manager_proxy_server ps_create_file.h 0)
- _MoDK_FIND_COMPONENT(file_manager_proxy_types proxy_create_file.h 1)
- _MoDK_FIND_COMPONENT(message_buffer_core message_buffer.h 0)
- _MoDK_FIND_COMPONENT(message_buffer_core_types message_buffer.h 1)
- _MoDK_FIND_COMPONENT(motion_core_types mctypes.h 0)
- _MoDK_FIND_COMPONENT(motion_proxy_client pc_add_axis_to_group.h 0)
- _MoDK_FIND_COMPONENT(motion_proxy_server ps_add_axis_to_group.h 0)
- _MoDK_FIND_COMPONENT(motion_proxy_types proxy_add_axis_to_group.h 1)
- _MoDK_FIND_COMPONENT(motion_core mc.h 0)
- _MoDK_FIND_COMPONENT(profile_ds402_core_types profile_ds402_parser.h 1)
- _MoDK_FIND_COMPONENT(profile_ds402_core profile_ds402.h 0)
- _MoDK_FIND_COMPONENT(service_ecatmkpa15_core_types ecatmkpa15_parser.h 1)
- _MoDK_FIND_COMPONENT(service_ecatmkpa15_proxy_client pc_read_pi.h 0)
- _MoDK_FIND_COMPONENT(service_ecatmkpa15_proxy_server ps_read_pi.h 0)
- _MoDK_FIND_COMPONENT(service_ecatmkpa15_proxy_types proxy_read_pi.h 1)
- _MoDK_FIND_COMPONENT(service_ecatmkpa15_core ecatmkpa15_service.h 0)
- _MoDK_FIND_COMPONENT(profile_simulation_types profile_simulation_result.h 1)
- _MoDK_FIND_COMPONENT(profile_simulation_core profile_simulation.h 0)
- _MoDK_FIND_COMPONENT(profile_vrep_types vrep_parser.h 1)
- _MoDK_FIND_COMPONENT(profile_vrep_core profile_vrep.h 0)
- _MoDK_FIND_COMPONENT(profile_vrep_client pc_configuration_vrep.h 0)
- _MoDK_FIND_COMPONENT(busal service.h 1)
- _MoDK_FIND_COMPONENT(cycle_proc cycle_proc.h 0)
- _MoDK_FIND_COMPONENT(client_proxy pc.h 0)
- _MoDK_FIND_COMPONENT(server_proxy ps.h 0)
- _MoDK_FIND_COMPONENT(proxy_core proxy_fb_interface.h 0)
- _MoDK_FIND_COMPONENT(ref_registry ref_registry.h 0)
- _MoDK_FIND_COMPONENT(osal osal_type.h 0)
- else()
- foreach(MoDK_component ${MoDK_FIND_COMPONENTS})
- if(MoDK_component STREQUAL "dmkpa_support")
- _MoDK_FIND_COMPONENT(dmkpa_support dmkpa_unified.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "dxf_parser")
- _MoDK_FIND_COMPONENT(dxf_parser dxf_parser.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "ini_parser")
- _MoDK_FIND_COMPONENT(ini_parser ini_parser.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "fingerprint_core")
- _MoDK_FIND_COMPONENT(fingerprint_core get_act.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "fingerprint_core_types")
- _MoDK_FIND_COMPONENT(fingerprint_core_types fingerprint_types.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "fingerprint_proxy_client")
- _MoDK_FIND_COMPONENT(fingerprint_proxy_client pc_get_act.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "fingerprint_proxy_server")
- _MoDK_FIND_COMPONENT(fingerprint_proxy_server ps_get_act.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "fingerprint_proxy_types")
- _MoDK_FIND_COMPONENT(fingerprint_proxy_types proxy_get_act.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "file_manager_core")
- _MoDK_FIND_COMPONENT(file_manager_core create_file.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "file_manager_core_types")
- _MoDK_FIND_COMPONENT(file_manager_core_types file_manager_types.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "model_core")
- _MoDK_FIND_COMPONENT(model_core kin_transform.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "model1")
- _MoDK_FIND_COMPONENT(model1 model1_nearestpoint.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "model2")
- _MoDK_FIND_COMPONENT(model2 model2_nearestpoint.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "message_buffer_core")
- _MoDK_FIND_COMPONENT(message_buffer_core message_buffer.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "message_buffer_core_types")
- _MoDK_FIND_COMPONENT(message_buffer_core_types message_buffer.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "motion_core_types")
- _MoDK_FIND_COMPONENT(motion_core_types mctypes.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "motion_core")
- _MoDK_FIND_COMPONENT(motion_core mc.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "motion_proxy_client")
- _MoDK_FIND_COMPONENT(motion_proxy_client pc_add_axis_to_group.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "motion_proxy_server")
- _MoDK_FIND_COMPONENT(motion_proxy_server ps_add_axis_to_group.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "motion_proxy_types")
- _MoDK_FIND_COMPONENT(motion_proxy_types proxy_add_axis_to_group.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "profile_ds402_core_types")
- _MoDK_FIND_COMPONENT(profile_ds402_core_types profile_ds402_parser.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "profile_ds402_core")
- _MoDK_FIND_COMPONENT(profile_ds402_core profile_ds402.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "service_ecatmkpa15_core_types")
- _MoDK_FIND_COMPONENT(service_ecatmkpa15_core_types ecatmkpa15_parser.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT (MoDK_${MoDK_component}_INCLUDE_DIR)))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "service_ecatmkpa15_core")
- _MoDK_FIND_COMPONENT(service_ecatmkpa15_core ecatmkpa15_service.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "service_ecatmkpa15_proxy_client")
- _MoDK_FIND_COMPONENT(service_ecatmkpa15_proxy_client pc_read_pi.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "service_ecatmkpa15_proxy_server")
- _MoDK_FIND_COMPONENT(service_ecatmkpa15_proxy_server ps_read_pi.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "service_ecatmkpa15_proxy_types")
- _MoDK_FIND_COMPONENT(service_ecatmkpa15_proxy_types proxy_read_pi.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "profile_simulation_types")
- _MoDK_FIND_COMPONENT(profile_simulation_types profile_simulation_result.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(profile_simulation_core)
- _MoDK_FIND_COMPONENT(profile_simulation_core profile_simulation.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "profile_vrep_types")
- _MoDK_FIND_COMPONENT(profile_vrep_types vrep_parser.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "sprofile_vrep_core")
- _MoDK_FIND_COMPONENT(profile_vrep_core profile_vrep.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "profile_vrep_client")
- _MoDK_FIND_COMPONENT(profile_vrep_client pc_configuration_vrep.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "busal")
- _MoDK_FIND_COMPONENT(busal service.h 1)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "cycle_proc")
- _MoDK_FIND_COMPONENT(cycle_proc cycle_proc.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "client_proxy")
- _MoDK_FIND_COMPONENT(client_proxy pc.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "server_proxy")
- _MoDK_FIND_COMPONENT(server_proxy ps.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "proxy_core")
- _MoDK_FIND_COMPONENT(proxy_core proxy_fb_interface.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "ref_registry")
- _MoDK_FIND_COMPONENT(ref_registry ref_registry.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- if(MoDK_component STREQUAL "osal")
- _MoDK_FIND_COMPONENT(osal osal_thread.h 0)
- if(MoDK_FIND_REQUIRED_${MoDK_component} AND (NOT MoDK_FOUND))
- message(FATAL_ERROR "MoDK ${MoDK_component} not available.")
- endif()
- endif()
- endforeach()
- endif()
- if(MSVC)
- if(MSVC_VERSION EQUAL 1800)
- set(MoDK_LIBRARIES ${MoDK_LIBRARIES} SetupAPI WS2_32 Crypt32)
- else()
- message(WARNING "You are using not compatible MSVC version")
- endif()
- elseif(CMAKE_SYSTEM_NAME STREQUAL QNX)
- if(CMAKE_SYSTEM_VERSION EQUAL 6.5.0)
- set(MoDK_LIBRARIES ${MoDK_LIBRARIES} m socket c crypto usbdi cpp)
- else()
- set(MoDK_LIBRARIES ${MoDK_LIBRARIES} m socket c crypto usbdi stdc++)
- endif()
- elseif(CMAKE_SYSTEM_NAME STREQUAL Xenomai)
- if(CMAKE_SYSTEM_VERSION EQUAL 2.6.4)
- set(MoDK_LIBRARIES ${MoDK_LIBRARIES} pthread_rt xenomai rtdm native m stdc++)
- elseif(CMAKE_SYSTEM_VERSION EQUAL 3.0.1 OR CMAKE_SYSTEM_VERSION EQUAL 3.0.4)
- set(MoDK_LIBRARIES ${MoDK_LIBRARIES} cobalt pthread rt m stdc++)
- endif()
- elseif(CMAKE_SYSTEM_NAME STREQUAL Linux)
- set(MoDK_LIBRARIES ${MoDK_LIBRARIES} rt pthread c m dl stdc++)
- endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement