Show
Ignore:
Timestamp:
04/06/08 06:15:01 (8 months ago)
Author:
krobillard
Message:

Thune-gl is now built separately with CMake.
Added UG_DT_COUNT & ug_datatypes to thune-gl header.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/CMakeLists.txt

    r517 r518  
    1616 
    1717 
     18# Why isn't this the default? 
     19# Having to repeat the conditional expression is retarded. 
     20set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) 
     21 
    1822set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") 
    1923 
     
    2226        add_definitions(-std=c99 -pedantic -D_GNU_SOURCE) 
    2327    set(OS_FILE unix/os.c) 
    24 endif (UNIX) 
     28endif () 
    2529 
    2630if (WIN32) 
    2731        include_directories(. win32) 
    2832    set(OS_FILE win32/os.c) 
    29 endif (WIN32) 
     33endif () 
    3034 
    3135 
     
    5458set_target_properties(thune-lib PROPERTIES OUTPUT_NAME "thune") 
    5559 
     60if (APPLE) 
     61    target_link_libraries(thune-lib m bz2) 
     62endif () 
     63if (UNIX AND NOT APPLE) 
     64    target_link_libraries(thune-lib m bz2 pthread) 
     65endif () 
     66if (WIN32) 
     67    target_link_libraries(thune-lib ws2_32) 
     68endif () 
    5669 
    57 add_executable(thune 
    58         console.c 
    59 ) 
    6070 
    61 if (APPLE) 
    62     target_link_libraries(thune thune-lib m bz2) 
    63 endif (APPLE) 
     71add_executable(thune-bin console.c) 
     72set_target_properties(thune-bin PROPERTIES OUTPUT_NAME "thune") 
    6473 
    65 if (UNIX AND NOT APPLE) 
    66     target_link_libraries(thune thune-lib m bz2 pthread) 
    67 endif (UNIX AND NOT APPLE) 
     74# NOTE: This links the binary with the libraries thune-lib links against. 
     75# This creates unneeded linker dependencies, but the CMake FAQ says that 
     76# there is no way to change this behavior. 
     77# Here is a blog entry which talks about this problem: 
     78#   http://blogs.sun.com/rie/entry/tt_dependencies_tt_define_what 
    6879 
    69 if (WIN32) 
    70     target_link_libraries(thune thune-lib ws2_32) 
    71 endif (WIN32) 
     80target_link_libraries(thune-bin thune-lib) 
    7281 
    7382 
    7483if (UNIX) 
    75 install(TARGETS thune    DESTINATION /usr/local/bin) 
     84install(TARGETS thune-bin DESTINATION /usr/local/bin) 
    7685install(TARGETS thune-lib DESTINATION /usr/local/lib) 
    7786install(FILES   urlan.h   DESTINATION /usr/local/include) 
    78 endif (UNIX) 
    79  
    80  
    81 find_package( FreeType ) 
    82 find_package( OpenGL ) 
    83 find_package( OpenAL ) 
    84 find_package( PNG ) 
    85 find_package( GLV ) 
    86  
    87 # Holy shit CMake authors, having to repeat the conditional expression 
    88 # is retarded! 
    89  
    90 if (FREETYPE_FOUND AND OPENGL_FOUND AND OPENAL_FOUND AND PNG_FOUND AND GLV_FOUND) 
    91         add_subdirectory( gl . ) 
    92 else (FREETYPE_FOUND AND OPENGL_FOUND AND OPENAL_FOUND AND PNG_FOUND AND GLV_FOUND) 
    93         message(STATUS "Skipping Thune-GL. Missing these dependencies:") 
    94         if (NOT FREETYPE_FOUND) 
    95                 message(STATUS "  FreeType not found") 
    96         endif (NOT FREETYPE_FOUND) 
    97         if (NOT OPENGL_FOUND) 
    98                 message(STATUS "  OpenGL not found") 
    99         endif (NOT OPENGL_FOUND) 
    100         if (NOT OPENAL_FOUND) 
    101                 message(STATUS "  OpenAL not found") 
    102         endif (NOT OPENAL_FOUND) 
    103         if (NOT PNG_FOUND) 
    104                 message(STATUS "  PNG not found") 
    105         endif (NOT PNG_FOUND) 
    106         if (NOT GLV_FOUND) 
    107                 message(STATUS "  GLV not found") 
    108         endif (NOT GLV_FOUND) 
    109 endif (FREETYPE_FOUND AND OPENGL_FOUND AND OPENAL_FOUND AND PNG_FOUND AND GLV_FOUND) 
     87endif () 
    11088 
    11189# eof