[Orxonox-commit 2710] r7415 - code/trunk/cmake/tools
rgrieder at orxonox.net
rgrieder at orxonox.net
Sat Sep 11 20:20:30 CEST 2010
Author: rgrieder
Date: 2010-09-11 20:20:30 +0200 (Sat, 11 Sep 2010)
New Revision: 7415
Modified:
code/trunk/cmake/tools/GenerateToluaBindings.cmake
code/trunk/cmake/tools/SourceFileUtilities.cmake
code/trunk/cmake/tools/TargetUtilities.cmake
Log:
Placing all generated files in source group "Generated" for MSVC instead of different groups for PCH, Tolua and Compilations.
Modified: code/trunk/cmake/tools/GenerateToluaBindings.cmake
===================================================================
--- code/trunk/cmake/tools/GenerateToluaBindings.cmake 2010-09-11 15:47:47 UTC (rev 7414)
+++ code/trunk/cmake/tools/GenerateToluaBindings.cmake 2010-09-11 18:20:30 UTC (rev 7415)
@@ -46,11 +46,12 @@
${_tolua_hfile}
PARENT_SCOPE
)
- SOURCE_GROUP("Tolua" FILES ${_tolua_cxxfile} ${_tolua_hfile})
+
# Disable annoying GCC warnings
IF(CMAKE_COMPILER_IS_GNU)
SET_SOURCE_FILES_PROPERTIES(${_tolua_cxxfile} PROPERTIES COMPILE_FLAGS "-w")
ENDIF()
+
# Tolua binding speedup if required
IF(ORXONOX_RELEASE)
SET_SOURCE_FILES_PROPERTIES(${_tolua_cxxfile} PROPERTIES COMPILE_FLAGS "-DTOLUA_RELEASE")
Modified: code/trunk/cmake/tools/SourceFileUtilities.cmake
===================================================================
--- code/trunk/cmake/tools/SourceFileUtilities.cmake 2010-09-11 15:47:47 UTC (rev 7414)
+++ code/trunk/cmake/tools/SourceFileUtilities.cmake 2010-09-11 18:20:30 UTC (rev 7415)
@@ -117,8 +117,8 @@
STRING(REPLACE "/" "\\\\" _group_path "${_relative_path}")
SOURCE_GROUP("Source\\${_group_path}" FILES ${_file})
ELSE()
- # Has to be a compilation
- SOURCE_GROUP("Compilations" FILES ${_file})
+ # File is being generated in the binary directory
+ SOURCE_GROUP("Generated" FILES ${_file})
ENDIF()
ENDFOREACH(_file)
Modified: code/trunk/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/trunk/cmake/tools/TargetUtilities.cmake 2010-09-11 15:47:47 UTC (rev 7414)
+++ code/trunk/cmake/tools/TargetUtilities.cmake 2010-09-11 18:20:30 UTC (rev 7415)
@@ -83,8 +83,10 @@
SET(_switches FIND_HEADER_FILES EXCLUDE_FROM_ALL ORXONOX_EXTERNAL
NO_DLL_INTERFACE NO_SOURCE_GROUPS PCH_NO_DEFAULT
NO_INSTALL NO_VERSION ${_additional_switches})
- SET(_list_names LINK_LIBRARIES VERSION SOURCE_FILES DEFINE_SYMBOL
- TOLUA_FILES PCH_FILE PCH_EXCLUDE OUTPUT_NAME)
+ SET(_list_names LINK_LIBRARIES VERSION SOURCE_FILES
+ DEFINE_SYMBOL TOLUA_FILES PCH_FILE
+ PCH_EXCLUDE OUTPUT_NAME)
+
PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN})
@@ -104,25 +106,14 @@
GET_ALL_HEADER_FILES(_${_target_name}_header_files)
ENDIF()
+ # Combine source and header files
+ SET(_${_target_name}_files
+ ${_${_target_name}_header_files}
+ ${_${_target_name}_source_files}
+ )
# Remove potential duplicates
- SET(_${_target_name}_files ${_${_target_name}_header_files} ${_${_target_name}_source_files})
LIST(REMOVE_DUPLICATES _${_target_name}_files)
- # Generate the source groups
- IF(NOT _arg_NO_SOURCE_GROUPS)
- GENERATE_SOURCE_GROUPS(${_${_target_name}_files})
-
- IF(NOT _arg_ORXONOX_EXTERNAL)
- # Move the prereqs.h file to the config section
- IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_target_name_capitalised}Prereqs.h)
- SOURCE_GROUP("Config" FILES ${_target_name_capitalised}Prereqs.h)
- ENDIF()
- # Add the config files in a special source group
- LIST(APPEND _${_target_name}_files ${ORXONOX_CONFIG_FILES})
- SOURCE_GROUP("Config" FILES ${ORXONOX_CONFIG_FILES})
- ENDIF()
- ENDIF(NOT _arg_NO_SOURCE_GROUPS)
-
# TOLUA_FILES
IF(_arg_TOLUA_FILES)
GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files
@@ -145,6 +136,21 @@
ENDIF()
ENDIF()
+ # Generate the source groups
+ IF(MSVC AND NOT _arg_NO_SOURCE_GROUPS)
+ GENERATE_SOURCE_GROUPS(${_${_target_name}_files})
+
+ IF(NOT _arg_ORXONOX_EXTERNAL)
+ # Move the prereqs.h file to the config section
+ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_target_name_capitalised}Prereqs.h)
+ SOURCE_GROUP("Config" FILES ${_target_name_capitalised}Prereqs.h)
+ ENDIF()
+ # Add config files to the config section
+ LIST(APPEND _${_target_name}_files ${ORXONOX_CONFIG_FILES})
+ SOURCE_GROUP("Config" FILES ${ORXONOX_CONFIG_FILES})
+ ENDIF()
+ ENDIF(NOT _arg_NO_SOURCE_GROUPS)
+
# Set link mode (SHARED/STATIC)
IF(MSVC AND _arg_NO_DLL_INTERFACE)
# Certain libraries don't have dllexport/dllimport and can't be linked shared with MSVC
More information about the Orxonox-commit
mailing list