From 398bab41b84b39f0f0341b79b40314d932bf03f9 Mon Sep 17 00:00:00 2001 From: Helin Wang Date: Wed, 24 May 2017 19:17:18 -0700 Subject: [PATCH] fix hardcoded cmake for cclient/test --- paddle/go/cclient/CMakeLists.txt | 7 ++----- paddle/go/cclient/test/CMakeLists.txt | 5 +++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/paddle/go/cclient/CMakeLists.txt b/paddle/go/cclient/CMakeLists.txt index 29a2089fb..c85ff3db0 100644 --- a/paddle/go/cclient/CMakeLists.txt +++ b/paddle/go/cclient/CMakeLists.txt @@ -2,12 +2,9 @@ cmake_minimum_required(VERSION 3.0) if(GTEST_INCLUDE_DIR AND GTEST_LIBRARIES) message("-- Found gtest (include: ${GTEST_INCLUDE_DIR}, library: ${GTEST_LIBRARIES})") -else() - # find #include - get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) - include_directories(${PARENT_DIR}) - +else() # find cmake directory modules + get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) get_filename_component(PARENT_DIR ${PARENT_DIR} DIRECTORY) get_filename_component(PARENT_DIR ${PARENT_DIR} DIRECTORY) diff --git a/paddle/go/cclient/test/CMakeLists.txt b/paddle/go/cclient/test/CMakeLists.txt index c899bd275..185e7ec80 100644 --- a/paddle/go/cclient/test/CMakeLists.txt +++ b/paddle/go/cclient/test/CMakeLists.txt @@ -1,8 +1,9 @@ cmake_minimum_required(VERSION 3.0) -include_directories(/env/gopath/src/github.com/PaddlePaddle/Paddle/paddle/go/cclient/build/) +include_directories(${CMAKE_BINARY_DIR}) add_executable(main main.c) add_dependencies(main client) set (CMAKE_EXE_LINKER_FLAGS "-pthread") -target_link_libraries(main /env/gopath/src/github.com/PaddlePaddle/Paddle/paddle/go/cclient/build/libclient.a) # ${GTEST_LIBRARIES}) +message(${CMAKE_BINARY_DIR}) +target_link_libraries(main ${CMAKE_BINARY_DIR}/libclient.a) -- GitLab