Merge pull request #263 from antiagainst/cmake-minimum-required
[platform/upstream/glslang.git] / StandAlone / CMakeLists.txt
1 add_library(glslang-default-resource-limits
2     ${CMAKE_CURRENT_SOURCE_DIR}/DefaultResourceLimits.cpp
3 )
4 target_include_directories(glslang-default-resource-limits
5     PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
6     PUBLIC ${PROJECT_SOURCE_DIR}
7 )
8
9 set(SOURCES StandAlone.cpp)
10 set(REMAPPER_SOURCES spirv-remap.cpp)
11
12 add_executable(glslangValidator ${SOURCES})
13 add_executable(spirv-remap ${REMAPPER_SOURCES})
14
15 set(LIBRARIES
16     glslang
17     OGLCompiler
18     OSDependent
19     HLSL
20     SPIRV
21     glslang-default-resource-limits)
22
23 if(WIN32)
24     set(LIBRARIES ${LIBRARIES} psapi)
25 elseif(UNIX)
26     if(NOT ANDROID)
27         set(LIBRARIES ${LIBRARIES} pthread)
28     endif()
29 endif(WIN32)
30
31 target_link_libraries(glslangValidator ${LIBRARIES})
32 target_link_libraries(spirv-remap ${LIBRARIES})
33
34 if(WIN32)
35     source_group("Source" FILES ${SOURCES})
36 endif(WIN32)
37
38 install(TARGETS glslangValidator
39         RUNTIME DESTINATION bin)
40
41 install(TARGETS spirv-remap
42         RUNTIME DESTINATION bin)