Revert "Modernise CMake"
[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 glslang_set_link_args(glslangValidator)
19 glslang_set_link_args(spirv-remap)
20
21 set(LIBRARIES
22     glslang
23     SPIRV
24     SPVRemapper
25     glslang-default-resource-limits)
26
27
28 if(WIN32)
29     set(LIBRARIES ${LIBRARIES} psapi)
30 elseif(UNIX)
31     if(NOT ANDROID)
32         set(LIBRARIES ${LIBRARIES} pthread)
33     endif()
34 endif(WIN32)
35
36 target_link_libraries(glslangValidator ${LIBRARIES})
37 target_link_libraries(spirv-remap ${LIBRARIES})
38
39 if(WIN32)
40     source_group("Source" FILES ${SOURCES})
41 endif(WIN32)
42
43 install(TARGETS glslangValidator
44         RUNTIME DESTINATION bin)
45
46 install(TARGETS spirv-remap
47         RUNTIME DESTINATION bin)