CMakeLists.txt
changeset 1036 8a3597b44ff7
parent 1019 e8988ca01c6d
child 1134 be31bd0ee0a2
--- a/CMakeLists.txt	Tue May 31 01:09:12 2011 -0400
+++ b/CMakeLists.txt	Tue May 31 03:23:39 2011 -0400
@@ -72,6 +72,10 @@
     mojoshader_opengl.c
 )
 
+IF(UNIX)
+    SET(LIBM -lm)
+ENDIF(UNIX)
+
 SET_SOURCE_FILES_PROPERTIES(
     mojoshader_compiler.c
     PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.h"
@@ -94,15 +98,15 @@
 IF(SDL_FOUND)
     INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
     ADD_EXECUTABLE(glcaps utils/glcaps.c)
-    TARGET_LINK_LIBRARIES(glcaps ${SDL_LIBRARY})
+    TARGET_LINK_LIBRARIES(glcaps ${SDL_LIBRARY} ${LIBM})
     ADD_EXECUTABLE(bestprofile utils/bestprofile.c)
-    TARGET_LINK_LIBRARIES(bestprofile mojoshader ${SDL_LIBRARY})
+    TARGET_LINK_LIBRARIES(bestprofile mojoshader ${SDL_LIBRARY} ${LIBM})
     ADD_EXECUTABLE(availableprofiles utils/availableprofiles.c)
-    TARGET_LINK_LIBRARIES(availableprofiles mojoshader ${SDL_LIBRARY})
+    TARGET_LINK_LIBRARIES(availableprofiles mojoshader ${SDL_LIBRARY} ${LIBM})
 ENDIF(SDL_FOUND)
 
 ADD_EXECUTABLE(finderrors utils/finderrors.c)
-TARGET_LINK_LIBRARIES(finderrors mojoshader ${SDL_LIBRARY})
+TARGET_LINK_LIBRARIES(finderrors mojoshader ${SDL_LIBRARY} ${LIBM})
 IF(SDL_FOUND)
     SET_SOURCE_FILES_PROPERTIES(
         utils/finderrors.c
@@ -111,11 +115,11 @@
 ENDIF(SDL_FOUND)
 
 ADD_EXECUTABLE(testparse utils/testparse.c)
-TARGET_LINK_LIBRARIES(testparse mojoshader)
+TARGET_LINK_LIBRARIES(testparse mojoshader ${LIBM})
 ADD_EXECUTABLE(testoutput utils/testoutput.c)
-TARGET_LINK_LIBRARIES(testoutput mojoshader)
+TARGET_LINK_LIBRARIES(testoutput mojoshader ${LIBM})
 ADD_EXECUTABLE(mojoshader-compiler utils/mojoshader-compiler.c)
-TARGET_LINK_LIBRARIES(mojoshader-compiler mojoshader)
+TARGET_LINK_LIBRARIES(mojoshader-compiler mojoshader ${LIBM})
 
 # Unit tests...
 ADD_CUSTOM_TARGET(