From 6ed9866e871dfec50c1b9c61ead7589778d095fa Mon Sep 17 00:00:00 2001 From: Mirko Waechter <mirko.waechter@kit.edu> Date: Tue, 2 Oct 2018 00:03:00 +0200 Subject: [PATCH] added NLOpt Find script --- etc/cmake/FindNLOPT.cmake | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 etc/cmake/FindNLOPT.cmake diff --git a/etc/cmake/FindNLOPT.cmake b/etc/cmake/FindNLOPT.cmake new file mode 100644 index 000000000..c73967496 --- /dev/null +++ b/etc/cmake/FindNLOPT.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2015, Georgia Tech Graphics Lab and Humanoid Robotics Lab +# This file is provided under the "BSD-style" License + +# Find NLOPT +# +# This sets the following variables: +# NLOPT_FOUND +# NLOPT_INCLUDE_DIRS +# NLOPT_LIBRARIES +# NLOPT_DEFINITIONS +# NLOPT_VERSION + +find_package(PkgConfig QUIET) + +# Check to see if pkgconfig is installed. +pkg_check_modules(PC_NLOPT nlopt QUIET) + +# Definitions +set(NLOPT_DEFINITIONS ${PC_NLOPT_CFLAGS_OTHER}) + +# Include directories +find_path(NLOPT_INCLUDE_DIRS + NAMES nlopt.h + HINTS ${PC_NLOPT_INCLUDEDIR} + PATHS "${CMAKE_INSTALL_PREFIX}/include") + +# Libraries +find_library(NLOPT_LIBRARIES + NAMES nlopt nlopt_cxx + HINTS ${PC_NLOPT_LIBDIR}) + +# Version +set(NLOPT_VERSION ${PC_NLOPT_VERSION}) + +# Set (NAME)_FOUND if all the variables and the version are satisfied. +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(NLOPT + FAIL_MESSAGE DEFAULT_MSG + REQUIRED_VARS NLOPT_INCLUDE_DIRS NLOPT_LIBRARIES + VERSION_VAR NLOPT_VERSION) + -- GitLab