From 23eec44111cecaa83754eedf69c5116eb4e49e6d Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Mon, 31 Jul 2017 16:32:06 +0200 Subject: [PATCH] Pass the library path only if APPLE --- CMakeLists.txt | 4 +++- cmd.sh.in | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6c8911..e79420b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,9 @@ include (${CMAKE_ROOT}/Modules/ExternalProject.cmake) include_directories (${CMAKE_BINARY_DIR}/include) link_directories (${CMAKE_BINARY_DIR}/lib) -set (CMAKE_LDFLAGS "-framework AudioToolBox -framework CoreAudio -framework CoreFoundation -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -framework Carbon") +if (APPLE) + set (CMAKE_LDFLAGS "-L${CMAKE_BINARY_DIR}/lib -framework AudioToolBox -framework CoreAudio -framework CoreFoundation -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -framework Carbon") +endif () configure_file (cmd.sh.in cmd.sh @ONLY) set (CMD ${CMAKE_BINARY_DIR}/cmd.sh) diff --git a/cmd.sh.in b/cmd.sh.in index 269cc26..e0b620b 100755 --- a/cmd.sh.in +++ b/cmd.sh.in @@ -4,7 +4,7 @@ export PKG_CONFIG_PATH="@CMAKE_BINARY_DIR@/lib/pkgconfig" export INCLUDE_PATH="@CMAKE_BINARY_DIR@/include" export LIBRARY_PATH="@CMAKE_BINARY_DIR@/lib" export BINARY_PATH="@CMAKE_BINARY_DIR@/bin" -export LDFLAGS="@CMAKE_LDFLAGS@ -L$LIBRARY_PATH" +export LDFLAGS="@CMAKE_LDFLAGS@" cmd=$1 shift