Skip to content

Commit

Permalink
feat(cmake): Change public header directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Yimura committed Jan 18, 2023
1 parent 74d8d2a commit e57300d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.20)
project(AsyncLogger LANGUAGES CXX VERSION 0.0.1 DESCRIPTION "A lightweight C++20 asyncronous logger.")

set(SRC_DIR "${PROJECT_SOURCE_DIR}/src")
set(PUBLIC_HEADER_DIR "${PROJECT_SOURCE_DIR}/include")

# check std::format support
if(NOT USE_FMT)
Expand All @@ -15,6 +16,7 @@ endif()
file(GLOB_RECURSE SRC_FILES
"${SRC_DIR}/**.cpp"
"${SRC_DIR}/**.hpp"
"${PUBLIC_HEADER_DIR}/**.hpp"
)

add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
Expand All @@ -40,8 +42,8 @@ endif()
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} Threads::Threads )

set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${SRC_DIR}/Logger.hpp")
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADER_DIR}")
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)

target_precompile_headers(${PROJECT_NAME} PUBLIC "${SRC_DIR}/common.hpp")
target_include_directories(${PROJECT_NAME} PUBLIC ${SRC_DIR})
target_include_directories(${PROJECT_NAME} PUBLIC ${SRC_DIR} "${PUBLIC_HEADER_DIR}/AsyncLogger/")
File renamed without changes.

0 comments on commit e57300d

Please sign in to comment.