[CMake] TARGET_LINK_LIBRARIES got a link error
Lloyd
lloydkl.tech at gmail.com
Fri Apr 12 02:17:50 EDT 2013
Hi,
I am new to Cmake and at present exploring its features for migrating our
projects build system to use it.
I have main source folder inside that another folder contains the source
for our custom library.
I understand that the problem is with my cmake file. Through that the
generated project cannot locate the location of my library build location.
What is the right way to solve this kind of problem?
Thanks,
Lloyd
As a sample I am including my Cmake code
#Cmake file of library source code
#Path-> Myproject/src/lib/reverse
cmake_minimum_required (VERSION 2.6)
if(WIN32)
SET (REV_SRC reverse.cpp reverse.h)
else(WIN32)
SET (REV_SRC reverse.cpp)
endif(WIN32)
ADD_DEFINITIONS(-DREVERSE_EXPORTS)
ADD_LIBRARY(Reverse SHARED ${REV_SRC})
This is my CMake file inside the Src folder
#Cmake file of main source code
#Path-> Myproject/src/
cmake_minimum_required (VERSION 2.6)
FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib/reverse)
ADD_SUBDIRECTORY(lib/reverse)
ADD_EXECUTABLE(Tutorial main.cpp)
TARGET_LINK_LIBRARIES(Tutorial ${QT_LIBRARIES})
#############################################################
#I understand that the problem is here, because it cant locate my library.
TARGET_LINK_LIBRARIES(Tutorial reverse)
#############################################################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130412/39af88b0/attachment.htm>
More information about the CMake
mailing list