SimpleDNA/CMakeLists.txt

35 lines
858 B
CMake
Raw Normal View History

2024-10-19 03:36:13 +00:00
cmake_minimum_required(VERSION 3.10)
project(dna)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
message("It's in ${CMAKE_BUILD_TYPE} mode.")
file(GLOB_RECURSE SRC_HPPS CONFIGURE_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/src/*.hpp)
foreach(SRC_HPP IN LISTS SRC_HPPS)
message("found header : ${SRC_HPP}")
endforeach()
file(GLOB_RECURSE SRC_CPPS CONFIGURE_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp)
foreach(SRC_CPP IN LISTS SRC_CPPS)
message("found cpp : ${SRC_CPP}")
endforeach()
add_executable(${PROJECT_NAME}_bin ${SRC_HPPS} ${SRC_CPPS})
add_subdirectory(pybind11)
pybind11_add_module(${PROJECT_NAME} ${SRC_HPPS} ${SRC_CPPS})
target_compile_definitions(${PROJECT_NAME} PRIVATE DNA_IS_PYBIND)