Files
bobbycar-boardcomputer-firm…/CMakeLists.txt

47 lines
1.6 KiB
CMake
Raw Permalink Normal View History

2021-06-28 21:43:20 +02:00
cmake_minimum_required(VERSION 3.16.3)
2021-09-18 21:32:50 +02:00
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/sdkconfig)
message(FATAL_ERROR "sdkconfig not found (please run ./switchconf.sh)")
endif()
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.cmake)
message(FATAL_ERROR "config.cmake not found (please run ./switchconf.sh)")
endif()
file(READ_SYMLINK ${CMAKE_CURRENT_SOURCE_DIR}/sdkconfig result)
if (result STREQUAL "")
message(FATAL_ERROR "sdkconfig is not a symlink (please run ./switchconf.sh)")
endif()
file(READ_SYMLINK ${CMAKE_CURRENT_SOURCE_DIR}/config.cmake result)
if (result STREQUAL "")
message(FATAL_ERROR "config.cmake is not a symlink (please run ./switchconf.sh)")
endif()
include(config.cmake)
2021-06-28 21:43:20 +02:00
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
2022-06-25 22:16:21 +02:00
set(CMAKE_CXX_STANDARD 23)
2021-06-28 21:43:20 +02:00
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2023-04-04 06:27:23 +02:00
idf_build_set_property(CXX_COMPILE_OPTIONS -std=gnu++23 APPEND)
2022-04-03 21:37:34 +02:00
set(EXTRA_COMPONENT_DIRS
2022-07-05 11:16:19 +02:00
esp_boost
2022-04-03 21:37:34 +02:00
esp-protocols/components
)
project(${BOBBY_APP_NAME})
2021-09-18 21:32:50 +02:00
set(expected_build_folder "${CMAKE_CURRENT_SOURCE_DIR}/build")
file(READ_SYMLINK "${expected_build_folder}" expected_build_folder_resolved)
if(NOT IS_ABSOLUTE "${expected_build_folder_resolved}")
2021-09-18 21:54:58 +02:00
get_filename_component(dir "${expected_build_folder}" DIRECTORY)
2021-09-18 21:32:50 +02:00
set(expected_build_folder_resolved "${dir}/${expected_build_folder_resolved}")
endif()
if (NOT PROJECT_BINARY_DIR STREQUAL "${expected_build_folder}" AND NOT PROJECT_BINARY_DIR STREQUAL "${expected_build_folder_resolved}")
message(FATAL_ERROR "building in ${PROJECT_BINARY_DIR} is not supported, you have to build in ${expected_build_folder} or ${expected_build_folder_resolved} (please run ./switchconf.sh)")
endif()