Skip to content

Commit

Permalink
rename library from liboptional.a to libbeman_optional26.a
Browse files Browse the repository at this point in the history
  • Loading branch information
neatudarius committed Jun 12, 2024
1 parent b1a7a70 commit d0c2d42
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Compiling the paper requires a working LaTeX installation. See instructions for

#### Basic Build

This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will work, producing a static `example` library, ready to package:
This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will work, producing a static `beman_optional26` library, ready to package:

```shell
cmake --workflow --preset gcc-14
Expand Down
14 changes: 8 additions & 6 deletions src/beman/optional/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
add_library(optional STATIC "")
SET(TARGET_LIBRARY "beman_optional26")

add_library("${TARGET_LIBRARY}" STATIC "")

target_sources(
optional
"${TARGET_LIBRARY}"
PRIVATE
optional.cpp
)

include(GNUInstallDirs)

target_include_directories(optional PUBLIC
target_include_directories("${TARGET_LIBRARY}" PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME}> # <prefix>/include/scratch
)

install(
TARGETS optional
TARGETS "${TARGET_LIBRARY}"
EXPORT ${TARGETS_EXPORT_NAME}1
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
Expand All @@ -27,7 +29,7 @@ install(
FILES_MATCHING PATTERN "*.h"
)

target_link_libraries(optional)
target_link_libraries("${TARGET_LIBRARY}")

## Tests
add_executable(optional_test "")
Expand All @@ -41,7 +43,7 @@ target_sources(
optional_ref_monadic.t.cpp
)

target_link_libraries(optional_test optional)
target_link_libraries(optional_test "${TARGET_LIBRARY}")
target_link_libraries(optional_test gtest)
target_link_libraries(optional_test gtest_main)

Expand Down
13 changes: 8 additions & 5 deletions src/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SET(BEMAN_OPTIONAL26_LIBRARY "beman_optional26")

include(GNUInstallDirs)

Expand All @@ -6,21 +7,23 @@ add_executable(main "")
target_sources(
main
PRIVATE
main.cpp)
main.cpp
)

target_link_libraries(main optional)
target_link_libraries(main "${BEMAN_OPTIONAL26_LIBRARY}")

add_executable(before_after "")

target_sources(
before_after
PRIVATE
before_after.cpp)
before_after.cpp
)

target_link_libraries(before_after optional)
target_link_libraries(before_after "${BEMAN_OPTIONAL26_LIBRARY}")

install(
TARGETS main
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
)

0 comments on commit d0c2d42

Please sign in to comment.