From 6852af8158727700ce177664180f6d008ebff131 Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Fri, 18 Nov 2016 11:58:04 +0100 Subject: [PATCH] source groups fixed --- resources/cmake/macros/RegisterSourceGroup.cmake | 10 +++++++--- src/CMakeLists.txt | 5 ----- src/storm-pgcl/CMakeLists.txt | 5 +++++ src/storm/CMakeLists.txt | 4 ++++ src/test/CMakeLists.txt | 5 +++++ 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/resources/cmake/macros/RegisterSourceGroup.cmake b/resources/cmake/macros/RegisterSourceGroup.cmake index 1243a133a..592395293 100644 --- a/resources/cmake/macros/RegisterSourceGroup.cmake +++ b/resources/cmake/macros/RegisterSourceGroup.cmake @@ -1,12 +1,16 @@ -macro(register_source_groups_from_filestructure list_of_files) +macro(register_source_groups_from_filestructure list_of_files remove_prefix) foreach(FILE ${list_of_files}) get_filename_component(PARENT_DIR "${FILE}" PATH) # skip src or include and changes /'s to \\'s string(REPLACE ${PROJECT_SOURCE_DIR} "" PARENT_DIR "${PARENT_DIR}") string(REGEX REPLACE "(\\./)?(src|include)/?" "" GROUP "${PARENT_DIR}") - string(REPLACE "/" "\\" GROUP "${GROUP}") - + string(REGEX REPLACE "${remove_prefix}/?" "" GROUP "${GROUP}") + #string(REGEX REPLACE "/storm?/" "" GROUP ${GROUP}) + #STRING(SUBSTRING "${GROUP}" 1 -1 GROUP) + string(REPLACE "/" "\\" GROUP "${GROUP}") + message(${GROUP}: ${FILE}) + # group into "Source Files" and "Header Files" # if ("${FILE}" MATCHES ".*\\.cpp") # set(GROUP "Source Files\\${GROUP}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index da12dae20..39c35964f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,8 +5,3 @@ add_subdirectory(storm-pgcl-cli) add_subdirectory(test) - - -file(GLOB_RECURSE ALL_FILES ${PROJECT_SOURCE_DIR}/src/*.h ${PROJECT_SOURCE_DIR}/src/*.cpp) - -register_source_groups_from_filestructure("${ALL_FILES}") \ No newline at end of file diff --git a/src/storm-pgcl/CMakeLists.txt b/src/storm-pgcl/CMakeLists.txt index c28480520..bd1ffc932 100644 --- a/src/storm-pgcl/CMakeLists.txt +++ b/src/storm-pgcl/CMakeLists.txt @@ -1,3 +1,8 @@ +file(GLOB_RECURSE ALL_FILES ${PROJECT_SOURCE_DIR}/src/storm-pgcl/*.h ${PROJECT_SOURCE_DIR}/src/storm-pgcl/*.cpp) + +register_source_groups_from_filestructure("${ALL_FILES}" storm-pgcl) + + file(GLOB_RECURSE STORM_PGCL_SOURCES ${PROJECT_SOURCE_DIR}/src/storm-pgcl/*/*.cpp) file(GLOB_RECURSE STORM_PGCL_HEADERS ${PROJECT_SOURCE_DIR}/src/storm-pgcl/*/*.h) diff --git a/src/storm/CMakeLists.txt b/src/storm/CMakeLists.txt index 8cf6c6efb..091595619 100644 --- a/src/storm/CMakeLists.txt +++ b/src/storm/CMakeLists.txt @@ -1,3 +1,7 @@ +file(GLOB_RECURSE ALL_FILES ${PROJECT_SOURCE_DIR}/src/storm/*.h ${PROJECT_SOURCE_DIR}/src/storm/*.cpp) + +register_source_groups_from_filestructure("${ALL_FILES}" storm) + ############################################################# ## ## Source file aggregation and clustering diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 1c14ec19f..0ac649481 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -1,3 +1,8 @@ +file(GLOB_RECURSE ALL_FILES ${PROJECT_SOURCE_DIR}/src/test/*.h ${PROJECT_SOURCE_DIR}/src/test/*.cpp) + +register_source_groups_from_filestructure("${ALL_FILES}" test) + + # Test Sources # Note that the tests also need the source files, except for the main file include_directories(${GTEST_INCLUDE_DIR})