cmake_minimum_required(VERSION 3.0) project(Sophiar2) set(CMAKE_CXX_STANDARD 20) add_compile_options(-march=native) add_compile_options(-mno-avx) # enable avx will cause some stack pointer alignment error with Eigen include_directories(./src) find_package(Boost REQUIRED COMPONENTS iostreams) list(APPEND EXTRA_LIBS ${Boost_LIBRARIES}) include_directories(${Boost_INCLUDE_DIRS}) find_package(fmt REQUIRED) list(APPEND EXTRA_LIBS fmt::fmt) find_package(spdlog REQUIRED) list(APPEND EXTRA_LIBS spdlog::spdlog) add_compile_definitions(SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE) find_package(Eigen3 REQUIRED) list(APPEND EXTRA_LIBS Eigen3::Eigen) find_package(nlohmann_json REQUIRED) list(APPEND EXTRA_LIBS nlohmann_json::nlohmann_json) file(GLOB_RECURSE ALGORITHM_IMPL_FILES ./src/algorithm/*.cpp) file(GLOB_RECURSE CORE_IMPL_FILES ./src/core/*.cpp) file(GLOB_RECURSE ROBOT_IMPL_FILES ./src/robot/*.cpp) file(GLOB_RECURSE SRC_FILES ./src/*.cpp) add_executable(${PROJECT_NAME} ${SRC_FILES}) IF (WIN32) list(APPEND EXTRA_LIBS ws2_32 wsock32 winmm bcrypt) ELSEIF (UNIX) list(APPEND crypt) ENDIF () target_link_libraries(${PROJECT_NAME} ${EXTRA_LIBS}) add_subdirectory(app) add_subdirectory(benchmark) add_subdirectory(tests)