Added option to compile to static library
the build was successful
Details
the build was successful
Details
This commit is contained in:
parent
63fd9f581c
commit
fb0a7c0f7f
|
@ -61,8 +61,8 @@ else()
|
|||
endif()
|
||||
add_library(mastodon-cpp SHARED ${sources})
|
||||
set_target_properties(mastodon-cpp PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${mastodon-cpp_VERSION_MAJOR}
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${mastodon-cpp_VERSION_MAJOR}
|
||||
)
|
||||
|
||||
if(WITHOUT_EASY)
|
||||
|
@ -71,6 +71,12 @@ else()
|
|||
target_link_libraries(mastodon-cpp ${CURLPP_LIBRARIES} ${JSONCPP_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WITH_STATIC)
|
||||
add_library(mastodon-cpp_static STATIC ${sources})
|
||||
set_target_properties(mastodon-cpp_static PROPERTIES
|
||||
OUTPUT_NAME mastodon-cpp)
|
||||
endif()
|
||||
|
||||
# Compile examples
|
||||
if(WITH_EXAMPLES)
|
||||
file(GLOB sources_examples examples/*.cpp)
|
||||
|
@ -95,6 +101,10 @@ endif()
|
|||
|
||||
# Install library and header files
|
||||
install(TARGETS mastodon-cpp LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
if(WITH_STATIC)
|
||||
install(TARGETS mastodon-cpp_static LIBRARY
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
install(FILES src/mastodon-cpp.hpp
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mastodon-cpp)
|
||||
if(NOT WITHOUT_EASY)
|
||||
|
|
|
@ -10,7 +10,7 @@ SRC_URI="https://schlomp.space/tastytea/mastodon-cpp/archive/${PV}.tar.gz -> ${P
|
|||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE="doc debug examples"
|
||||
IUSE="doc debug examples static-libs"
|
||||
RDEPEND=">=dev-cpp/curlpp-0.8.1
|
||||
>=dev-libs/jsoncpp-1.8.4"
|
||||
DEPEND=">=dev-util/cmake-3.9.6
|
||||
|
@ -34,6 +34,9 @@ src_configure() {
|
|||
else
|
||||
mycmakeargs+=(-DCMAKE_BUILD_TYPE=Release)
|
||||
fi
|
||||
if use static-libs; then
|
||||
mycmakeargs+=(-DWITH_STATIC=YES)
|
||||
fi
|
||||
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ EGIT_REPO_URI="https://schlomp.space/tastytea/mastodon-cpp.git"
|
|||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS=""
|
||||
IUSE="doc debug examples"
|
||||
IUSE="doc debug examples static-libs"
|
||||
RDEPEND=">=dev-cpp/curlpp-0.8.1
|
||||
>=dev-libs/jsoncpp-1.8.1"
|
||||
DEPEND=">=dev-util/cmake-3.9.6
|
||||
|
@ -33,6 +33,10 @@ src_configure() {
|
|||
mycmakeargs+=(-DCMAKE_BUILD_TYPE=Release)
|
||||
fi
|
||||
|
||||
if use static-libs; then
|
||||
mycmakeargs+=(-DWITH_STATIC=YES)
|
||||
fi
|
||||
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue