Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
de3dba7c
Commit
de3dba7c
authored
3 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
cmake/c: respect OPENDHT_STATIC/SHARED flags
parent
cd9eda65
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+16
-9
16 additions, 9 deletions
CMakeLists.txt
tools/CMakeLists.txt
+6
-3
6 additions, 3 deletions
tools/CMakeLists.txt
with
22 additions
and
12 deletions
CMakeLists.txt
+
16
−
9
View file @
de3dba7c
...
...
@@ -403,15 +403,23 @@ if (OPENDHT_SHARED)
endif
()
if
(
OPENDHT_C
)
add_library
(
opendht-c SHARED
c/opendht.cpp
c/opendht_c.h
)
target_compile_definitions
(
opendht-c PRIVATE OPENDHT_C_BUILD
)
if
(
OPENDHT_SHARED
)
target_link_libraries
(
opendht-c opendht
)
else
()
target_link_libraries
(
opendht-c opendht-static
)
add_library
(
opendht-c SHARED
c/opendht.cpp
c/opendht_c.h
)
target_compile_definitions
(
opendht-c PRIVATE OPENDHT_C_BUILD
)
target_link_libraries
(
opendht-c PRIVATE opendht
)
install
(
TARGETS opendht-c DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
EXPORT opendht-c
)
endif
()
if
(
OPENDHT_STATIC
)
add_library
(
opendht-c-static STATIC
c/opendht.cpp
c/opendht_c.h
)
target_link_libraries
(
opendht-c-static PRIVATE opendht-static
)
install
(
TARGETS opendht-c-static DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
EXPORT opendht-c-static
)
endif
()
# PkgConfig module
...
...
@@ -420,7 +428,6 @@ if (OPENDHT_C)
opendht-c.pc
@ONLY
)
install
(
TARGETS opendht-c DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
EXPORT opendht-c
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/opendht-c.pc DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig
)
install
(
FILES c/opendht_c.h DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/include/opendht
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
tools/CMakeLists.txt
+
6
−
3
View file @
de3dba7c
if
(
OPENDHT_SHARED
)
set
(
OPENDHT_LIBS opendht
)
set
(
OPENDHT_C_LIBS opendht-c
)
else
()
set
(
OPENDHT_LIBS opendht-static
)
set
(
OPENDHT_C_LIBS opendht-c-static
)
if
(
MSVC
)
set
(
MSC_COMPAT_SOURCES
${
MSC_COMPAT_DIR
}
/wingetopt.c
)
endif
()
...
...
@@ -9,8 +11,8 @@ endif ()
function
(
configure_tool name extra_files
)
add_executable
(
${
name
}
${
name
}
.cpp
${
extra_files
}
)
target_link_librar
ies
(
${
name
}
LINK_PUBLIC
${
READLINE_LIBRARIE
S
}
)
target_link_libraries
(
${
name
}
LINK_PUBLIC
${
OPENDHT_LIBS
}
)
add_dependenc
ies
(
${
name
}
${
OPENDHT_LIB
S
}
)
target_link_libraries
(
${
name
}
LINK_PUBLIC
${
OPENDHT_LIBS
}
${
READLINE_LIBRARIES
}
)
if
(
MSVC
)
target_sources
(
${
name
}
PRIVATE
${
MSC_COMPAT_SOURCES
}
)
target_include_directories
(
${
name
}
PRIVATE
${
MSC_COMPAT_DIR
}
)
...
...
@@ -29,7 +31,8 @@ endif ()
if
(
OPENDHT_C
)
add_executable
(
dhtcnode dhtcnode.c
)
target_link_libraries
(
dhtcnode LINK_PUBLIC opendht-c
${
READLINE_LIBRARIES
}
)
add_dependencies
(
dhtcnode
${
OPENDHT_C_LIBS
}
)
target_link_libraries
(
dhtcnode LINK_PUBLIC
${
OPENDHT_C_LIBS
}
${
READLINE_LIBRARIES
}
)
target_include_directories
(
dhtcnode SYSTEM PRIVATE
${
PROJECT_SOURCE_DIR
}
/c
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment