Modernise CMake #2
[platform/upstream/glslang.git] / StandAlone / CMakeLists.txt
1 add_library(glslang-default-resource-limits
2             ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp)
3 set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON)
4
5 target_include_directories(glslang-default-resource-limits
6                            PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
7                            PUBLIC ${PROJECT_SOURCE_DIR})
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 set_property(TARGET glslangValidator PROPERTY FOLDER tools)
15 set_property(TARGET spirv-remap PROPERTY FOLDER tools)
16 glslang_set_link_args(glslangValidator)
17 glslang_set_link_args(spirv-remap)
18
19 set(LIBRARIES
20     glslang
21     SPIRV
22     SPVRemapper
23     glslang-default-resource-limits)
24
25
26 if(WIN32)
27     set(LIBRARIES ${LIBRARIES} psapi)
28 elseif(UNIX)
29     if(NOT ANDROID)
30         set(LIBRARIES ${LIBRARIES} pthread)
31     endif()
32 endif(WIN32)
33
34 target_link_libraries(glslangValidator ${LIBRARIES})
35 target_link_libraries(spirv-remap ${LIBRARIES})
36
37 if(WIN32)
38     source_group("Source" FILES ${SOURCES})
39 endif(WIN32)
40
41 install(TARGETS glslangValidator
42         RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
43
44 install(TARGETS spirv-remap
45         RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})