2022-02-23 16:22:11 +01:00
|
|
|
cmake_minimum_required(VERSION 3.18)
|
2022-02-12 19:13:34 +01:00
|
|
|
project(cgeditor)
|
|
|
|
|
|
|
|
# Includes
|
|
|
|
set(CGEDITOR_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/includes) # For conveniance
|
|
|
|
set(CGEDITOR_INCLUDE_DIR ${CGEDITOR_INCLUDE_DIR} PARENT_SCOPE) # To be used by other projects with add_subdirectory()
|
|
|
|
file(MAKE_DIRECTORY ${CGEDITOR_INCLUDE_DIR})
|
|
|
|
# Copy all includes
|
|
|
|
file(GLOB_RECURSE HEADER_FILES src/*.hpp)
|
|
|
|
file(MAKE_DIRECTORY ${CGEDITOR_INCLUDE_DIR}/components)
|
|
|
|
foreach(FILE ${HEADER_FILES})
|
|
|
|
file(RELATIVE_PATH FILE_SUBDIR ${CMAKE_CURRENT_SOURCE_DIR}/src ${FILE})
|
|
|
|
configure_file(${FILE} ${CGEDITOR_INCLUDE_DIR}/${FILE_SUBDIR} COPYONLY)
|
|
|
|
endforeach(FILE ${HEADER_FILES})
|
|
|
|
|
|
|
|
# Compile cgeditor
|
|
|
|
file(GLOB_RECURSE SRC_CPP_FILES src/*.cpp)
|
2023-05-02 19:15:04 +02:00
|
|
|
add_library(cgeditor STATIC ${SRC_CPP_FILES})
|
2023-05-02 19:52:56 +02:00
|
|
|
target_include_directories(cgeditor PUBLIC ${CGEDITOR_INCLUDE_DIR})
|
2022-02-12 19:13:34 +01:00
|
|
|
|
2023-01-19 13:06:36 +01:00
|
|
|
# ChessMoveInterface
|
|
|
|
add_subdirectory(libs/chess-move-interface)
|
2023-05-02 19:15:04 +02:00
|
|
|
target_link_libraries(cgeditor PRIVATE ChessMoveInterface)
|
2023-01-19 13:06:36 +01:00
|
|
|
|
2022-02-12 19:13:34 +01:00
|
|
|
# Examples
|
|
|
|
set(COMPILE_EXAMPLES FALSE CACHE BOOL "Compiling included examples")
|
|
|
|
if(COMPILE_EXAMPLES)
|
|
|
|
add_subdirectory("examples/wxWidgets/")
|
2022-02-23 16:22:11 +01:00
|
|
|
endif()
|