Skip to content

Commit

Permalink
Move source code into include/ and src/ directories
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Feb 5, 2025
1 parent 5e8f8fb commit d6d9b39
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ option(IMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS "Disable obsolete ImGui functions"
# If you set IMGUI_SFML_CONFIG_INSTALL_DIR, ImGui-SFML won't install your custom config, because
# you might want to do it yourself
option(IMGUI_SFML_USE_DEFAULT_CONFIG "Use default imconfig-SFML.h" ON)
set(IMGUI_SFML_CONFIG_DIR ${PROJECT_SOURCE_DIR} CACHE PATH "Path to a directory containing user ImGui config")
set(IMGUI_SFML_CONFIG_DIR ${PROJECT_SOURCE_DIR}/include CACHE PATH "Path to a directory containing user ImGui config")
set(IMGUI_SFML_CONFIG_NAME imconfig-SFML.h CACHE STRING "Name of a custom user ImGui config header")
set(IMGUI_SFML_CONFIG_INSTALL_DIR "" CACHE PATH "Path where user's config header will be installed")

Expand Down Expand Up @@ -63,11 +63,11 @@ find_package(OpenGL REQUIRED)
include(GNUInstallDirs)

# Define ImGui-SFML
add_library(ImGui-SFML imgui-SFML.cpp ${IMGUI_SOURCES})
add_library(ImGui-SFML src/imgui-SFML.cpp ${IMGUI_SOURCES})
add_library(ImGui-SFML::ImGui-SFML ALIAS ImGui-SFML)
target_include_directories(ImGui-SFML PUBLIC
$<BUILD_INTERFACE:${IMGUI_INCLUDE_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(ImGui-SFML PUBLIC SFML::Graphics OpenGL::GL)
Expand All @@ -92,7 +92,7 @@ if(IMGUI_SFML_ENABLE_WARNINGS)
endif()
endif()
foreach(WARNING ${IMGUI_SFML_WARNINGS})
set_property(SOURCE imgui-SFML.cpp APPEND_STRING PROPERTY COMPILE_FLAGS " ${WARNING}")
set_property(SOURCE src/imgui-SFML.cpp APPEND_STRING PROPERTY COMPILE_FLAGS " ${WARNING}")
endforeach()

# Specify ImGui user config
Expand All @@ -111,8 +111,8 @@ target_compile_definitions(ImGui-SFML PUBLIC IMGUI_USER_CONFIG="${IMGUI_SFML_CON

# Collect public headers
set(IMGUI_SFML_PUBLIC_HEADERS
${PROJECT_SOURCE_DIR}/imgui-SFML.h
${PROJECT_SOURCE_DIR}/imgui-SFML_export.h
${PROJECT_SOURCE_DIR}/include/imgui-SFML.h
${PROJECT_SOURCE_DIR}/include/imgui-SFML_export.h
${IMGUI_PUBLIC_HEADERS}
)
if(IMGUI_SFML_USE_DEFAULT_CONFIG OR (NOT DEFINED "${IMGUI_SFML_CONFIG_INSTALL_DIR}"))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d6d9b39

Please sign in to comment.