-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I have a library client
in folder ./client
, and have an executable I want to build in folder ./client/test
. But when doing make
, it reports can not find header file (the header file is generated when doing go build
).
./CMakeLists.txt:
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
cmake_minimum_required(VERSION 3.0)
project(cxx_go C Go)
include(cmake/golang.cmake)
include(cmake/flags.cmake)
add_subdirectory(client)
add_subdirectory(client/test)
./client/CMakeLists.txt:
ExternalGoProject_Add(pserver github.com/PaddlePaddle/Paddle/paddle/go/pserver)
add_go_library(client STATIC pserver)
./client/test/CMakeList.txt:
#include_directories(/home/helin/env/gopath/src/github.com/PaddlePaddle/Paddle/paddle/go/pserver/lib/build/client)
add_executable(main main.c)
add_dependencies(main client)
set (CMAKE_EXE_LINKER_FLAGS "-pthread")
#target_link_libraries(main /home/helin/env/gopath/src/github.com/PaddlePaddle/Paddle/paddle/go/pserver/lib/build/client/libclient.a)
target_link_libraries(main)
If I un-comment the two lines in above file, it could work. But how can I not hard code absolute path into the cmake file?
Metadata
Metadata
Assignees
Labels
No labels