Changeset 518 for trunk/thune/CMakeLists.txt
- Timestamp:
- 04/06/08 06:15:01 (8 months ago)
- Files:
-
- 1 modified
-
trunk/thune/CMakeLists.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/CMakeLists.txt
r517 r518 16 16 17 17 18 # Why isn't this the default? 19 # Having to repeat the conditional expression is retarded. 20 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) 21 18 22 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") 19 23 … … 22 26 add_definitions(-std=c99 -pedantic -D_GNU_SOURCE) 23 27 set(OS_FILE unix/os.c) 24 endif ( UNIX)28 endif () 25 29 26 30 if (WIN32) 27 31 include_directories(. win32) 28 32 set(OS_FILE win32/os.c) 29 endif ( WIN32)33 endif () 30 34 31 35 … … 54 58 set_target_properties(thune-lib PROPERTIES OUTPUT_NAME "thune") 55 59 60 if (APPLE) 61 target_link_libraries(thune-lib m bz2) 62 endif () 63 if (UNIX AND NOT APPLE) 64 target_link_libraries(thune-lib m bz2 pthread) 65 endif () 66 if (WIN32) 67 target_link_libraries(thune-lib ws2_32) 68 endif () 56 69 57 add_executable(thune58 console.c59 )60 70 61 if (APPLE) 62 target_link_libraries(thune thune-lib m bz2) 63 endif (APPLE) 71 add_executable(thune-bin console.c) 72 set_target_properties(thune-bin PROPERTIES OUTPUT_NAME "thune") 64 73 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 68 79 69 if (WIN32) 70 target_link_libraries(thune thune-lib ws2_32) 71 endif (WIN32) 80 target_link_libraries(thune-bin thune-lib) 72 81 73 82 74 83 if (UNIX) 75 install(TARGETS thune DESTINATION /usr/local/bin)84 install(TARGETS thune-bin DESTINATION /usr/local/bin) 76 85 install(TARGETS thune-lib DESTINATION /usr/local/lib) 77 86 install(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) 87 endif () 110 88 111 89 # eof
