diff --git a/.gitignore b/.gitignore index 7ebf47c..d809ed0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +# emacs projectile config +.projectile # symlink to ${my_build_directory}/compile_commands.json to make LSP work compile_commands.json # lsp keeps state here diff --git a/CMakeLists.txt b/CMakeLists.txt index 46f3bdb..2a7ff77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,19 +7,15 @@ project(indentlog VERSION 1.0) include(GNUInstallDirs) include(cmake/xo-bootstrap-macros.cmake) -xo_cxx_toplevel_options2() +xo_cxx_toplevel_options3() # ---------------------------------------------------------------- -# cmake -DCMAKE_BUILD_TYPE=debug -xo_toplevel_debug_config2() +# c++ settings -# ---------------------------------------------------------------- -# cmake -DCMAKE_BUILD_TYPE=asan -xo_toplevel_asan_config2() - -# ---------------------------------------------------------------- -# cmake -DCMAKE_BUILD_TYPE=coverage -xo_toplevel_coverage_config2() +# one-time project-specific c++ flags. usually empty +#set(PROJECT_CXX_FLAGS "-Wstringop-overread") +#set(PROJECT_CXX_FLAGS "-fconcepts-diagnostics-depth=2") +add_definitions(${PROJECT_CXX_FLAGS}) # ---------------------------------------------------------------- @@ -35,9 +31,18 @@ xo_install_library4(${SELF_LIB} ${PROJECT_NAME}Targets) xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets) # ---------------------------------------------------------------- +# docs targets depend on all the other library/utest targets +# +#add_subdirectory(docs) -install(TARGETS hello DESTINATION bin/indentlog/example) -install(TARGETS indentlog_ex1 DESTINATION bin/indentlog/example) -install(TARGETS indentlog_ex2 DESTINATION bin/indentlog/example) -install(TARGETS indentlog_ex3 DESTINATION bin/indentlog/example) -install(TARGETS indentlog_ex4 DESTINATION bin/indentlog/example) +# ---------------------------------------------------------------- + +if (XO_ENABLE_EXAMPLES) + install(TARGETS hello DESTINATION bin/indentlog/example) + install(TARGETS indentlog_ex1 DESTINATION bin/indentlog/example) + install(TARGETS indentlog_ex2 DESTINATION bin/indentlog/example) + install(TARGETS indentlog_ex3 DESTINATION bin/indentlog/example) + install(TARGETS indentlog_ex4 DESTINATION bin/indentlog/example) +endif() + +# end CMakeLists.txt diff --git a/example/ex1/CMakeLists.txt b/example/ex1/CMakeLists.txt index f42c56d..69f49e1 100644 --- a/example/ex1/CMakeLists.txt +++ b/example/ex1/CMakeLists.txt @@ -1,2 +1,4 @@ -add_executable(indentlog_ex1 ex1.cpp) -xo_include_options2(indentlog_ex1) +if (XO_ENABLE_EXAMPLES) + add_executable(indentlog_ex1 ex1.cpp) + xo_include_options2(indentlog_ex1) +endif() diff --git a/example/ex2/CMakeLists.txt b/example/ex2/CMakeLists.txt index 2dc3919..4b7f82d 100644 --- a/example/ex2/CMakeLists.txt +++ b/example/ex2/CMakeLists.txt @@ -1,4 +1,6 @@ # NOTE: need target names to be globally unique within the xo umbrella -add_executable(indentlog_ex2 ex2.cpp) -xo_include_options2(indentlog_ex2) +if (XO_ENABLE_EXAMPLES) + add_executable(indentlog_ex2 ex2.cpp) + xo_include_options2(indentlog_ex2) +endif() diff --git a/example/ex3/CMakeLists.txt b/example/ex3/CMakeLists.txt index bb5110c..a15b03b 100644 --- a/example/ex3/CMakeLists.txt +++ b/example/ex3/CMakeLists.txt @@ -1,2 +1,4 @@ -add_executable(indentlog_ex3 ex3.cpp) -xo_include_options2(indentlog_ex3) +if (XO_ENABLE_EXAMPLES) + add_executable(indentlog_ex3 ex3.cpp) + xo_include_options2(indentlog_ex3) +endif() diff --git a/example/ex4/CMakeLists.txt b/example/ex4/CMakeLists.txt index 6ff720f..9daba55 100644 --- a/example/ex4/CMakeLists.txt +++ b/example/ex4/CMakeLists.txt @@ -1,2 +1,4 @@ -add_executable(indentlog_ex4 ex4.cpp) -xo_include_options2(indentlog_ex4) +if (XO_ENABLE_EXAMPLES) + add_executable(indentlog_ex4 ex4.cpp) + xo_include_options2(indentlog_ex4) +endif() diff --git a/example/hello/CMakeLists.txt b/example/hello/CMakeLists.txt index 1ff2300..14806f7 100644 --- a/example/hello/CMakeLists.txt +++ b/example/hello/CMakeLists.txt @@ -1,2 +1,4 @@ -add_executable(hello hello.cpp) -xo_include_options2(hello) +if (XO_ENABLE_EXAMPLES) + add_executable(hello hello.cpp) + xo_include_options2(hello) +endif()