From: <dc...@us...> - 2012-03-10 11:08:51
|
Revision: 1098 http://freeglut.svn.sourceforge.net/freeglut/?rev=1098&view=rev Author: dcnieho Date: 2012-03-10 11:08:44 +0000 (Sat, 10 Mar 2012) Log Message: ----------- CMake updates: - no longer trying to link with m.lib (tht maths for linux) - now building demos for static and for shared library, depending on which libraries are created - TARGET_LINK_LIBRARIES statement conditional on whether the relevant shared/static library is built Modified Paths: -------------- trunk/freeglut/freeglut/CMakeLists.txt Modified: trunk/freeglut/freeglut/CMakeLists.txt =================================================================== --- trunk/freeglut/freeglut/CMakeLists.txt 2012-03-10 03:17:55 UTC (rev 1097) +++ trunk/freeglut/freeglut/CMakeLists.txt 2012-03-10 11:08:44 UTC (rev 1098) @@ -89,8 +89,12 @@ FIND_PACKAGE(OpenGL REQUIRED) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) -LIST(APPEND LIBS m) +# lib m for math, not needed on windows +IF (NOT WIN32) + LIST(APPEND LIBS m) +ENDIF() + IF(WIN32) MESSAGE(WARNING "Insecure CRT warnings hidden (might want to fix these)") ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) @@ -163,8 +167,12 @@ SET_TARGET_PROPERTIES(freeglut PROPERTIES VERSION 3.9.0 SOVERSION 3 OUTPUT_NAME glut) SET_TARGET_PROPERTIES(freeglut_static PROPERTIES OUTPUT_NAME glut) ENDIF() -TARGET_LINK_LIBRARIES(freeglut ${LIBS}) -TARGET_LINK_LIBRARIES(freeglut_static ${LIBS}) +IF(BUILD_SHARED_LIBS) + TARGET_LINK_LIBRARIES(freeglut ${LIBS}) +ENDIF() +IF(BUILD_STATIC_LIBS) + TARGET_LINK_LIBRARIES(freeglut_static ${LIBS}) +ENDIF() IF(BUILD_SHARED_LIBS) INSTALL(TARGETS freeglut DESTINATION lib) @@ -180,17 +188,22 @@ option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON ) SET(DEMO_LIBS ${OPENGL_glu_LIBRARY} ${LIBS}) -LIST(APPEND DEMO_LIBS m) +# lib m for math, not needed on windows +IF (NOT WIN32) + LIST(APPEND DEMO_LIBS m) +ENDIF() MACRO(ADD_DEMO name) - if( FREEGLUT_BUILD_DEMOS ) - ADD_EXECUTABLE(${name} ${ARGN}) - IF(BUILD_SHARED_LIBS) - TARGET_LINK_LIBRARIES(${name} ${DEMO_LIBS} freeglut) - ELSE() - TARGET_LINK_LIBRARIES(${name} ${DEMO_LIBS} freeglut_static) - ENDIF() - endif() + IF( FREEGLUT_BUILD_DEMOS ) + IF(BUILD_SHARED_LIBS) + ADD_EXECUTABLE(${name} ${ARGN}) + TARGET_LINK_LIBRARIES(${name} ${DEMO_LIBS} freeglut) + ENDIF() + IF(BUILD_STATIC_LIBS) + ADD_EXECUTABLE(${name}_static ${ARGN}) + TARGET_LINK_LIBRARIES(${name}_static ${DEMO_LIBS} freeglut_static) + ENDIF() + ENDIF() ENDMACRO() ADD_DEMO(CallbackMaker progs/demos/CallbackMaker/CallbackMaker.c) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |