Add an option allowing to switch off CMake install.

master
Chunting Gu 7 years ago
parent e3e9a22181
commit c424e2b690

@ -11,6 +11,7 @@ project(webcc)
option(WEBCC_ENABLE_LOG "Enable logging?" ON) option(WEBCC_ENABLE_LOG "Enable logging?" ON)
option(WEBCC_ENABLE_SOAP "Enable SOAP support (need pugixml)?" ON) option(WEBCC_ENABLE_SOAP "Enable SOAP support (need pugixml)?" ON)
option(WEBCC_ENABLE_SSL "Enable SSL/HTTPS support (need OpenSSL)?" OFF) option(WEBCC_ENABLE_SSL "Enable SSL/HTTPS support (need OpenSSL)?" OFF)
option(WEBCC_ENABLE_INSTALL "Enable to install library and headers with CMake?" OFF)
option(WEBCC_BUILD_UNITTEST "Build unit test?" ON) option(WEBCC_BUILD_UNITTEST "Build unit test?" ON)
option(WEBCC_BUILD_EXAMPLE "Build examples?" ON) option(WEBCC_BUILD_EXAMPLE "Build examples?" ON)

@ -102,9 +102,10 @@ set(TARGET webcc)
add_library(${TARGET} STATIC ${HEADERS} ${SOURCES}) add_library(${TARGET} STATIC ${HEADERS} ${SOURCES})
# Install lib and header files. if(WEBCC_ENABLE_INSTALL)
# On Linux, if CMAKE_INSTALL_PREFIX is ~, the lib (libwebcc.a) will be installed # Install lib and header files.
# to ~/lib and header files will be installed to ~/include. # On Linux, if CMAKE_INSTALL_PREFIX is ~, the lib (libwebcc.a) will be installed
# to ~/lib and header files will be installed to ~/include.
install(TARGETS ${TARGET} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(TARGETS ${TARGET} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/webcc) install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/webcc)
endif()

Loading…
Cancel
Save