Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ set(CMAKE_CXX_STANDARD 17)
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)

project (shared)

if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set (LIBSHARED_IS_TOP_LEVEL ON)
endif ()

include (CXXSniffer)

include (CheckFunctionExists)
Expand Down
8 changes: 5 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ set (shared_SRCS Args.cpp

add_library (shared STATIC ${shared_SRCS})

set (CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
install (TARGETS shared DESTINATION lib)
install (FILES ${shared_HEADERS} DESTINATION include)
if (LIBSHARED_IS_TOP_LEVEL)
set (CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
install (TARGETS shared DESTINATION lib)
install (FILES ${shared_HEADERS} DESTINATION include)
endif ()

add_executable (lex_executable lex.cpp)
target_link_libraries (lex_executable shared)
Expand Down
Loading