Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
studieren666
nlopt
提交
cc86c57c
N
nlopt
项目概览
studieren666
/
nlopt
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nlopt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
cc86c57c
编写于
10月 13, 2018
作者:
J
Julien Schueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support cmake 3.13
上级
ffd93c31
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
12 deletion
+31
-12
src/swig/CMakeLists.txt
src/swig/CMakeLists.txt
+31
-12
未找到文件。
src/swig/CMakeLists.txt
浏览文件 @
cc86c57c
if
(
POLICY CMP0078
)
cmake_policy
(
SET CMP0078 NEW
)
endif
()
include
(
UseSWIG
)
include
(
TargetLinkLibrariesWithDynamicLookup
)
...
...
@@ -16,24 +19,32 @@ set_source_files_properties (nlopt.i PROPERTIES CPLUSPLUS ON)
if
(
NUMPY_FOUND AND PYTHONLIBS_FOUND
)
set
(
SWIG_MODULE_nlopt_EXTRA_DEPS nlopt-python.i numpy.i
)
set
(
SWIG_MODULE_nlopt_
python_
EXTRA_DEPS nlopt-python.i numpy.i
)
# swig_add_module is deprecated
if
(
CMAKE_VERSION VERSION_LESS 3.8
)
swig_add_module
(
nlopt python nlopt.i
)
swig_add_module
(
nlopt_python python nlopt.i
)
else
()
swig_add_library
(
nlopt_python LANGUAGE python SOURCES nlopt.i
)
endif
()
# UseSWIG generates now standard target names
if
(
CMAKE_VERSION VERSION_LESS 3.13
)
set
(
nlopt_python
${
SWIG_MODULE_nlopt_python_REAL_NAME
}
)
else
()
s
wig_add_library
(
nlopt LANGUAGE python SOURCES nlopt.i
)
s
et
(
nlopt_python
"nlopt_python"
)
endif
()
target_include_directories
(
${
SWIG_MODULE_nlopt_REAL_NAME
}
PUBLIC
${
PYTHON_INCLUDE_DIRS
}
)
target_include_directories
(
${
SWIG_MODULE_nlopt_REAL_NAME
}
PUBLIC
${
NUMPY_INCLUDE_DIRS
}
)
target_include_directories
(
${
nlopt_python
}
PUBLIC
${
PYTHON_INCLUDE_DIRS
}
)
target_include_directories
(
${
nlopt_python
}
PUBLIC
${
NUMPY_INCLUDE_DIRS
}
)
swig_link_libraries
(
nlopt
${
nlopt_lib
}
)
target_link_libraries_with_dynamic_lookup
(
${
SWIG_MODULE_nlopt_REAL_NAME
}
${
PYTHON_LIBRARIES
}
)
swig_link_libraries
(
nlopt
_python
${
nlopt_lib
}
)
target_link_libraries_with_dynamic_lookup
(
${
nlopt_python
}
${
PYTHON_LIBRARIES
}
)
set_target_properties
(
${
SWIG_MODULE_nlopt_REAL_NAME
}
PROPERTIES OUTPUT_NAME _nlopt
)
set_target_properties
(
${
nlopt_python
}
PROPERTIES OUTPUT_NAME _nlopt
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/nlopt.py DESTINATION
${
INSTALL_PYTHON_DIR
}
)
install
(
TARGETS
${
SWIG_MODULE_nlopt_REAL_NAME
}
LIBRARY DESTINATION
${
INSTALL_PYTHON_DIR
}
)
install
(
TARGETS
${
nlopt_python
}
LIBRARY DESTINATION
${
INSTALL_PYTHON_DIR
}
)
endif
()
...
...
@@ -43,16 +54,24 @@ if (GUILE_FOUND AND (SWIG_VERSION VERSION_GREATER 2.0.9))
set_source_files_properties
(
nlopt.i PROPERTIES SWIG_FLAGS
"-scmstub"
)
set
(
SWIG_MODULE_nlopt_guile_EXTRA_DEPS nlopt-guile.i
)
# swig_add_module is deprecated
if
(
CMAKE_VERSION VERSION_LESS 3.8
)
swig_add_module
(
nlopt_guile guile nlopt.i
)
else
()
swig_add_library
(
nlopt_guile LANGUAGE guile SOURCES nlopt.i
)
endif
()
target_include_directories
(
${
SWIG_MODULE_nlopt_guile_REAL_NAME
}
PUBLIC
${
GUILE_INCLUDE_DIRS
}
)
# UseSWIG generates now standard target names
if
(
CMAKE_VERSION VERSION_LESS 3.13
)
set
(
nlopt_guile
${
SWIG_MODULE_nlopt_guile_REAL_NAME
}
)
else
()
set
(
nlopt_guile
"nlopt_guile"
)
endif
()
target_include_directories
(
${
nlopt_guile
}
PUBLIC
${
GUILE_INCLUDE_DIRS
}
)
swig_link_libraries
(
nlopt_guile
${
nlopt_lib
}
)
target_link_libraries_with_dynamic_lookup
(
${
SWIG_MODULE_nlopt_guile_REAL_NAME
}
${
GUILE_LIBRARIES
}
)
target_link_libraries_with_dynamic_lookup
(
${
nlopt_guile
}
${
GUILE_LIBRARIES
}
)
file
(
RELATIVE_PATH _REL_GUILE_SITE_PATH
${
GUILE_ROOT_DIR
}
${
GUILE_SITE_DIR
}
)
set
(
GUILE_SITE_PATH
${
_REL_GUILE_SITE_PATH
}
)
...
...
@@ -60,5 +79,5 @@ if (GUILE_FOUND AND (SWIG_VERSION VERSION_GREATER 2.0.9))
file
(
RELATIVE_PATH _REL_GUILE_EXTENSION_PATH
${
GUILE_ROOT_DIR
}
${
GUILE_EXTENSION_DIR
}
)
set
(
GUILE_EXTENSION_PATH
${
_REL_GUILE_EXTENSION_PATH
}
)
install
(
TARGETS
${
SWIG_MODULE_nlopt_guile_REAL_NAME
}
LIBRARY DESTINATION
${
GUILE_EXTENSION_PATH
}
)
install
(
TARGETS
${
nlopt_guile
}
LIBRARY DESTINATION
${
GUILE_EXTENSION_PATH
}
)
endif
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录