CmakeLists.txt

Hello,We use CMake to build our application, on both MacOS and Windows. I add libTurboActivate in various forms to the target_link_libraries list, but none work. The loader always comes back with a variation on the following (depending on whether I specify .a, .dylib, no extension, and whether I use prefix lib or not):

[ 70%] Linking CXX executable vascuCAP.app/Contents/MacOS/vascuCAPld: library not found for -lTurboActivateclang: error: linker command failed with exit code 1 (use -v to see invocation)make[2]: *** [vascuCAP.app/Contents/MacOS/vascuCAP] Error 1make[1]: *** [CMakeFiles/vascuCAP.dir/all] Error 2make: *** [all] Error 2

Well, you also have to specify where to look for TurboActivate using the -L commandline switch. For example, here's the x86 makefile that will be included with TurboActivate 4.0:

CXXFLAGS = -Os -s -ffunction-sections -fdata-sections -DNDEBUG -m32 -L../../i386LDFLAGS = -Wl,--gc-sections -Wl,-rpath='$$ORIGIN'

example: example.o g++ $(CXXFLAGS) $(LDFLAGS) -o ../../i386/example.out example.o -lTurboActivate -lrt

example.o: g++ -c $(CXXFLAGS) $(LDFLAGS) Example.c -o example.o

Thank you Sam. The issue was how to get CMake to do the steps you mentioned. I have now fixed it by adding ${CMAKE_CURRENT_SOURCE_DIR}/libTurboActivate.dylib to target_link_libraries. I had not had the explict use of ${CMAKE_CURRENT_SOURCE_DIR}/ before, hence the issue. Thanks for your help!