Hi,<br><br>&nbsp; I am attempting to migrate the ANN build to CMake for my own ease of cross platform maintenance.<br><br>&nbsp; The cmake configuration works fine on OSX but have problem Windows because of the additional linkage requirement.
<br><br>&nbsp; I understand that there is no per target DEFINITIONS setup so I&#39;d like to hear advice from experience cmake user how I should configure my build.<br><br>&nbsp; The library needs the -DDLL_EXPORT while the application must not have that set so that it imports the exported symbols.
<br><br>&nbsp; At the moment, my build fails at the ann_test target because it inherits the -DDLL_EXPORT flag from the top.<br><br>Regards<br>
<br>8&lt;------8&lt;------8&lt;------8&lt;------8&lt;------8&lt;------8&lt;------8&lt;------8&lt;------8&lt;------<br>PROJECT (ANN)<br><br>INCLUDE_DIRECTORIES ( ../include )<br><br>IF (WIN32)<br>&nbsp;&nbsp;&nbsp; ADD_DEFINITIONS ( -DDLL_EXPORTS -DANN_PERF -DANN_NO_RANDOM -D_CRT_SECURE_NO_DEPRECATE )
<br>&nbsp;&nbsp;&nbsp; SET ( LIBRARY_TYPE SHARED )<br>ELSE (WIN32)<br>&nbsp;&nbsp;&nbsp; SET ( LIBRARY_TYPE STATIC )<br>ENDIF (WIN32)<br><br>ADD_LIBRARY ( ANN ${LIBRARY_TYPE}<br>&nbsp; ../src/ANN.cpp<br>&nbsp; ../src/bd_fix_rad_search.cpp<br>&nbsp; ../src/bd_pr_search.cpp
<br>&nbsp; ../src/bd_search.cpp<br>&nbsp; ../src/bd_tree.cpp<br>&nbsp; ../src/brute.cpp<br>&nbsp; ../src/kd_dump.cpp<br>&nbsp; ../src/kd_fix_rad_search.cpp<br>&nbsp; ../src/kd_pr_search.cpp<br>&nbsp; ../src/kd_search.cpp<br>&nbsp; ../src/kd_split.cpp<br>&nbsp; ../src/kd_tree.cpp
<br>&nbsp; ../src/kd_util.cpp<br>&nbsp; ../src/perf.cpp<br>&nbsp; )<br><br>ADD_EXECUTABLE ( ann_test<br>&nbsp; ../test/ann_test.cpp<br>&nbsp; ../test/rand.cpp<br>)<br><br>ADD_EXECUTABLE ( ann_sample<br>&nbsp; ../sample/ann_sample.cpp<br>)<br><br>ADD_EXECUTABLE ( ann2fig
<br>&nbsp; ../ann2fig/ann2fig.cpp<br>)<br><br>TARGET_LINK_LIBRARIES ( ann_test ANN )<br><br>TARGET_LINK_LIBRARIES ( ann_sample ANN )<br><br>TARGET_LINK_LIBRARIES ( ann2fig ANN )<br><br>INSTALL ( TARGETS ann_test ann_sample ann2fig ANN 
<br>&nbsp; RUNTIME DESTINATION bin<br>&nbsp; LIBRARY DESTINATION lib<br>&nbsp; ARCHIVE DESTINATION lib)<br><br><br>