indentlog: + hello example + cmake install attempt
This commit is contained in:
parent
6f74ce1cf4
commit
468c525470
6 changed files with 25 additions and 14 deletions
|
|
@ -4,13 +4,23 @@ project(nestlog VERSION 0.1)
|
|||
enable_language(CXX)
|
||||
enable_testing()
|
||||
|
||||
include(cmake/nestlog.cmake)
|
||||
|
||||
add_subdirectory(include)
|
||||
add_subdirectory(example)
|
||||
|
||||
# this doesn't work in include/CMakeLists.txt
|
||||
install(TARGETS indentlog DESTINATION include)
|
||||
# always write compile_commands.json
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX /home/roland/local)
|
||||
set(CMAKE_INSTALL_RPATH /home/roland/local/lib)
|
||||
|
||||
include(cmake/nestlog.cmake)
|
||||
add_subdirectory(example)
|
||||
|
||||
# header-only library
|
||||
#add_library(indentlog INTERFACE)
|
||||
#target_include_directories(indentlog INTERFACE
|
||||
# $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
# $<INSTALL_INTERFACE:include>
|
||||
# )
|
||||
#
|
||||
#install(TARGETS indentlog
|
||||
# PUBLIC_HEADER DESTINATION include) # COMPONENT Development
|
||||
|
||||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ macro(xo_include_options target)
|
|||
# (2) clangd (run from emacs lsp-mode) can find them
|
||||
#
|
||||
if(CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES
|
||||
${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
|
||||
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
|
||||
endif()
|
||||
endmacro()
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
|
|||
|
||||
#include(cmake/FindSphinx.cmake)
|
||||
|
||||
add_subdirectory(hello)
|
||||
add_subdirectory(ex1)
|
||||
add_subdirectory(ex2)
|
||||
add_subdirectory(ex3)
|
||||
|
|
|
|||
2
example/hello/CMakeLists.txt
Normal file
2
example/hello/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
add_executable(hello hello.cpp)
|
||||
xo_include_options(hello)
|
||||
5
example/hello/hello.cpp
Normal file
5
example/hello/hello.cpp
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include <iostream>
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
std::cout << "Hello, world!" << std::endl;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# header-only library
|
||||
add_library(indentlog INTERFACE)
|
||||
target_include_directories(indentlog INTERFACE
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue