update build system
This commit is contained in:
		| @@ -33,8 +33,8 @@ target_link_libraries(netcdfcxx_legacy_static ${NETCDF_LIBRARY}) | |||||||
| install(TARGETS netcdfcxx_legacy DESTINATION lib) | install(TARGETS netcdfcxx_legacy DESTINATION lib) | ||||||
| install(TARGETS netcdfcxx_legacy_static DESTINATION lib) | install(TARGETS netcdfcxx_legacy_static DESTINATION lib) | ||||||
| # 头文件安装命令 | # 头文件安装命令 | ||||||
| install(FILES lib/netcdfcpp.h DESTINATION include) | install(FILES lib/netcdfcpp.h DESTINATION include/netcdfcxx_legacy) | ||||||
| install(FILES lib/ncvalues.h DESTINATION include) | install(FILES lib/ncvalues.h DESTINATION include/netcdfcxx_legacy) | ||||||
|  |  | ||||||
| # 以下部分为例子程序的编译 | # 以下部分为例子程序的编译 | ||||||
| # 设置可执行文件的输出地址 | # 设置可执行文件的输出地址 | ||||||
| @@ -45,7 +45,7 @@ macro(add_sample name) | |||||||
| 	# 添加可执行文件 命令行 | 	# 添加可执行文件 命令行 | ||||||
| 	add_executable(${name} example/${name}.cpp) | 	add_executable(${name} example/${name}.cpp) | ||||||
| 	# 为安装文件添加动态库的搜索地址 在Windows下并没有什么用 直接忽略 | 	# 为安装文件添加动态库的搜索地址 在Windows下并没有什么用 直接忽略 | ||||||
| 	set_target_properties(${name} PROPERTIES INSTALL_RPATH /opt/lib) | 	set_target_properties(${name} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib) | ||||||
| 	# 链接动态库 | 	# 链接动态库 | ||||||
| 	target_link_libraries(${name} PUBLIC netcdfcxx_legacy) | 	target_link_libraries(${name} PUBLIC netcdfcxx_legacy) | ||||||
| endmacro() | endmacro() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user