Cmake构建配置示例

配置构建产物位置

# Create build directory
echo "Creating build directory..."
mkdir -p build_static
cd build_static

# Configure QuantLib to build only static library
echo "Configuring QuantLib for static library build..."
cmake .. \
    -DENABLE_STATIC=ON \
    -DENABLE_SHARED=OFF \
    -DBUILD_EXAMPLES=OFF \
    -DBUILD_TEST_SUITE=OFF \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=./install

# Build QuantLib static library
echo "Building QuantLib static library..."
make -j$(nproc)

# Install the library
echo "Installing QuantLib static library..."
make install

echo "QuantLib static library compilation completed!"
echo "Library location: ./install/lib/libQuantLib.a"
echo "Headers location: ./install/include/"
posted @ 2025-11-25 13:18  Mr42Sir  阅读(12)  评论(0)    收藏  举报