From: <ai...@us...> - 2013-06-04 21:45:57
|
Revision: 12360 http://sourceforge.net/p/plplot/code/12360 Author: airwin Date: 2013-06-04 21:45:51 +0000 (Tue, 04 Jun 2013) Log Message: ----------- Implement proper linking to the math library. Modified Paths: -------------- trunk/cmake/build_projects/libharu/CMakeLists.txt trunk/cmake/build_projects/libharu/demo/CMakeLists.txt Modified: trunk/cmake/build_projects/libharu/CMakeLists.txt =================================================================== --- trunk/cmake/build_projects/libharu/CMakeLists.txt 2013-06-04 21:44:35 UTC (rev 12359) +++ trunk/cmake/build_projects/libharu/CMakeLists.txt 2013-06-04 21:45:51 UTC (rev 12360) @@ -141,12 +141,13 @@ include(haru) include(summary) +set(ADDITIONAL_LIBRARIES ${MATH_LIB}) # check zlib availibility find_package(ZLIB) if(ZLIB_FOUND) set(HAVE_LIBZ ON) include_directories(${ZLIB_INCLUDE_DIR}) - set(ADDITIONAL_LIBRARIES ${ZLIB_LIBRARIES}) + list(APPEND ADDITIONAL_LIBRARIES ${ZLIB_LIBRARIES}) else(ZLIB_FOUND) set(HPDF_NOZLIB ON) endif(ZLIB_FOUND) @@ -157,7 +158,7 @@ set(HAVE_LIBPNG ON) include_directories(${PNG_INCLUDE_DIR}) add_definitions(${PNG_DEFINITIONS}) - set(ADDITIONAL_LIBRARIES ${ADDITIONAL_LIBRARIES} ${PNG_LIBRARIES}) + list(APPEND ADDITIONAL_LIBRARIES ${PNG_LIBRARIES}) else(PNG_FOUND) set(HPDF_NOPNGLIB ON) endif(PNG_FOUND) Modified: trunk/cmake/build_projects/libharu/demo/CMakeLists.txt =================================================================== --- trunk/cmake/build_projects/libharu/demo/CMakeLists.txt 2013-06-04 21:44:35 UTC (rev 12359) +++ trunk/cmake/build_projects/libharu/demo/CMakeLists.txt 2013-06-04 21:45:51 UTC (rev 12360) @@ -112,6 +112,23 @@ endif(USE_RPATH) endforeach(demo) + if(MATH_LIB) + # These are a subset of the demos above which include math.h and which + # therefore require linking with ${MATH_LIB}. + set( + demos_requiring_MATH_LIB + text_demo2 + text_demo + raw_image_demo + image_demo + make_rawimage + ) + + foreach(demo ${demos_requiring_MATH_LIB}) + target_link_libraries(${demo} ${MATH_LIB}) + endforeach(demo ${demos_requiring_MATH_LIB}) + endif(MATH_LIB) + add_executable(grid_sheet grid_sheet.c) # the grid_sheet demo needs extra define, but cannot use add_definitions # for that because that command affects all source files in the directory. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |