Commit c8d91ad0 authored by Aitor Henry's avatar Aitor Henry Committed by Sebastien Petitdemange

Should be final CMake.

parent d9f093c1
......@@ -21,36 +21,33 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
set(NAME "v4l2")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--add-needed")
#SOURCEs
set(v4l2_srcs src/V4L2Camera.cpp src/V4L2Interface.cpp
set(${NAME}_srcs src/V4L2Camera.cpp src/V4L2Interface.cpp
src/V4L2DetInfoCtrlObj.cpp src/V4L2SyncCtrlObj.cpp
src/V4L2VideoCtrlObj.cpp)
file(STRINGS "VERSION" v4l2_vers)
add_library(limav4l2 SHARED ${v4l2_srcs})
add_library(lima${NAME} SHARED ${${NAME}_srcs})
#INCLUDEs
target_include_directories(limav4l2 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(lima${NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
#LIBRARIES
find_library(V4L2_LIB v4l2)
if("${V4L2_LIB}" STREQUAL "V4L2_LIB-NOTFOUND")
message(FATAL_ERROR "v4l2 : libv4l2 not found, you can search it in cmake-gui or try to install it if it isn't here.")
message(FATAL_ERROR "${NAME} : libv4l2 not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
target_link_libraries(limav4l2 limacore)
target_link_libraries(limav4l2 ${V4L2_LIB})
target_link_libraries(lima${NAME} limacore)
target_link_libraries(lima${NAME} ${V4L2_LIB})
include(CameraVERSION)
install(TARGETS lima${NAME} LIBRARY DESTINATION lib)
set_target_properties(limav4l2 PROPERTIES VERSION ${v4l2_vers} SOVERSION "1")
install(TARGETS limav4l2 LIBRARY DESTINATION lib)
if(COMPILE_SIP)
set(NAME "v4l2")
if(LIMA_ENABLE_PYTHON)
include(CameraRunSIP)
install(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/V4l2")
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment