# nlopt LIBRARY TARGET (SHARED OR STATIC)\r
#==============================================================================\r
\r
+SET ( NLOPT_HEADERS \r
+ api/nlopt.h api/nlopt.hpp 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
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
)\r
\r
- OPTION(NLOPT_BUILD_SHARED "Build NLOPT as a shared library" OFF )\r
+ OPTION(BUILD_SHARED_LIBS "Build NLOPT as a shared library" OFF )\r
\r
- IF(NLOPT_BUILD_SHARED)\r
+ IF(BUILD_SHARED_LIBS)\r
ADD_DEFINITIONS(-DNLOPT_DLL)\r
ADD_DEFINITIONS(-DNLOPT_DLL_EXPORT )\r
- ADD_LIBRARY (nlopt SHARED ${NLOPT_SOURCES} )\r
- ELSE(NLOPT_BUILD_SHARED)\r
- ADD_LIBRARY (nlopt STATIC ${NLOPT_SOURCES} )\r
- ENDIF(NLOPT_BUILD_SHARED)\r
- \r
- INSTALL ( TARGETS nlopt\r
- RUNTIME DESTINATION bin\r
- LIBRARY DESTINATION lib${LIB_SUFFIX}\r
- ARCHIVE DESTINATION lib${LIB_SUFFIX}\r
- )\r
+ ENDIF(BUILD_SHARED_LIBS)\r
\r
-ADD_LIBRARY (nlopt ${NLOPT_SOURCES} )\r
-
+INSTALL ( FILES ${NLOPT_HEADERS} DESTINATION include )\r
+\r
++ADD_LIBRARY (nlopt ${NLOPT_SOURCES} )
++
++INSTALL ( TARGETS nlopt
++ RUNTIME DESTINATION bin
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
++ )
++
++\r
++