2025-07-22 02:46:16 -04:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2025-09-03 15:30:30 -04:00
|
|
|
project(salmanoff VERSION 0.00.004 LANGUAGES CXX)
|
2025-07-22 02:46:16 -04:00
|
|
|
|
2025-07-22 04:45:23 -04:00
|
|
|
include(CMakeDependentOption)
|
|
|
|
|
|
2025-07-22 02:46:16 -04:00
|
|
|
# Set C++ standard
|
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
|
|
|
|
|
# Build type
|
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
2025-07-28 07:20:44 -04:00
|
|
|
set(CMAKE_BUILD_TYPE Debug FORCE)
|
2025-07-22 02:46:16 -04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# Compiler flags
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
|
|
|
|
|
|
|
|
|
|
# Mind oscillator configuration
|
|
|
|
|
set(MIND_VOSCILLATOR_PERIOD_MS 33 CACHE STRING "Mind's virtual osc clock rate (ms)")
|
|
|
|
|
if(NOT MIND_VOSCILLATOR_PERIOD_MS GREATER 0)
|
|
|
|
|
message(FATAL_ERROR "MIND_VOSCILLATOR_PERIOD_MS must be a positive integer > 0")
|
|
|
|
|
endif()
|
|
|
|
|
math(EXPR MIND_VOSCILLATOR_FREQ_MS "1000 / ${MIND_VOSCILLATOR_PERIOD_MS}")
|
|
|
|
|
|
2025-09-14 22:17:19 -04:00
|
|
|
# World thread configuration
|
|
|
|
|
option(WORLD_USE_BODY_THREAD
|
|
|
|
|
"Use body thread for world component instead of separate world thread" OFF)
|
|
|
|
|
|
2025-07-22 02:46:16 -04:00
|
|
|
# Configure config.h
|
|
|
|
|
configure_file(
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include/config.h.in
|
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/include/config.h
|
2025-09-14 22:17:19 -04:00
|
|
|
@ONLY
|
2025-07-22 02:46:16 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Include directories
|
|
|
|
|
include_directories(
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
2025-07-22 06:15:12 -04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/smocore/include
|
2025-07-22 02:46:16 -04:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/include
|
|
|
|
|
)
|
|
|
|
|
|
2025-07-22 04:45:23 -04:00
|
|
|
# Find core dependencies
|
2025-09-07 07:27:14 -04:00
|
|
|
# Boost 1.72.0 is required to ensure that a certain bug where boost::asio
|
|
|
|
|
# objects depend on specific copies of symbols, and boost will cause a segfault
|
|
|
|
|
# if boost::asio objects are used inside of a dlopen()'d library, is fixed.
|
|
|
|
|
find_package(Boost 1.73.0 REQUIRED COMPONENTS system)
|
2025-07-22 02:46:16 -04:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
find_package(FLEX REQUIRED)
|
|
|
|
|
find_package(BISON REQUIRED)
|
|
|
|
|
|
2025-07-22 04:45:23 -04:00
|
|
|
# Need dlopen() and dlsym()
|
|
|
|
|
find_library(DL_LIBRARY NAMES dl ldl)
|
|
|
|
|
if(NOT DL_LIBRARY)
|
|
|
|
|
message(FATAL_ERROR "Dynamic linking library (libdl/libldl) not found")
|
2025-07-22 02:46:16 -04:00
|
|
|
endif()
|
|
|
|
|
|
2025-07-22 04:45:23 -04:00
|
|
|
# Add core components
|
2025-07-22 06:15:12 -04:00
|
|
|
add_subdirectory(smocore)
|
2025-07-22 02:46:16 -04:00
|
|
|
add_subdirectory(commonLibs)
|
2025-07-22 04:45:23 -04:00
|
|
|
add_subdirectory(senseApis)
|
|
|
|
|
add_subdirectory(wilzorApis)
|
2025-07-22 02:46:16 -04:00
|
|
|
|
|
|
|
|
# Main executable
|
2025-07-22 06:00:00 -04:00
|
|
|
add_executable(salmanoff main.cpp)
|
|
|
|
|
target_link_libraries(salmanoff
|
2025-07-22 06:15:12 -04:00
|
|
|
smocore
|
2025-07-22 02:46:16 -04:00
|
|
|
${Boost_LIBRARIES}
|
2025-07-22 04:45:23 -04:00
|
|
|
${DL_LIBRARY}
|
2025-07-22 02:46:16 -04:00
|
|
|
)
|
|
|
|
|
|
2025-07-22 06:00:00 -04:00
|
|
|
install(TARGETS salmanoff DESTINATION bin)
|