mirror of
https://gitlab.com/manzerbredes/chess-move-interface.git
synced 2025-04-19 12:19:43 +00:00
Create CMI interface
This commit is contained in:
parent
5d3004e555
commit
8fd85102ab
6 changed files with 889 additions and 89 deletions
22
CMakeLists.txt
Normal file
22
CMakeLists.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
cmake_minimum_required(VERSION 3.18)
|
||||
project(ChessMoveInterface)
|
||||
|
||||
# Includes
|
||||
set(CMI_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/includes) # For conveniance
|
||||
set(CMI_INCLUDE_DIR ${CMI_INCLUDE_DIR} PARENT_SCOPE) # To be used by other projects with add_subdirectory()
|
||||
file(MAKE_DIRECTORY ${CMI_INCLUDE_DIR})
|
||||
|
||||
# Copy all includes
|
||||
file(GLOB_RECURSE HEADER_FILES src/*.hpp)
|
||||
foreach(FILE ${HEADER_FILES})
|
||||
file(RELATIVE_PATH FILE_SUBDIR ${CMAKE_CURRENT_SOURCE_DIR}/src ${FILE})
|
||||
configure_file(${FILE} ${CMI_INCLUDE_DIR}/${FILE_SUBDIR} COPYONLY)
|
||||
endforeach(FILE ${HEADER_FILES})
|
||||
|
||||
# Add target if not exists
|
||||
# This way ChessMoveInterface can be used in multiple submodules
|
||||
include_directories(src)
|
||||
file(GLOB_RECURSE SRC_CPP_FILES src/*.cpp)
|
||||
if(NOT TARGET ChessMoveInterface)
|
||||
add_library(ChessMoveInterface SHARED ${SRC_CPP_FILES})
|
||||
endif()
|
Loading…
Add table
Add a link
Reference in a new issue