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