File tree 8 files changed +23
-16
lines changed
8 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ option(BENONI_TESTS "Build the Benoni tests" OFF)
9
9
option (BENONI_EXAMPLES "Build the Benoni examples" OFF )
10
10
option (BENONI_INSTALL "Install Benoni" ON )
11
11
12
+ string (TOLOWER ${CMAKE_SYSTEM_NAME} LOWER_SYSTEM_NAME)
13
+ set (BENONI_TARGET ${PROJECT_NAME} _${LOWER_SYSTEM_NAME} )
14
+
12
15
if (APPLE )
13
16
add_subdirectory (src/apple )
14
17
elseif (WIN32 )
@@ -18,12 +21,12 @@ elseif(UNIX)
18
21
add_subdirectory (src/linux)
19
22
endif ()
20
23
21
- set_target_properties (benoni PROPERTIES PUBLIC_HEADER ${PROJECT_SOURCE_DIR} /include /benoni/http.h)
24
+ set_target_properties (${BENONI_TARGET} PROPERTIES PUBLIC_HEADER ${PROJECT_SOURCE_DIR} /include /benoni/http.h)
22
25
23
26
if (BENONI_INSTALL)
24
27
include (GNUInstallDirs)
25
28
26
- install (TARGETS benoni
29
+ install (TARGETS ${BENONI_TARGET}
27
30
EXPORT benoni
28
31
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} /${PROJECT_NAME} "
29
32
COMPONENT benoni
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ example: .always
22
22
$(EXAMPLE )
23
23
24
24
test : .always
25
- $(CTEST ) -C Debug --test-dir build --parallel
25
+ $(CTEST ) -C Debug --test-dir build --parallel --output-on-failure
26
26
27
27
# For NMake, which doesn't support .PHONY
28
28
.always :
Original file line number Diff line number Diff line change 1
1
add_executable (http_example http_example.cc)
2
2
3
- target_link_libraries (http_example PRIVATE benoni )
3
+ target_link_libraries (http_example PRIVATE ${BENONI_TARGET} )
Original file line number Diff line number Diff line change 1
- add_library (benoni STATIC http.mm)
1
+ add_library (${BENONI_TARGET} STATIC http.mm)
2
2
3
- target_compile_options (benoni PUBLIC "-fobjc-arc" )
3
+ target_compile_options (${BENONI_TARGET} PUBLIC "-fobjc-arc" )
4
4
5
- target_include_directories (benoni PUBLIC
5
+ target_include_directories (${BENONI_TARGET} PUBLIC
6
6
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /include >
7
7
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} /include >)
8
8
9
- target_link_libraries (benoni PUBLIC "-framework Foundation" )
9
+ target_link_libraries (${BENONI_TARGET} PUBLIC "-framework Foundation" )
Original file line number Diff line number Diff line change 1
- add_library (benoni STATIC http.cc)
1
+ add_library (${BENONI_TARGET} STATIC http.cc)
2
2
3
- target_include_directories (benoni PUBLIC
3
+ target_include_directories (${BENONI_TARGET} PUBLIC
4
4
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /include >
5
5
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} /include >)
6
6
7
- target_link_libraries (benoni PUBLIC libsoup)
7
+ target_link_libraries (${BENONI_TARGET} PUBLIC libsoup)
Original file line number Diff line number Diff line change 1
- add_library (benoni STATIC http.cc)
1
+ add_library (${BENONI_TARGET} STATIC http.cc)
2
2
3
- target_include_directories (benoni PUBLIC
3
+ target_include_directories (${BENONI_TARGET} PUBLIC
4
4
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /include >
5
5
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} /include >)
6
6
7
- target_link_libraries (benoni PUBLIC "Winhttp.lib" )
7
+ target_link_libraries (${BENONI_TARGET} PUBLIC "Winhttp.lib" )
Original file line number Diff line number Diff line change @@ -8,4 +8,8 @@ add_subdirectory(
8
8
"${CMAKE_CURRENT_BINARY_DIR} /benoni_build" )
9
9
10
10
add_executable (project project.cc)
11
- target_link_libraries (project PRIVATE benoni)
11
+
12
+ string (TOLOWER ${CMAKE_SYSTEM_NAME} LOWER_SYSTEM_NAME)
13
+ set (BENONI_TARGET benoni_${LOWER_SYSTEM_NAME} )
14
+
15
+ target_link_libraries (project PRIVATE ${BENONI_TARGET} )
Original file line number Diff line number Diff line change 1
1
add_executable (postman_echo_get postman-echo-get .cc)
2
2
3
- target_link_libraries (postman_echo_get PRIVATE benoni )
3
+ target_link_libraries (postman_echo_get PRIVATE ${BENONI_TARGET} )
4
4
5
5
add_test (NAME postman_echo_get COMMAND $<TARGET_FILE:postman_echo_get>)
You can’t perform that action at this time.
0 commit comments