# ============================================================================
# Copyright (c) 2014 Andrew Hundt and Alex Strickland
# All rights reserved.
#
# See COPYING file for license information.
# ============================================================================

##############################################################################
# @file  CMakeLists.txt
# @brief Build configuration for CIS source files.
#
# This CMakeLists.txt file configures the build for the CIS programming
# assignments PA1 and PA2.
#
# REQUIRED EXECUTABLES TO BUILD:
#
# 1. cisHW1-2 - Main executable for PA1 and PA2
#
# DEPENDENCIES:
#
# Required libraries:
# - Eigen3: Linear algebra operations
# - Boost: Program options, math functions, accumulators
#
# Optional libraries:
# - PCL: Point cloud library (if used)
#
# BUILD CONFIGURATION:
#
# - Support both Debug and Release builds
# - Enable multi-threading support
# - Configure compiler optimizations
##############################################################################

# Set minimum CMake version
cmake_minimum_required(VERSION 3.0)

# Find required packages
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS program_options)

# Add executable for PA1 and PA2
add_executable(cisHW1-2 cisHW1-2.cpp)

# Link libraries
target_link_libraries(cisHW1-2 
    Eigen3::Eigen
    Boost::program_options
)

# Set C++ standard
target_compile_features(cisHW1-2 PRIVATE cxx_std_11)

# Compiler flags
target_compile_options(cisHW1-2 PRIVATE
    $<$<CONFIG:Debug>:-g -O0>
    $<$<CONFIG:Release>:-O3 -DNDEBUG>
)

# Include directories
target_include_directories(cisHW1-2 PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/../include
)

# Installation
install(TARGETS cisHW1-2
    RUNTIME DESTINATION bin
)
