From 58feb19b4994023502a75f63b562a908b45bcfec Mon Sep 17 00:00:00 2001 From: Drew Fisher Date: Sun, 30 Oct 2011 15:42:05 -0700 Subject: [PATCH] Fix build on OSX. Add LDFLAGS for the shared library via CMAKE_SHARED_LINKER_FLAGS. Also actually link against the library we build. Signed-off-by: Drew Fisher --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 28df86d..51853b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ elseif(APPLE) # 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. @@ -41,4 +42,6 @@ if(WIN32) 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() -- 2.39.2