From: <be...@us...> - 2012-05-02 16:44:46
|
Revision: 1281 http://freeglut.svn.sourceforge.net/freeglut/?rev=1281&view=rev Author: beuc Date: 2012-05-02 16:44:40 +0000 (Wed, 02 May 2012) Log Message: ----------- CHECK_FUNCTION_EXISTS for sinf/cosf/sqrtf actually fails not because of missing math.h, but because of missing -lm. Fixed. Modified Paths: -------------- trunk/freeglut/freeglut/CMakeLists.txt Modified: trunk/freeglut/freeglut/CMakeLists.txt =================================================================== --- trunk/freeglut/freeglut/CMakeLists.txt 2012-05-02 16:42:55 UTC (rev 1280) +++ trunk/freeglut/freeglut/CMakeLists.txt 2012-05-02 16:44:40 UTC (rev 1281) @@ -187,7 +187,10 @@ # lib m for math, not needed on windows IF (NOT WIN32) + # For compilation: LIST(APPEND LIBS m) + # For CHECK_FUNCTION_EXISTS: + LIST(APPEND CMAKE_REQUIRED_LIBRARIES m) ENDIF() IF(WIN32) @@ -262,26 +265,9 @@ ENDIF() # Check for sinf/cosf/sqrtf -# CHECK_FUNCTION_EXISTS doesn't work because check requires <math.h> -#CHECK_FUNCTION_EXISTS(sinf HAVE_SINF) -#CHECK_FUNCTION_EXISTS(cosf HAVE_COSF) -#CHECK_FUNCTION_EXISTS(sqrtf HAVE_SQRTF) -INCLUDE(CheckCSourceCompiles) -CHECK_C_SOURCE_COMPILES(" - #include <math.h> - int main(){sinf(0); return 0;} - " HAVE_SINF -) -CHECK_C_SOURCE_COMPILES(" - #include <math.h> - int main(){cosf(0); return 0;} - " HAVE_COSF -) -CHECK_C_SOURCE_COMPILES(" - #include <math.h> - int main(){sqrtf(0); return 0;} - " HAVE_SQRTF -) +CHECK_FUNCTION_EXISTS(sinf HAVE_SINF) +CHECK_FUNCTION_EXISTS(cosf HAVE_COSF) +CHECK_FUNCTION_EXISTS(sqrtf HAVE_SQRTF) # The generated config.h is placed in the project's build directory, just to # ensure that all CMake-generated files are kept away from the main source tree. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |