2017-10-09 18:48:44 +08:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
|
|
|
project(imgui CXX)
|
|
|
|
|
2017-10-15 13:26:06 +08:00
|
|
|
set(CMAKE_DEBUG_POSTFIX d)
|
|
|
|
|
2020-06-24 04:56:15 +08:00
|
|
|
add_library(${PROJECT_NAME} "")
|
|
|
|
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
|
|
|
target_include_directories(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
|
|
$<INSTALL_INTERFACE:Include>
|
2017-10-09 18:48:44 +08:00
|
|
|
)
|
|
|
|
|
2020-06-24 04:56:15 +08:00
|
|
|
target_sources(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
PRIVATE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui_demo.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui_draw.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui_widgets.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.cpp
|
2017-10-09 18:48:44 +08:00
|
|
|
)
|
|
|
|
|
2020-06-24 04:56:15 +08:00
|
|
|
if(IMGUI_FREETYPE)
|
|
|
|
find_package(Freetype REQUIRED)
|
2017-10-09 18:48:44 +08:00
|
|
|
|
2020-06-24 04:56:15 +08:00
|
|
|
target_include_directories(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
PRIVATE
|
|
|
|
${FREETYPE_INCLUDE_DIRS}
|
|
|
|
)
|
2020-05-01 13:57:38 +08:00
|
|
|
|
2020-06-24 04:56:15 +08:00
|
|
|
target_sources(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
PRIVATE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/misc/freetype/imgui_freetype.cpp
|
|
|
|
)
|
|
|
|
endif()
|
2018-01-04 19:46:21 +08:00
|
|
|
|
2020-06-24 04:56:15 +08:00
|
|
|
install(
|
|
|
|
TARGETS ${PROJECT_NAME}
|
|
|
|
EXPORT ${PROJECT_NAME}_target
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
RUNTIME DESTINATION bin
|
2017-10-09 18:48:44 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
if(NOT IMGUI_SKIP_HEADERS)
|
2020-06-24 04:56:15 +08:00
|
|
|
install(FILES
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui_internal.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/imstb_textedit.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.h
|
2017-10-09 18:48:44 +08:00
|
|
|
DESTINATION include
|
|
|
|
)
|
2020-06-24 04:56:15 +08:00
|
|
|
|
|
|
|
if(IMGUI_COPY_BINDINGS)
|
|
|
|
file(GLOB IMGUI_BINDINGS ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_* )
|
|
|
|
install(
|
|
|
|
FILES ${IMGUI_BINDINGS}
|
|
|
|
DESTINATION include/bindings
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(IMGUI_FREETYPE)
|
|
|
|
install(FILES
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/misc/freetype/imgui_freetype.h
|
|
|
|
DESTINATION include
|
|
|
|
)
|
|
|
|
endif()
|
2017-10-09 18:48:44 +08:00
|
|
|
endif()
|
2020-05-01 13:57:38 +08:00
|
|
|
|
2020-06-24 04:56:15 +08:00
|
|
|
install(
|
|
|
|
EXPORT ${PROJECT_NAME}_target
|
|
|
|
NAMESPACE ${PROJECT_NAME}::
|
|
|
|
FILE ${PROJECT_NAME}-config.cmake
|
|
|
|
DESTINATION share/${PROJECT_NAME}
|
|
|
|
)
|