cmake_minimum_required(VERSION 3.13) project(Sophiar2Lib) set(CMAKE_CXX_STANDARD 23) #set(CMAKE_BUILD_TYPE Release) add_compile_options(-march=native) #add_compile_options(-mno-avx) # enable avx will cause some stack pointer alignment error with Eigen #add_compile_definitions(CORO_SIGNAL2_USE_TIMER) add_compile_definitions(EIGEN_DONT_VECTORIZE) add_compile_definitions(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT) include_directories(.) find_package(Boost REQUIRED COMPONENTS iostreams) list(APPEND BASIC_LIBS ${Boost_LIBRARIES}) include_directories(${Boost_INCLUDE_DIRS}) if (NOT WIN32) find_package(fmt REQUIRED) list(APPEND BASIC_LIBS fmt::fmt) endif () find_package(spdlog REQUIRED) list(APPEND BASIC_LIBS spdlog::spdlog) add_compile_definitions(SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE) find_package(Eigen3 REQUIRED) list(APPEND BASIC_LIBS Eigen3::Eigen) find_package(nlohmann_json REQUIRED) list(APPEND BASIC_LIBS nlohmann_json::nlohmann_json) IF (WIN32) list(APPEND BASIC_LIBS ws2_32 wsock32 winmm bcrypt) ELSEIF (UNIX) list(APPEND BASIC_LIBS crypt) ENDIF () include(core/CMakeLists.txt) include(algorithm/CMakeLists.txt) include(sensor/CMakeLists.txt) include(robot/CMakeLists.txt) add_library(${PROJECT_NAME} main_empty.cpp) target_link_libraries(${PROJECT_NAME} ${BASIC_LIBS}) target_link_libraries(${PROJECT_NAME} ${SOPHIAR_LIBS}) #add_subdirectory(../tests tests)