<div dir="ltr"><div><div><div><div>Hi,<br><br></div>I am new to Cmake and at present exploring its features for migrating our projects build system to use it.<br><br></div>I have main source folder inside that another folder contains the source for our custom library.<br>
<br></div><div>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?<br><br></div>
<div>Thanks,<br></div><div>  Lloyd<br></div><div><br></div>As a sample I am including my Cmake code<br><br>#Cmake file of library source code<br></div>#Path-&gt; Myproject/src/lib/reverse<br><br><div>cmake_minimum_required (VERSION 2.6)<br>
<br>if(WIN32)<br>SET (REV_SRC reverse.cpp reverse.h)<br>else(WIN32)<br>SET (REV_SRC reverse.cpp)<br>endif(WIN32)<br><br>ADD_DEFINITIONS(-DREVERSE_EXPORTS)<br><br>ADD_LIBRARY(Reverse SHARED ${REV_SRC})<br><br><br><br></div>
<div>This is my CMake file inside the Src folder<br></div><div><br>#Cmake file of main source code<br>#Path-&gt; Myproject/src/<br>cmake_minimum_required (VERSION 2.6)<br><br>FIND_PACKAGE(Qt4 REQUIRED)<br>INCLUDE(${QT_USE_FILE})<br>
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib/reverse)<br><br>ADD_SUBDIRECTORY(lib/reverse)<br><br>ADD_EXECUTABLE(Tutorial main.cpp)<br><br>TARGET_LINK_LIBRARIES(Tutorial ${QT_LIBRARIES})<br>#############################################################<br>
</div><div>#I understand that the problem is here, because it cant locate my library.<br></div><div>TARGET_LINK_LIBRARIES(Tutorial reverse)<br>#############################################################<br><br></div><div>
<br></div></div>