Updated cmake to better organize folders and options.

This adds solution folders that properly group gtest/glslang/hlsl.
This also marks gtest options as advanced so they don't show up
in cmake-gui by default.
This commit is contained in:
Andrew Woloszyn 2016-05-05 14:45:53 -04:00
parent 97f4e0fe19
commit db0eaf9887
10 changed files with 30 additions and 0 deletions

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 2.8.12)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
enable_testing()

View File

@ -10,6 +10,24 @@ elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
endif(WIN32)
add_subdirectory(googletest)
set(GTEST_TARGETS
gtest
gtest_main
gmock
gmock_main
)
foreach(target ${GTEST_TARGETS})
set_property(TARGET ${target} PROPERTY FOLDER gtest)
endforeach()
mark_as_advanced(gmock_build_tests
BUILD_GMOCK
BUILD_GTEST
BUILD_SHARED_LIBS
gtest_build_samples
gtest_build_tests
gtest_disable_pthreads
gtest_force_shared_crt
gtest_hide_internal_symbols)
else()
message(STATUS
"Google Mock was not found - tests based on that will not build")

View File

@ -1,6 +1,7 @@
set(SOURCES InitializeDll.cpp InitializeDll.h)
add_library(OGLCompiler STATIC ${SOURCES})
set_property(TARGET OGLCompiler PROPERTY FOLDER glslang)
if(WIN32)
source_group("Source" FILES ${SOURCES})

View File

@ -17,6 +17,7 @@ set(HEADERS
disassemble.h)
add_library(SPIRV STATIC ${SOURCES} ${HEADERS})
set_property(TARGET SPIRV PROPERTY FOLDER glslang)
if(WIN32)
source_group("Source" FILES ${SOURCES} ${HEADERS})

View File

@ -1,6 +1,8 @@
add_library(glslang-default-resource-limits
${CMAKE_CURRENT_SOURCE_DIR}/DefaultResourceLimits.cpp
)
set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
target_include_directories(glslang-default-resource-limits
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${PROJECT_SOURCE_DIR}
@ -11,6 +13,8 @@ set(REMAPPER_SOURCES spirv-remap.cpp)
add_executable(glslangValidator ${SOURCES})
add_executable(spirv-remap ${REMAPPER_SOURCES})
set_property(TARGET glslangValidator PROPERTY FOLDER tools)
set_property(TARGET spirv-remap PROPERTY FOLDER tools)
set(LIBRARIES
glslang

View File

@ -75,6 +75,7 @@ set(HEADERS
# set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp)
add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS})
set_property(TARGET glslang PROPERTY FOLDER glslang)
if(WIN32)
source_group("Public" REGULAR_EXPRESSION "Public/*")

View File

@ -1,4 +1,5 @@
add_library(OSDependent STATIC ossource.cpp ../osinclude.h)
set_property(TARGET OSDependent PROPERTY FOLDER glslang)
install(TARGETS OSDependent
ARCHIVE DESTINATION lib)

View File

@ -1,6 +1,7 @@
set(SOURCES ossource.cpp ../osinclude.h)
add_library(OSDependent STATIC ${SOURCES})
set_property(TARGET OSDependent PROPERTY FOLDER glslang)
# MinGW GCC complains about function pointer casts to void*.
# Turn that off with -fpermissive.

View File

@ -18,6 +18,7 @@ if (TARGET gmock)
)
add_executable(glslangtests ${TEST_SOURCES})
set_property(TARGET glslangtests PROPERTY FOLDER tests)
target_compile_definitions(glslangtests
PRIVATE GLSLANG_TEST_DIRECTORY="${CMAKE_CURRENT_SOURCE_DIR}/../Test")
target_include_directories(glslangtests PRIVATE

View File

@ -14,6 +14,7 @@ set(HEADERS
hlslGrammar.h)
add_library(HLSL STATIC ${SOURCES} ${HEADERS})
set_property(TARGET HLSL PROPERTY FOLDER hlsl)
if(WIN32)
source_group("Source" FILES ${SOURCES} ${HEADERS})