update build system
This commit is contained in:
parent
69a4b33b8f
commit
4733fe57ac
@ -2,15 +2,16 @@
|
||||
|
||||
cmd=${1}
|
||||
package=liblbfgs
|
||||
address=/opt
|
||||
address=/opt/stow
|
||||
targetdir=/usr/local
|
||||
|
||||
if [[ ${cmd} == "configure" && ! -d "build/" ]]; then
|
||||
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=${address}/stow/${package} -DCMAKE_BUILD_TYPE=Release
|
||||
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=${address}/${package} -DCMAKE_BUILD_TYPE=Release
|
||||
elif [[ ${cmd} == "configure" ]]; then
|
||||
cd build && rm -rf * && cmake .. -DCMAKE_INSTALL_PREFIX=${address}/stow/${package} -DCMAKE_BUILD_TYPE=Release
|
||||
cd build && rm -rf * && cmake .. -DCMAKE_INSTALL_PREFIX=${address}/${package} -DCMAKE_BUILD_TYPE=Release
|
||||
elif [[ ${cmd} == "build" ]]; then
|
||||
cd build && make
|
||||
elif [[ ${cmd} == "install" ]]; then
|
||||
cd build && sudo make install
|
||||
sudo stow --dir=${address}/stow --target=${address} ${package}
|
||||
sudo stow --dir=${address} --target=${targetdir} ${package}
|
||||
fi
|
@ -50,7 +50,7 @@ macro(add_sample name file)
|
||||
# 添加可执行文件 命令行
|
||||
add_executable(${name} sample/${file})
|
||||
# 为安装文件添加动态库的搜索地址 在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 lbfgs)
|
||||
endmacro()
|
||||
|
Loading…
Reference in New Issue
Block a user