PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/src/Cg/CMakeLists.txt

https://bitbucket.org/cabalistic/ogredeps/
CMake | 55 lines | 49 code | 3 blank | 3 comment | 11 complexity | db5d1655628f12cd2bd9cceca62ff872 MD5 | raw file
 1project(Cg)
 2
 3set(Cg_INCLUDE_DIR "${Cg_SOURCE_DIR}/include" CACHE PATH "" FORCE)
 4
 5if (WIN32)
 6  # manually copy to build and install the correct DLL
 7  if (OGREDEPS_PLATFORM_X64)
 8    set(CG_DLL bin64/cg.dll)
 9    set(Cg_LIBRARY_REL "${Cg_SOURCE_DIR}/lib64/cg.lib" CACHE PATH "" FORCE)
10    set(Cg_LIBRARY_DBG "${Cg_SOURCE_DIR}/lib64/cg.lib" CACHE PATH "" FORCE)
11  else ()
12    set(CG_DLL bin/cg.dll)
13    set(Cg_LIBRARY_REL "${Cg_SOURCE_DIR}/lib/cg.lib" CACHE PATH "" FORCE)
14    set(Cg_LIBRARY_DBG "${Cg_SOURCE_DIR}/lib/cg.lib" CACHE PATH "" FORCE)
15  endif ()
16  install(FILES ${CG_DLL} DESTINATION bin/Release)
17  install(FILES ${CG_DLL} DESTINATION bin/Debug)
18  if (MINGW)
19    file(COPY ${CG_DLL} DESTINATION ${OGREDEPS_RUNTIME_OUTPUT})
20  else ()
21    file(COPY ${CG_DLL} DESTINATION ${OGREDEPS_RUNTIME_OUTPUT}/Debug)
22    file(COPY ${CG_DLL} DESTINATION ${OGREDEPS_RUNTIME_OUTPUT}/Release)
23  endif ()
24elseif (APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
25  add_custom_target(Cg COMMAND 
26    unzip lib/Cg.framework.zip -d ${OGREDEPS_BINARY_DIR}/../${OGREDEPS_LIB_DIRECTORY}
27    WORKING_DIRECTORY ${Cg_SOURCE_DIR}
28    COMMENT "Unzipping Cg framework" VERBATIM
29  )
30elseif (UNIX)
31  # manually install the correct .so
32  if (OGREDEPS_PLATFORM_X64)
33    install(FILES lib64/libCg.so DESTINATION ${OGREDEPS_LIB_DIRECTORY})
34    set(Cg_LIBRARY_REL "${Cg_SOURCE_DIR}/lib64/libCg.so" CACHE PATH "" FORCE)
35    set(Cg_LIBRARY_DBG "${Cg_SOURCE_DIR}/lib64/libCg.so" CACHE PATH "" FORCE)
36  else ()
37    install(FILES lib/libCg.so DESTINATION ${OGREDEPS_LIB_DIRECTORY})
38    set(Cg_LIBRARY_REL "${Cg_SOURCE_DIR}/lib/libCg.so" CACHE PATH "" FORCE)
39    set(Cg_LIBRARY_DBG "${Cg_SOURCE_DIR}/lib/libCg.so" CACHE PATH "" FORCE)
40  endif ()
41endif ()
42
43if (OGREDEPS_INSTALL_DEV)
44  install(DIRECTORY include/ DESTINATION include)
45  if (WIN32)
46    # install the correct lib
47    if (OGREDEPS_PLATFORM_X64)
48      install(FILES lib64/cg.lib DESTINATION ${OGREDEPS_LIB_DIRECTORY}/Debug)
49      install(FILES lib64/cg.lib DESTINATION ${OGREDEPS_LIB_DIRECTORY}/Release)
50    else ()
51      install(FILES lib/cg.lib DESTINATION ${OGREDEPS_LIB_DIRECTORY}/Debug)
52      install(FILES lib/cg.lib DESTINATION ${OGREDEPS_LIB_DIRECTORY}/Release)
53    endif ()
54  endif ()
55endif ()