Add LDFLAGS for the shared library via CMAKE_SHARED_LINKER_FLAGS.
Also actually link against the library we build.
Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
# Apple-specific options go here.
message(STATUS "Detected Apple system")
list(APPEND LIBSRC hidapi/mac/hid.c)
+ set(CMAKE_SHARED_LINKER_FLAGS "-framework IOKit -framework CoreFoundation")
set(CMAKE_EXE_LINKER_FLAGS "-framework IOKit -framework CoreFoundation")
else()
# Linux-specific options go here.
target_link_libraries(consoledemo touchmouse setupapi)
elseif(NOT APPLE)
target_link_libraries(consoledemo touchmouse usb-1.0 pthread rt)
+else()
+ target_link_libraries(consoledemo touchmouse)
endif()