CMakeLists.txt
changeset 1233 e3bd5f116e38
parent 1230 600d972bbd57
child 1255 0135d797e287
equal deleted inserted replaced
1232:eec14d60f416 1233:e3bd5f116e38
     1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
     1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
     2 PROJECT(MojoShader)
     2 PROJECT(MojoShader)
     3 
     3 
     4 OPTION(BUILD_SHARED "Build MojoShader as a shared library" OFF)
     4 OPTION(BUILD_SHARED_LIBS "Build MojoShader as a shared library" OFF)
     5 OPTION(PROFILE_D3D "Build MojoShader with support for the D3D profile" ON)
     5 OPTION(PROFILE_D3D "Build MojoShader with support for the D3D profile" ON)
     6 OPTION(PROFILE_BYTECODE "Build MojoShader with support for the BYTECODE profile" ON)
     6 OPTION(PROFILE_BYTECODE "Build MojoShader with support for the BYTECODE profile" ON)
     7 OPTION(PROFILE_GLSL120 "Build MojoShader with support for the GLSL120 profile" ON)
     7 OPTION(PROFILE_GLSL120 "Build MojoShader with support for the GLSL120 profile" ON)
     8 OPTION(PROFILE_GLSLES "Build MojoShader with support for the GLSLES profile" ON)
     8 OPTION(PROFILE_GLSLES "Build MojoShader with support for the GLSLES profile" ON)
     9 OPTION(PROFILE_GLSL "Build MojoShader with support for the GLSL profile" ON)
     9 OPTION(PROFILE_GLSL "Build MojoShader with support for the GLSL profile" ON)
   152 
   152 
   153 IF(XNA4_VERTEXTEXTURE)
   153 IF(XNA4_VERTEXTEXTURE)
   154     ADD_DEFINITIONS(-DMOJOSHADER_XNA4_VERTEX_TEXTURES)
   154     ADD_DEFINITIONS(-DMOJOSHADER_XNA4_VERTEX_TEXTURES)
   155 ENDIF(XNA4_VERTEXTEXTURE)
   155 ENDIF(XNA4_VERTEXTEXTURE)
   156 
   156 
   157 IF(BUILD_SHARED)
   157 ADD_LIBRARY(mojoshader
   158     SET(LIBRARY_FORMAT SHARED)
       
   159 ELSE(BUILD_SHARED)
       
   160     SET(LIBRARY_FORMAT STATIC)
       
   161 ENDIF(BUILD_SHARED)
       
   162 
       
   163 ADD_LIBRARY(mojoshader ${LIBRARY_FORMAT}
       
   164     mojoshader.c
   158     mojoshader.c
   165     mojoshader_common.c
   159     mojoshader_common.c
   166     mojoshader_opengl.c
   160     mojoshader_opengl.c
   167     mojoshader_metal.c
   161     mojoshader_metal.c
   168     profiles/mojoshader_profile_arb1.c
   162     profiles/mojoshader_profile_arb1.c
   184         mojoshader_preprocessor.c
   178         mojoshader_preprocessor.c
   185         mojoshader_lexer.c
   179         mojoshader_lexer.c
   186         mojoshader_assembler.c
   180         mojoshader_assembler.c
   187     )
   181     )
   188 ENDIF(COMPILER_SUPPORT)
   182 ENDIF(COMPILER_SUPPORT)
   189 IF(BUILD_SHARED)
   183 IF(BUILD_SHARED_LIBS)
   190     TARGET_LINK_LIBRARIES(mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
   184     TARGET_LINK_LIBRARIES(mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
   191 ENDIF(BUILD_SHARED)
   185 ENDIF(BUILD_SHARED_LIBS)
   192 
   186 
   193 SET_SOURCE_FILES_PROPERTIES(
   187 SET_SOURCE_FILES_PROPERTIES(
   194     mojoshader_compiler.c
   188     mojoshader_compiler.c
   195     PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.h"
   189     PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.h"
   196 )
   190 )