chiark / gitweb /
Use Unix eols instead of CRLFs (#148)
authorJulien Schueller <schueller@phimeca.com>
Mon, 18 Sep 2017 07:40:22 +0000 (09:40 +0200)
committerGitHub <noreply@github.com>
Mon, 18 Sep 2017 07:40:22 +0000 (09:40 +0200)
CMakeLists.txt
esch/esch.h
nlopt_config.h.in

index a1dbbd9695a05ee795bf17bb37322d4acd9d235e..8aa596edb5c3a17cc7b929518b36509f7c54cbfb 100644 (file)
-#==============================================================================\r
-# NLOPT CMake file\r
-#\r
-# NLopt is a free/open-source library for nonlinear optimization, providing\r
-# a common interface for a number of different free optimization routines\r
-# available online as well as original implementations of various other\r
-# algorithms\r
-# WEBSITE: http://ab-initio.mit.edu/wiki/index.php/NLopt\r
-# AUTHOR: Steven G. Johnson\r
-#\r
-# This CMakeLists.txt file was created to compile NLOPT with the CMAKE utility.\r
-# Benoit Scherrer, 2010 CRL, Harvard Medical School\r
-# Copyright (c) 2008-2009 Children's Hospital Boston\r
-#==============================================================================\r
-cmake_minimum_required (VERSION 3.0)\r
-\r
-if (NOT DEFINED CMAKE_BUILD_TYPE)\r
-  set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")\r
-endif ()\r
-\r
-project (nlopt)\r
-\r
-list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)\r
-\r
-option (WITH_CXX "enable cxx routines" OFF)\r
-option (BUILD_SHARED_LIBS "Build NLopt as a shared library" ON)\r
-option (BUILD_PYTHON "build python bindings" ON)\r
-option (BUILD_OCTAVE "build octave bindings" ON)\r
-option (BUILD_MATLAB "build matlab bindings" ON)\r
-option (BUILD_GUILE "build guile bindings" ON)\r
-option (USE_SWIG "use SWIG to build bindings" ON)\r
-\r
-set (NLOPT_SUFFIX)\r
-if (WITH_CXX)\r
-  set (NLOPT_SUFFIX _cxx)\r
-endif ()\r
-\r
-include (GNUInstallDirs)\r
-\r
-# Offer the user the choice of overriding the installation directories\r
-set (INSTALL_LIB_DIR     ${CMAKE_INSTALL_LIBDIR}        CACHE PATH "Installation directory for libraries")\r
-set (INSTALL_BIN_DIR     ${CMAKE_INSTALL_BINDIR}        CACHE PATH "Installation directory for executables")\r
-set (INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}    CACHE PATH "Installation directory for header files")\r
-set (INSTALL_DATA_DIR    ${CMAKE_INSTALL_DATADIR}/nlopt CACHE PATH "Installation directory for data files")\r
-set (INSTALL_MAN_DIR     ${CMAKE_INSTALL_MANDIR}        CACHE PATH "Installation directory for man documentation")\r
-set (INSTALL_CMAKE_DIR   ${INSTALL_LIB_DIR}/cmake/nlopt CACHE PATH "Installation directory for cmake config files")\r
-\r
-# Make relative paths absolute (needed later on)\r
-foreach (p LIB BIN INCLUDE DATA CMAKE)\r
-  set (var INSTALL_${p}_DIR)\r
-  set (RELATIVE_INSTALL_${p}_DIR ${INSTALL_${p}_DIR})\r
-  if (NOT IS_ABSOLUTE "${${var}}")\r
-    set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")\r
-  endif ()\r
-endforeach ()\r
-\r
-\r
-set (CMAKE_INSTALL_RPATH ${INSTALL_LIB_DIR})\r
-set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)\r
-if(POLICY CMP0042)\r
-  # Set MACOSX_RPATH to ON\r
-  cmake_policy(SET CMP0042 NEW)\r
-endif()\r
-\r
-include (CheckIncludeFiles)\r
-include (CheckFunctionExists)\r
-include (CheckTypeSize)\r
-include (CheckCCompilerFlag)\r
-include (CheckCXXSymbolExists)\r
-include (CheckCXXCompilerFlag)\r
-include (CheckLibraryExists)\r
-\r
-#==============================================================================\r
-# COMPILATION CHECKINGS and CONFIGURATION GENERATION\r
-#==============================================================================\r
-check_include_file (dlfcn.h HAVE_DLFCN_H)\r
-check_include_file (getopt.h HAVE_GETOPT_H)\r
-check_include_file (unistd.h HAVE_UNISTD_H)\r
-check_include_file (string.h HAVE_STRING_H)\r
-check_include_file (strings.h HAVE_STRINGS_H)\r
-check_include_file (inttypes.h HAVE_INTTYPES_H)\r
-check_include_file (memory.h HAVE_MEMORY_H)\r
-check_include_file (stdlib.h HAVE_STDLIB_H)\r
-check_include_file (stdint.h HAVE_STDINT_H)\r
-check_include_file (time.h HAVE_TIME_H)\r
-check_include_file (sys/types.h HAVE_SYS_TYPES_H)\r
-check_include_file (sys/stat.h HAVE_SYS_STAT_H)\r
-check_include_file (sys/time.h HAVE_SYS_TIME_H)\r
-if (HAVE_TIME_H AND HAVE_SYS_TIME_H)\r
-  set (TIME_WITH_SYS_TIME TRUE)\r
-endif ()\r
-check_function_exists (getpid HAVE_GETPID)\r
-check_function_exists (syscall HAVE_GETTID_SYSCALL)\r
-check_function_exists (isinf HAVE_ISINF)\r
-check_function_exists (isnan HAVE_ISNAN)\r
-check_function_exists (gettimeofday HAVE_GETTIMEOFDAY)\r
-check_function_exists (qsort_r HAVE_QSORT_R)\r
-check_function_exists (time HAVE_TIME)\r
-check_function_exists (copysign HAVE_COPYSIGN)\r
-check_type_size ("uint32_t" SIZEOF_UINT32_T)\r
-set (HAVE_UINT32_T ${SIZEOF_UINT32_T})\r
-check_type_size ("unsigned int" SIZEOF_UNSIGNED_INT)\r
-check_type_size ("unsigned long" SIZEOF_UNSIGNED_LONG)\r
-\r
-check_library_exists ("m" sqrt "" HAVE_LIBM)\r
-if (HAVE_LIBM)\r
-  set (M_LIBRARY m)\r
-endif()\r
-\r
-if (NOT DEFINED HAVE_FPCLASSIFY)\r
-  message(STATUS "Looking for fpclassify")\r
-  file (WRITE ${PROJECT_BINARY_DIR}/fpclassify.c "#include <math.h>\n")\r
-  file (APPEND ${PROJECT_BINARY_DIR}/fpclassify.c "int main(void) {\n")\r
-  file (APPEND ${PROJECT_BINARY_DIR}/fpclassify.c "if (!fpclassify(3.14159)) fpclassify(2.7183);\n")\r
-  file (APPEND ${PROJECT_BINARY_DIR}/fpclassify.c "  return 0; }\n")\r
-  try_compile (HAVE_FPCLASSIFY\r
-  ${PROJECT_BINARY_DIR}/build_fpclassify\r
-  ${PROJECT_BINARY_DIR}/fpclassify.c\r
-  CMAKE_FLAGS -DLINK_LIBRARIES=m)\r
-  message(STATUS "Looking for fpclassify - ${HAVE_FPCLASSIFY}")\r
-endif ()\r
-\r
-option (WITH_THREADLOCAL "check thread local keyword" ON)\r
-if (WITH_THREADLOCAL AND NOT DEFINED HAVE_THREAD_LOCAL_STORAGE)\r
-  foreach (_THREADLOCAL_KEY "__thread" "__declspec(thread)")\r
-    unset (HAVE_THREAD_LOCAL_STORAGE CACHE)\r
-    check_c_source_compiles("\r
-    ${_THREADLOCAL_KEY} int tls;\r
-\r
-    int main(void) {\r
-        return 0;\r
-    }" HAVE_THREAD_LOCAL_STORAGE)\r
-    if (${HAVE_THREAD_LOCAL_STORAGE})\r
-      set (THREADLOCAL ${_THREADLOCAL_KEY})\r
-    endif ()\r
-  endforeach()\r
-endif ()\r
-\r
-if (WITH_CXX OR BUILD_PYTHON OR BUILD_GUILE OR BUILD_OCTAVE)\r
-  check_cxx_symbol_exists (_LIBCPP_VERSION string SYSTEM_HAS_LIBCPP)\r
-  if (SYSTEM_HAS_LIBCPP)\r
-    check_cxx_compiler_flag ("-std=c++11" SUPPORTS_STDCXX11)\r
-    if (SUPPORTS_STDCXX11)\r
-      set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")\r
-    endif ()\r
-  endif ()\r
-endif ()\r
-\r
-#==============================================================================\r
-# version\r
-#==============================================================================\r
-set (NLOPT_MAJOR_VERSION "2")\r
-set (NLOPT_MINOR_VERSION "5")\r
-set (NLOPT_BUGFIX_VERSION "0")\r
-set (NLOPT_VERSION_STRING ${NLOPT_MAJOR_VERSION}.${NLOPT_MINOR_VERSION}.${NLOPT_BUGFIX_VERSION})\r
-message (STATUS "NLopt version ${NLOPT_VERSION_STRING}")\r
-\r
-#==============================================================================\r
-# CREATE nlopt_config.h\r
-#==============================================================================\r
-\r
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/nlopt_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/nlopt_config.h IMMEDIATE)\r
-\r
-# pkgconfig file\r
-if (UNIX OR MINGW)\r
-  configure_file (${CMAKE_CURRENT_SOURCE_DIR}/nlopt.pc.in ${CMAKE_CURRENT_BINARY_DIR}/nlopt.pc @ONLY)\r
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/nlopt.pc DESTINATION ${RELATIVE_INSTALL_LIB_DIR}/pkgconfig)\r
-endif ()\r
-\r
-#==============================================================================\r
-# nlopt LIBRARY TARGET (SHARED OR STATIC)\r
-#==============================================================================\r
-\r
-configure_file (api/nlopt.h ${PROJECT_BINARY_DIR}/api/nlopt.h COPYONLY)\r
-\r
-set (NLOPT_HEADERS\r
-  ${PROJECT_BINARY_DIR}/api/nlopt.h ${PROJECT_BINARY_DIR}/api/nlopt.hpp ${PROJECT_BINARY_DIR}/api/nlopt.f\r
-)\r
-\r
-set (NLOPT_SOURCES\r
-  direct/DIRect.c direct/direct_wrap.c direct/DIRserial.c direct/DIRsubrout.c direct/direct-internal.h direct/direct.h\r
-  cdirect/cdirect.c cdirect/hybrid.c cdirect/cdirect.h\r
-  praxis/praxis.c praxis/praxis.h\r
-  luksan/plis.c luksan/plip.c luksan/pnet.c luksan/mssubs.c luksan/pssubs.c luksan/luksan.h\r
-  crs/crs.c crs/crs.h\r
-  mlsl/mlsl.c mlsl/mlsl.h\r
-  mma/mma.c mma/mma.h mma/ccsa_quadratic.c\r
-  cobyla/cobyla.c cobyla/cobyla.h\r
-  newuoa/newuoa.c newuoa/newuoa.h\r
-  neldermead/nldrmd.c neldermead/neldermead.h neldermead/sbplx.c\r
-  auglag/auglag.c auglag/auglag.h\r
-  bobyqa/bobyqa.c bobyqa/bobyqa.h\r
-  isres/isres.c isres/isres.h\r
-  slsqp/slsqp.c slsqp/slsqp.h\r
-  esch/esch.c esch/esch.h\r
-  api/general.c api/options.c api/optimize.c api/deprecated.c api/nlopt-internal.h api/nlopt.h api/f77api.c api/f77funcs.h api/f77funcs_.h api/nlopt.hpp api/nlopt-in.hpp\r
-  util/mt19937ar.c util/sobolseq.c util/soboldata.h util/timer.c util/stop.c util/nlopt-util.h util/redblack.c util/redblack.h util/qsort_r.c util/rescale.c\r
-)\r
-\r
-if (WITH_CXX)\r
-  list (APPEND NLOPT_SOURCES stogo/global.cc stogo/linalg.cc stogo/local.cc stogo/stogo.cc stogo/tools.cc stogo/global.h stogo/linalg.h stogo/local.h stogo/stogo_config.h stogo/stogo.h stogo/tools.h)\r
-endif ()\r
-\r
-install (FILES ${NLOPT_HEADERS} DESTINATION ${INSTALL_INCLUDE_DIR})\r
-\r
-set (nlopt_lib nlopt${NLOPT_SUFFIX})\r
-add_library (${nlopt_lib} ${NLOPT_SOURCES})\r
-target_link_libraries (${nlopt_lib} ${M_LIBRARY})\r
-\r
-set_target_properties (${nlopt_lib} PROPERTIES SOVERSION 0)\r
-set_target_properties (${nlopt_lib} PROPERTIES VERSION 0.9.0)\r
-\r
-#==============================================================================\r
-# INCLUDE DIRECTORIES\r
-#==============================================================================\r
-target_include_directories (${nlopt_lib} PRIVATE\r
-  ${PROJECT_BINARY_DIR}/api\r
-  ${PROJECT_BINARY_DIR}\r
-  stogo\r
-  util\r
-  direct\r
-  cdirect\r
-  praxis\r
-  luksan\r
-  crs\r
-  mlsl\r
-  mma\r
-  cobyla\r
-  newuoa\r
-  neldermead\r
-  auglag\r
-  bobyqa\r
-  isres\r
-  slsqp\r
-  esch\r
-  api)\r
-\r
-get_target_property (NLOPT_PRIVATE_INCLUDE_DIRS ${nlopt_lib} INCLUDE_DIRECTORIES)\r
-target_include_directories (${nlopt_lib} INTERFACE "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/api>" "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")\r
-\r
-if (BUILD_SHARED_LIBS)\r
-  target_compile_definitions (${nlopt_lib} PUBLIC -DNLOPT_DLL)\r
-  target_compile_definitions (${nlopt_lib} PRIVATE -DNLOPT_DLL_EXPORT)\r
-endif ()\r
-\r
-# pass -fPIC in case swig module is built with static library\r
-if (NOT BUILD_SHARED_LIBS)\r
-  check_c_compiler_flag (-fPIC HAS_FPIC)\r
-  if (HAS_FPIC)\r
-    set (CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")\r
-    set (CMAKE_CXX_FLAGS "-fPIC ${CMAKE_CXX_FLAGS}")\r
-  endif ()\r
-endif ()\r
-\r
-install ( TARGETS ${nlopt_lib}\r
-          EXPORT  NLoptLibraryDepends\r
-          RUNTIME DESTINATION ${RELATIVE_INSTALL_BIN_DIR}\r
-          LIBRARY DESTINATION ${RELATIVE_INSTALL_LIB_DIR}\r
-          ARCHIVE DESTINATION ${RELATIVE_INSTALL_LIB_DIR}\r
-        )\r
-\r
-if (MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1)\r
-  install (FILES $<TARGET_PDB_FILE:${nlopt_lib}> DESTINATION ${RELATIVE_INSTALL_BIN_DIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT Debug)\r
-endif ()\r
-\r
-add_subdirectory (api)\r
-\r
-if (BUILD_PYTHON)\r
-  find_package (PythonInterp)\r
-  find_package (PythonLibs)\r
-  find_package (NumPy)\r
-endif ()\r
-\r
-if (NOT DEFINED INSTALL_PYTHON_DIR AND PYTHONINTERP_FOUND)\r
-  execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}'))"\r
-                    OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH\r
-                    OUTPUT_STRIP_TRAILING_WHITESPACE )\r
-\r
-  get_filename_component (_ABS_PYTHON_MODULE_PATH ${_ABS_PYTHON_MODULE_PATH} ABSOLUTE)\r
-  file (RELATIVE_PATH _REL_PYTHON_MODULE_PATH ${CMAKE_INSTALL_PREFIX} ${_ABS_PYTHON_MODULE_PATH})\r
-\r
-  set (INSTALL_PYTHON_DIR ${_REL_PYTHON_MODULE_PATH})\r
-\r
-endif ()\r
-\r
-if (BUILD_GUILE)\r
-  find_package (Guile)\r
-endif ()\r
-\r
-if (USE_SWIG)\r
-  find_package (SWIG)\r
-endif ()\r
-\r
-add_subdirectory (swig)\r
-\r
-if (BUILD_OCTAVE)\r
-  find_package (Octave)\r
-endif ()\r
-\r
-if (BUILD_MATLAB)\r
-  find_package (Matlab)\r
-endif ()\r
-\r
-if (OCTAVE_FOUND OR Matlab_FOUND)\r
-  add_subdirectory (octave)\r
-endif ()\r
-\r
-enable_testing ()\r
-add_subdirectory (test)\r
-\r
-set (CPACK_PACKAGE_NAME          "${CMAKE_PROJECT_NAME}")\r
-set (CPACK_PACKAGE_VERSION_MAJOR "${NLOPT_MAJOR_VERSION}")\r
-set (CPACK_PACKAGE_VERSION_MINOR "${NLOPT_MINOR_VERSION}")\r
-set (CPACK_PACKAGE_VERSION_PATCH "${NLOPT_BUGFIX_VERSION}")\r
-set (CPACK_SOURCE_GENERATOR      "TBZ2;TGZ"    )\r
-set (CPACK_BINARY_STGZ           "OFF"        )\r
-set (CPACK_BINARY_TBZ2           "ON"         )\r
-set (CPACK_BINARY_TGZ            "ON"         )\r
-set (CPACK_BINARY_TZ             "OFF"        )\r
-set (CPACK_SOURCE_IGNORE_FILES ".git;/build;.*~;${CPACK_SOURCE_IGNORE_FILES}")\r
-\r
-set (CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${NLOPT_VERSION_STRING})\r
-\r
-include (CPack)\r
-\r
-# configuration files\r
-export (TARGETS ${nlopt_lib} NAMESPACE NLopt:: FILE ${PROJECT_BINARY_DIR}/NLoptLibraryDepends.cmake)\r
-\r
-# Install the export set for use with the install-tree\r
-install(EXPORT NLoptLibraryDepends\r
-        NAMESPACE NLopt::\r
-        DESTINATION ${RELATIVE_INSTALL_CMAKE_DIR}\r
-        COMPONENT Development)\r
-\r
-# Create a NLOPTConfig.cmake file for the use from the install tree\r
-# and install it\r
-set (NLOPT_LIBRARIES "NLopt::${nlopt_lib}")\r
-\r
-set (NLOPT_CMAKE_DIR "${INSTALL_CMAKE_DIR}")\r
-file (RELATIVE_PATH rel_include_dir "${NLOPT_CMAKE_DIR}" "${INSTALL_INCLUDE_DIR}")\r
-list (APPEND RELATIVE_NLOPT_INCLUDE_DIRS ${rel_include_dir})\r
-\r
-file (RELATIVE_PATH rel_lib_dir "${NLOPT_CMAKE_DIR}" "${INSTALL_LIB_DIR}")\r
-list (APPEND RELATIVE_NLOPT_LIB_DIR ${rel_lib_dir})\r
-\r
-configure_file (cmake/NLoptConfig.cmake.in NLoptConfig.cmake @ONLY)\r
-configure_file (cmake/NLoptConfigVersion.cmake.in NLoptConfigVersion.cmake @ONLY)\r
-install (FILES\r
-          ${CMAKE_CURRENT_BINARY_DIR}/NLoptConfig.cmake\r
-          ${CMAKE_CURRENT_BINARY_DIR}/NLoptConfigVersion.cmake\r
-         DESTINATION ${RELATIVE_INSTALL_CMAKE_DIR}\r
-         COMPONENT Development)\r
-\r
+#==============================================================================
+# NLOPT CMake file
+#
+# NLopt is a free/open-source library for nonlinear optimization, providing
+# a common interface for a number of different free optimization routines
+# available online as well as original implementations of various other
+# algorithms
+# WEBSITE: http://ab-initio.mit.edu/wiki/index.php/NLopt
+# AUTHOR: Steven G. Johnson
+#
+# This CMakeLists.txt file was created to compile NLOPT with the CMAKE utility.
+# Benoit Scherrer, 2010 CRL, Harvard Medical School
+# Copyright (c) 2008-2009 Children's Hospital Boston
+#==============================================================================
+cmake_minimum_required (VERSION 3.0)
+
+if (NOT DEFINED CMAKE_BUILD_TYPE)
+  set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
+endif ()
+
+project (nlopt)
+
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+
+option (WITH_CXX "enable cxx routines" OFF)
+option (BUILD_SHARED_LIBS "Build NLopt as a shared library" ON)
+option (BUILD_PYTHON "build python bindings" ON)
+option (BUILD_OCTAVE "build octave bindings" ON)
+option (BUILD_MATLAB "build matlab bindings" ON)
+option (BUILD_GUILE "build guile bindings" ON)
+option (USE_SWIG "use SWIG to build bindings" ON)
+
+set (NLOPT_SUFFIX)
+if (WITH_CXX)
+  set (NLOPT_SUFFIX _cxx)
+endif ()
+
+include (GNUInstallDirs)
+
+# Offer the user the choice of overriding the installation directories
+set (INSTALL_LIB_DIR     ${CMAKE_INSTALL_LIBDIR}        CACHE PATH "Installation directory for libraries")
+set (INSTALL_BIN_DIR     ${CMAKE_INSTALL_BINDIR}        CACHE PATH "Installation directory for executables")
+set (INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}    CACHE PATH "Installation directory for header files")
+set (INSTALL_DATA_DIR    ${CMAKE_INSTALL_DATADIR}/nlopt CACHE PATH "Installation directory for data files")
+set (INSTALL_MAN_DIR     ${CMAKE_INSTALL_MANDIR}        CACHE PATH "Installation directory for man documentation")
+set (INSTALL_CMAKE_DIR   ${INSTALL_LIB_DIR}/cmake/nlopt CACHE PATH "Installation directory for cmake config files")
+
+# Make relative paths absolute (needed later on)
+foreach (p LIB BIN INCLUDE DATA CMAKE)
+  set (var INSTALL_${p}_DIR)
+  set (RELATIVE_INSTALL_${p}_DIR ${INSTALL_${p}_DIR})
+  if (NOT IS_ABSOLUTE "${${var}}")
+    set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
+  endif ()
+endforeach ()
+
+
+set (CMAKE_INSTALL_RPATH ${INSTALL_LIB_DIR})
+set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+if(POLICY CMP0042)
+  # Set MACOSX_RPATH to ON
+  cmake_policy(SET CMP0042 NEW)
+endif()
+
+include (CheckIncludeFiles)
+include (CheckFunctionExists)
+include (CheckTypeSize)
+include (CheckCCompilerFlag)
+include (CheckCXXSymbolExists)
+include (CheckCXXCompilerFlag)
+include (CheckLibraryExists)
+
+#==============================================================================
+# COMPILATION CHECKINGS and CONFIGURATION GENERATION
+#==============================================================================
+check_include_file (dlfcn.h HAVE_DLFCN_H)
+check_include_file (getopt.h HAVE_GETOPT_H)
+check_include_file (unistd.h HAVE_UNISTD_H)
+check_include_file (string.h HAVE_STRING_H)
+check_include_file (strings.h HAVE_STRINGS_H)
+check_include_file (inttypes.h HAVE_INTTYPES_H)
+check_include_file (memory.h HAVE_MEMORY_H)
+check_include_file (stdlib.h HAVE_STDLIB_H)
+check_include_file (stdint.h HAVE_STDINT_H)
+check_include_file (time.h HAVE_TIME_H)
+check_include_file (sys/types.h HAVE_SYS_TYPES_H)
+check_include_file (sys/stat.h HAVE_SYS_STAT_H)
+check_include_file (sys/time.h HAVE_SYS_TIME_H)
+if (HAVE_TIME_H AND HAVE_SYS_TIME_H)
+  set (TIME_WITH_SYS_TIME TRUE)
+endif ()
+check_function_exists (getpid HAVE_GETPID)
+check_function_exists (syscall HAVE_GETTID_SYSCALL)
+check_function_exists (isinf HAVE_ISINF)
+check_function_exists (isnan HAVE_ISNAN)
+check_function_exists (gettimeofday HAVE_GETTIMEOFDAY)
+check_function_exists (qsort_r HAVE_QSORT_R)
+check_function_exists (time HAVE_TIME)
+check_function_exists (copysign HAVE_COPYSIGN)
+check_type_size ("uint32_t" SIZEOF_UINT32_T)
+set (HAVE_UINT32_T ${SIZEOF_UINT32_T})
+check_type_size ("unsigned int" SIZEOF_UNSIGNED_INT)
+check_type_size ("unsigned long" SIZEOF_UNSIGNED_LONG)
+
+check_library_exists ("m" sqrt "" HAVE_LIBM)
+if (HAVE_LIBM)
+  set (M_LIBRARY m)
+endif()
+
+if (NOT DEFINED HAVE_FPCLASSIFY)
+  message(STATUS "Looking for fpclassify")
+  file (WRITE ${PROJECT_BINARY_DIR}/fpclassify.c "#include <math.h>\n")
+  file (APPEND ${PROJECT_BINARY_DIR}/fpclassify.c "int main(void) {\n")
+  file (APPEND ${PROJECT_BINARY_DIR}/fpclassify.c "if (!fpclassify(3.14159)) fpclassify(2.7183);\n")
+  file (APPEND ${PROJECT_BINARY_DIR}/fpclassify.c "  return 0; }\n")
+  try_compile (HAVE_FPCLASSIFY
+  ${PROJECT_BINARY_DIR}/build_fpclassify
+  ${PROJECT_BINARY_DIR}/fpclassify.c
+  CMAKE_FLAGS -DLINK_LIBRARIES=m)
+  message(STATUS "Looking for fpclassify - ${HAVE_FPCLASSIFY}")
+endif ()
+
+option (WITH_THREADLOCAL "check thread local keyword" ON)
+if (WITH_THREADLOCAL AND NOT DEFINED HAVE_THREAD_LOCAL_STORAGE)
+  foreach (_THREADLOCAL_KEY "__thread" "__declspec(thread)")
+    unset (HAVE_THREAD_LOCAL_STORAGE CACHE)
+    check_c_source_compiles("
+    ${_THREADLOCAL_KEY} int tls;
+
+    int main(void) {
+        return 0;
+    }" HAVE_THREAD_LOCAL_STORAGE)
+    if (${HAVE_THREAD_LOCAL_STORAGE})
+      set (THREADLOCAL ${_THREADLOCAL_KEY})
+    endif ()
+  endforeach()
+endif ()
+
+if (WITH_CXX OR BUILD_PYTHON OR BUILD_GUILE OR BUILD_OCTAVE)
+  check_cxx_symbol_exists (_LIBCPP_VERSION string SYSTEM_HAS_LIBCPP)
+  if (SYSTEM_HAS_LIBCPP)
+    check_cxx_compiler_flag ("-std=c++11" SUPPORTS_STDCXX11)
+    if (SUPPORTS_STDCXX11)
+      set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
+    endif ()
+  endif ()
+endif ()
+
+#==============================================================================
+# version
+#==============================================================================
+set (NLOPT_MAJOR_VERSION "2")
+set (NLOPT_MINOR_VERSION "5")
+set (NLOPT_BUGFIX_VERSION "0")
+set (NLOPT_VERSION_STRING ${NLOPT_MAJOR_VERSION}.${NLOPT_MINOR_VERSION}.${NLOPT_BUGFIX_VERSION})
+message (STATUS "NLopt version ${NLOPT_VERSION_STRING}")
+
+#==============================================================================
+# CREATE nlopt_config.h
+#==============================================================================
+
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/nlopt_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/nlopt_config.h IMMEDIATE)
+
+# pkgconfig file
+if (UNIX OR MINGW)
+  configure_file (${CMAKE_CURRENT_SOURCE_DIR}/nlopt.pc.in ${CMAKE_CURRENT_BINARY_DIR}/nlopt.pc @ONLY)
+  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/nlopt.pc DESTINATION ${RELATIVE_INSTALL_LIB_DIR}/pkgconfig)
+endif ()
+
+#==============================================================================
+# nlopt LIBRARY TARGET (SHARED OR STATIC)
+#==============================================================================
+
+configure_file (api/nlopt.h ${PROJECT_BINARY_DIR}/api/nlopt.h COPYONLY)
+
+set (NLOPT_HEADERS
+  ${PROJECT_BINARY_DIR}/api/nlopt.h ${PROJECT_BINARY_DIR}/api/nlopt.hpp ${PROJECT_BINARY_DIR}/api/nlopt.f
+)
+
+set (NLOPT_SOURCES
+  direct/DIRect.c direct/direct_wrap.c direct/DIRserial.c direct/DIRsubrout.c direct/direct-internal.h direct/direct.h
+  cdirect/cdirect.c cdirect/hybrid.c cdirect/cdirect.h
+  praxis/praxis.c praxis/praxis.h
+  luksan/plis.c luksan/plip.c luksan/pnet.c luksan/mssubs.c luksan/pssubs.c luksan/luksan.h
+  crs/crs.c crs/crs.h
+  mlsl/mlsl.c mlsl/mlsl.h
+  mma/mma.c mma/mma.h mma/ccsa_quadratic.c
+  cobyla/cobyla.c cobyla/cobyla.h
+  newuoa/newuoa.c newuoa/newuoa.h
+  neldermead/nldrmd.c neldermead/neldermead.h neldermead/sbplx.c
+  auglag/auglag.c auglag/auglag.h
+  bobyqa/bobyqa.c bobyqa/bobyqa.h
+  isres/isres.c isres/isres.h
+  slsqp/slsqp.c slsqp/slsqp.h
+  esch/esch.c esch/esch.h
+  api/general.c api/options.c api/optimize.c api/deprecated.c api/nlopt-internal.h api/nlopt.h api/f77api.c api/f77funcs.h api/f77funcs_.h api/nlopt.hpp api/nlopt-in.hpp
+  util/mt19937ar.c util/sobolseq.c util/soboldata.h util/timer.c util/stop.c util/nlopt-util.h util/redblack.c util/redblack.h util/qsort_r.c util/rescale.c
+)
+
+if (WITH_CXX)
+  list (APPEND NLOPT_SOURCES stogo/global.cc stogo/linalg.cc stogo/local.cc stogo/stogo.cc stogo/tools.cc stogo/global.h stogo/linalg.h stogo/local.h stogo/stogo_config.h stogo/stogo.h stogo/tools.h)
+endif ()
+
+install (FILES ${NLOPT_HEADERS} DESTINATION ${INSTALL_INCLUDE_DIR})
+
+set (nlopt_lib nlopt${NLOPT_SUFFIX})
+add_library (${nlopt_lib} ${NLOPT_SOURCES})
+target_link_libraries (${nlopt_lib} ${M_LIBRARY})
+
+set_target_properties (${nlopt_lib} PROPERTIES SOVERSION 0)
+set_target_properties (${nlopt_lib} PROPERTIES VERSION 0.9.0)
+
+#==============================================================================
+# INCLUDE DIRECTORIES
+#==============================================================================
+target_include_directories (${nlopt_lib} PRIVATE
+  ${PROJECT_BINARY_DIR}/api
+  ${PROJECT_BINARY_DIR}
+  stogo
+  util
+  direct
+  cdirect
+  praxis
+  luksan
+  crs
+  mlsl
+  mma
+  cobyla
+  newuoa
+  neldermead
+  auglag
+  bobyqa
+  isres
+  slsqp
+  esch
+  api)
+
+get_target_property (NLOPT_PRIVATE_INCLUDE_DIRS ${nlopt_lib} INCLUDE_DIRECTORIES)
+target_include_directories (${nlopt_lib} INTERFACE "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/api>" "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
+
+if (BUILD_SHARED_LIBS)
+  target_compile_definitions (${nlopt_lib} PUBLIC -DNLOPT_DLL)
+  target_compile_definitions (${nlopt_lib} PRIVATE -DNLOPT_DLL_EXPORT)
+endif ()
+
+# pass -fPIC in case swig module is built with static library
+if (NOT BUILD_SHARED_LIBS)
+  check_c_compiler_flag (-fPIC HAS_FPIC)
+  if (HAS_FPIC)
+    set (CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")
+    set (CMAKE_CXX_FLAGS "-fPIC ${CMAKE_CXX_FLAGS}")
+  endif ()
+endif ()
+
+install ( TARGETS ${nlopt_lib}
+          EXPORT  NLoptLibraryDepends
+          RUNTIME DESTINATION ${RELATIVE_INSTALL_BIN_DIR}
+          LIBRARY DESTINATION ${RELATIVE_INSTALL_LIB_DIR}
+          ARCHIVE DESTINATION ${RELATIVE_INSTALL_LIB_DIR}
+        )
+
+if (MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1)
+  install (FILES $<TARGET_PDB_FILE:${nlopt_lib}> DESTINATION ${RELATIVE_INSTALL_BIN_DIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT Debug)
+endif ()
+
+add_subdirectory (api)
+
+if (BUILD_PYTHON)
+  find_package (PythonInterp)
+  find_package (PythonLibs)
+  find_package (NumPy)
+endif ()
+
+if (NOT DEFINED INSTALL_PYTHON_DIR AND PYTHONINTERP_FOUND)
+  execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}'))"
+                    OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH
+                    OUTPUT_STRIP_TRAILING_WHITESPACE )
+
+  get_filename_component (_ABS_PYTHON_MODULE_PATH ${_ABS_PYTHON_MODULE_PATH} ABSOLUTE)
+  file (RELATIVE_PATH _REL_PYTHON_MODULE_PATH ${CMAKE_INSTALL_PREFIX} ${_ABS_PYTHON_MODULE_PATH})
+
+  set (INSTALL_PYTHON_DIR ${_REL_PYTHON_MODULE_PATH})
+
+endif ()
+
+if (BUILD_GUILE)
+  find_package (Guile)
+endif ()
+
+if (USE_SWIG)
+  find_package (SWIG)
+endif ()
+
+add_subdirectory (swig)
+
+if (BUILD_OCTAVE)
+  find_package (Octave)
+endif ()
+
+if (BUILD_MATLAB)
+  find_package (Matlab)
+endif ()
+
+if (OCTAVE_FOUND OR Matlab_FOUND)
+  add_subdirectory (octave)
+endif ()
+
+enable_testing ()
+add_subdirectory (test)
+
+set (CPACK_PACKAGE_NAME          "${CMAKE_PROJECT_NAME}")
+set (CPACK_PACKAGE_VERSION_MAJOR "${NLOPT_MAJOR_VERSION}")
+set (CPACK_PACKAGE_VERSION_MINOR "${NLOPT_MINOR_VERSION}")
+set (CPACK_PACKAGE_VERSION_PATCH "${NLOPT_BUGFIX_VERSION}")
+set (CPACK_SOURCE_GENERATOR      "TBZ2;TGZ"    )
+set (CPACK_BINARY_STGZ           "OFF"        )
+set (CPACK_BINARY_TBZ2           "ON"         )
+set (CPACK_BINARY_TGZ            "ON"         )
+set (CPACK_BINARY_TZ             "OFF"        )
+set (CPACK_SOURCE_IGNORE_FILES ".git;/build;.*~;${CPACK_SOURCE_IGNORE_FILES}")
+
+set (CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${NLOPT_VERSION_STRING})
+
+include (CPack)
+
+# configuration files
+export (TARGETS ${nlopt_lib} NAMESPACE NLopt:: FILE ${PROJECT_BINARY_DIR}/NLoptLibraryDepends.cmake)
+
+# Install the export set for use with the install-tree
+install(EXPORT NLoptLibraryDepends
+        NAMESPACE NLopt::
+        DESTINATION ${RELATIVE_INSTALL_CMAKE_DIR}
+        COMPONENT Development)
+
+# Create a NLOPTConfig.cmake file for the use from the install tree
+# and install it
+set (NLOPT_LIBRARIES "NLopt::${nlopt_lib}")
+
+set (NLOPT_CMAKE_DIR "${INSTALL_CMAKE_DIR}")
+file (RELATIVE_PATH rel_include_dir "${NLOPT_CMAKE_DIR}" "${INSTALL_INCLUDE_DIR}")
+list (APPEND RELATIVE_NLOPT_INCLUDE_DIRS ${rel_include_dir})
+
+file (RELATIVE_PATH rel_lib_dir "${NLOPT_CMAKE_DIR}" "${INSTALL_LIB_DIR}")
+list (APPEND RELATIVE_NLOPT_LIB_DIR ${rel_lib_dir})
+
+configure_file (cmake/NLoptConfig.cmake.in NLoptConfig.cmake @ONLY)
+configure_file (cmake/NLoptConfigVersion.cmake.in NLoptConfigVersion.cmake @ONLY)
+install (FILES
+          ${CMAKE_CURRENT_BINARY_DIR}/NLoptConfig.cmake
+          ${CMAKE_CURRENT_BINARY_DIR}/NLoptConfigVersion.cmake
+         DESTINATION ${RELATIVE_INSTALL_CMAKE_DIR}
+         COMPONENT Development)
+
index 8732e315484fb6628222497b88947c5649403256..2908b35a61a30dd55896acaa34ed94008c62e962 100644 (file)
@@ -1,49 +1,49 @@
-/* Copyright (c) 2008-2013 Carlos Henrique da Silva Santos\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining\r
- * a copy of this software and associated documentation files (the\r
- * "Software"), to deal in the Software without restriction, including\r
- * without limitation the rights to use, copy, modify, merge, publish,\r
- * distribute, sublicense, and/or sell copies of the Software, and to\r
- * permit persons to whom the Software is furnished to do so, subject to\r
- * the following conditions:\r
- * \r
- * The above copyright notice and this permission notice shall be\r
- * included in all copies or substantial portions of the Software.\r
- * \r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
- */\r
-\r
-#ifndef ES_POP_H\r
-#define ES_POP_H 1\r
-\r
-#include "nlopt-util.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C"\r
-{\r
-#endif /* __cplusplus */\r
-\r
-nlopt_result chevolutionarystrategy(\r
-     unsigned, /* Number of input parameters */\r
-     nlopt_func, /* Recursive Objective Funtion Call */\r
-     void *,   /* Data to Objective Function */\r
-     const double*,                            /* Lower bound values */\r
-     const double*,                            /* Upper bound values */\r
-     double*,                          /* in: initial guess, out: minimizer */\r
-     double*,\r
-     nlopt_stopping*,          /* nlopt stop condition */\r
-     unsigned,                         /* Number of Parents */ \r
-     unsigned);                        /* Number of Offsprings */\r
-\r
-#ifdef __cplusplus\r
-}  /* extern "C" */\r
-#endif /* __cplusplus */\r
-\r
-#endif /* ES_POP_H */\r
+/* Copyright (c) 2008-2013 Carlos Henrique da Silva Santos
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+ */
+
+#ifndef ES_POP_H
+#define ES_POP_H 1
+
+#include "nlopt-util.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+nlopt_result chevolutionarystrategy(
+     unsigned, /* Number of input parameters */
+     nlopt_func, /* Recursive Objective Funtion Call */
+     void *,   /* Data to Objective Function */
+     const double*,                            /* Lower bound values */
+     const double*,                            /* Upper bound values */
+     double*,                          /* in: initial guess, out: minimizer */
+     double*,
+     nlopt_stopping*,          /* nlopt stop condition */
+     unsigned,                         /* Number of Parents */ 
+     unsigned);                        /* Number of Offsprings */
+
+#ifdef __cplusplus
+}  /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* ES_POP_H */
index 0937ab73978e620b89fddf5222d85ad8e9793235..6a647c93cf3e66e43775ef5d2c0b82852dd295e3 100644 (file)
-/*==============================================================================\r
-# NLOPT CMake configuration file\r
-# \r
-# NLopt is a free/open-source library for nonlinear optimization, providing \r
-# a common interface for a number of different free optimization routines \r
-# available online as well as original implementations of various other \r
-# algorithms\r
-# WEBSITE: http://ab-initio.mit.edu/wiki/index.php/NLopt \r
-# AUTHOR: Steven G. Johnson\r
-#\r
-# This config.cmake.h.in file was created to compile NLOPT with the CMAKE utility.\r
-# Benoit Scherrer, 2010 CRL, Harvard Medical School\r
-# Copyright (c) 2008-2009 Children's Hospital Boston \r
-#\r
-# Minor changes to the source was applied to make possible the compilation with\r
-# Cmake under Linux/Win32\r
-#============================================================================*/\r
-\r
-/* Bugfix version number. */\r
-#define BUGFIX_VERSION @NLOPT_BUGFIX_VERSION@\r
-\r
-/* Define to enable extra debugging code. */\r
-#undef DEBUG\r
-\r
-/* Define to 1 if you have the `BSDgettimeofday' function. */\r
-#undef HAVE_BSDGETTIMEOFDAY\r
-\r
-/* Define if the copysign function/macro is available. */\r
-#cmakedefine HAVE_COPYSIGN\r
-\r
-/* Define to 1 if you have the <dlfcn.h> header file. */\r
-#cmakedefine HAVE_DLFCN_H\r
-\r
-/* Define if the fpclassify() function/macro is available. */\r
-#cmakedefine HAVE_FPCLASSIFY\r
-\r
-/* Define to 1 if you have the <getopt.h> header file. */\r
-#cmakedefine HAVE_GETOPT_H\r
-\r
-/* Define to 1 if you have the `getpid' function. */\r
-#cmakedefine HAVE_GETPID\r
-\r
-/* Define if syscall(SYS_gettid) available. */\r
-#undef HAVE_GETTID_SYSCALL\r
-\r
-/* Define to 1 if you have the `gettimeofday' function. */\r
-#cmakedefine HAVE_GETTIMEOFDAY\r
-\r
-/* Define to 1 if you have the <inttypes.h> header file. */\r
-#cmakedefine HAVE_INTTYPES_H\r
-\r
-/* Define if the isinf() function/macro is available. */\r
-#cmakedefine HAVE_ISINF\r
-\r
-/* Define if the isnan() function/macro is available. */\r
-#cmakedefine HAVE_ISNAN\r
-\r
-/* Define to 1 if you have the `m' library (-lm). */\r
-#undef HAVE_LIBM\r
-\r
-/* Define to 1 if you have the <memory.h> header file. */\r
-#cmakedefine HAVE_MEMORY_H\r
-\r
-/* Define to 1 if you have the `qsort_r' function. */\r
-#cmakedefine HAVE_QSORT_R\r
-\r
-/* Define to 1 if you have the <stdint.h> header file. */\r
-#cmakedefine HAVE_STDINT_H\r
-\r
-/* Define to 1 if you have the <stdlib.h> header file. */\r
-#cmakedefine HAVE_STDLIB_H\r
-\r
-/* Define to 1 if you have the <strings.h> header file. */\r
-#cmakedefine HAVE_STRINGS_H\r
-\r
-/* Define to 1 if you have the <string.h> header file. */\r
-#cmakedefine HAVE_STRING_H\r
-\r
-/* Define to 1 if you have the <sys/stat.h> header file. */\r
-#cmakedefine HAVE_SYS_STAT_H\r
-\r
-/* Define to 1 if you have the <sys/types.h> header file. */\r
-#cmakedefine HAVE_SYS_TYPES_H\r
-\r
-/* Define to 1 if you have the <sys/types.h> header file. */\r
-#cmakedefine HAVE_SYS_TIME_H\r
-\r
-/* Define to 1 if you have the `time' function. */\r
-#cmakedefine HAVE_TIME\r
-\r
-/* Define to 1 if the system has the type `uint32_t'. */\r
-#cmakedefine HAVE_UINT32_T\r
-\r
-/* Define to 1 if you have the <unistd.h> header file. */\r
-#cmakedefine HAVE_UNISTD_H\r
-\r
-/* Define to the sub-directory in which libtool stores uninstalled libraries.\r
-   */\r
-#undef LT_OBJDIR\r
-\r
-/* Major version number. */\r
-#define MAJOR_VERSION @NLOPT_MAJOR_VERSION@\r
-\r
-/* Minor version number. */\r
-#define MINOR_VERSION @NLOPT_MINOR_VERSION@\r
-\r
-/* Name of package */\r
-#undef PACKAGE\r
-\r
-/* Define to the address where bug reports for this package should be sent. */\r
-#undef PACKAGE_BUGREPORT\r
-\r
-/* Define to the full name of this package. */\r
-#undef PACKAGE_NAME\r
-\r
-/* Define to the full name and version of this package. */\r
-#undef PACKAGE_STRING\r
-\r
-/* Define to the one symbol short name of this package. */\r
-#undef PACKAGE_TARNAME\r
-\r
-/* Define to the home page for this package. */\r
-#undef PACKAGE_URL\r
-\r
-/* Define to the version of this package. */\r
-#undef PACKAGE_VERSION\r
-\r
-/* replacement for broken HUGE_VAL macro, if needed */\r
-#undef REPLACEMENT_HUGE_VAL\r
-\r
-/* The size of `unsigned int', as computed by sizeof. */\r
-#define SIZEOF_UNSIGNED_INT @SIZEOF_UNSIGNED_INT@\r
-\r
-/* The size of `unsigned long', as computed by sizeof. */\r
-#define SIZEOF_UNSIGNED_LONG @SIZEOF_UNSIGNED_LONG@\r
-\r
-/* Define to 1 if you have the ANSI C header files. */\r
-#undef STDC_HEADERS\r
-\r
-/* Define to C thread-local keyword, or to nothing if this is not supported in\r
-   your compiler. */\r
-#define THREADLOCAL @THREADLOCAL@\r
-\r
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */\r
-#cmakedefine TIME_WITH_SYS_TIME\r
-\r
-/* Version number of package */\r
-#undef VERSION\r
-\r
-/* Define if compiled including C++-based routines */\r
-#cmakedefine WITH_CXX\r
-\r
-/* Define to empty if `const' does not conform to ANSI C. */\r
-#undef const\r
-\r
-/* Define to `__inline__' or `__inline' if that's what the C compiler\r
-   calls it, or to nothing if 'inline' is not supported under any name.  */\r
-#ifndef __cplusplus\r
-#undef inline\r
-#endif\r
+/*==============================================================================
+# NLOPT CMake configuration file
+# 
+# NLopt is a free/open-source library for nonlinear optimization, providing 
+# a common interface for a number of different free optimization routines 
+# available online as well as original implementations of various other 
+# algorithms
+# WEBSITE: http://ab-initio.mit.edu/wiki/index.php/NLopt 
+# AUTHOR: Steven G. Johnson
+#
+# This config.cmake.h.in file was created to compile NLOPT with the CMAKE utility.
+# Benoit Scherrer, 2010 CRL, Harvard Medical School
+# Copyright (c) 2008-2009 Children's Hospital Boston 
+#
+# Minor changes to the source was applied to make possible the compilation with
+# Cmake under Linux/Win32
+#============================================================================*/
+
+/* Bugfix version number. */
+#define BUGFIX_VERSION @NLOPT_BUGFIX_VERSION@
+
+/* Define to enable extra debugging code. */
+#undef DEBUG
+
+/* Define to 1 if you have the `BSDgettimeofday' function. */
+#undef HAVE_BSDGETTIMEOFDAY
+
+/* Define if the copysign function/macro is available. */
+#cmakedefine HAVE_COPYSIGN
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine HAVE_DLFCN_H
+
+/* Define if the fpclassify() function/macro is available. */
+#cmakedefine HAVE_FPCLASSIFY
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#cmakedefine HAVE_GETOPT_H
+
+/* Define to 1 if you have the `getpid' function. */
+#cmakedefine HAVE_GETPID
+
+/* Define if syscall(SYS_gettid) available. */
+#undef HAVE_GETTID_SYSCALL
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#cmakedefine HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine HAVE_INTTYPES_H
+
+/* Define if the isinf() function/macro is available. */
+#cmakedefine HAVE_ISINF
+
+/* Define if the isnan() function/macro is available. */
+#cmakedefine HAVE_ISNAN
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the <memory.h> header file. */
+#cmakedefine HAVE_MEMORY_H
+
+/* Define to 1 if you have the `qsort_r' function. */
+#cmakedefine HAVE_QSORT_R
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#cmakedefine HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#cmakedefine HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#cmakedefine HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the `time' function. */
+#cmakedefine HAVE_TIME
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#cmakedefine HAVE_UINT32_T
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine HAVE_UNISTD_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Major version number. */
+#define MAJOR_VERSION @NLOPT_MAJOR_VERSION@
+
+/* Minor version number. */
+#define MINOR_VERSION @NLOPT_MINOR_VERSION@
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* replacement for broken HUGE_VAL macro, if needed */
+#undef REPLACEMENT_HUGE_VAL
+
+/* The size of `unsigned int', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_INT @SIZEOF_UNSIGNED_INT@
+
+/* The size of `unsigned long', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_LONG @SIZEOF_UNSIGNED_LONG@
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to C thread-local keyword, or to nothing if this is not supported in
+   your compiler. */
+#define THREADLOCAL @THREADLOCAL@
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#cmakedefine TIME_WITH_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Define if compiled including C++-based routines */
+#cmakedefine WITH_CXX
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#undef inline
+#endif