Skip to content

Instantly share code, notes, and snippets.

@pvdk
Created January 28, 2012 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvdk/1691838 to your computer and use it in GitHub Desktop.
Save pvdk/1691838 to your computer and use it in GitHub Desktop.
Proposal for CMakeLists.txt in /apps/openmw
# Config file for version
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/config.hpp")
# Source files
file(GLOB_RECURSE OPENMW ${CMAKE_CURRENT_SOURCE_DIR} "[^.]*.[ch]pp" "[^.]*.[ch]")
# Make the variable accessible for other subdirectories
set(OPENMW ${OPENMW} PARENT_SCOPE)
# Create source groups
file(GLOB LOCAL ${CMAKE_CURRENT_SOURCE_DIR} "[^.]*.[ch]pp" "[^.]*.[ch]")
source_group("apps\\openmw" FILES ${LOCAL})
file(GLOB DIRS ${CMAKE_CURRENT_SOURCE_DIR} "*")
foreach(dir ${DIRS})
if(IS_DIRECTORY ${dir})
file(RELATIVE_PATH dirname ${CMAKE_CURRENT_SOURCE_DIR} ${dir})
if(dirname)
# Create a source group for the subdirectory
source_group("apps\\openmw\\${dirname}" REGULAR_EXPRESSION "^.*(${dirname}).*$" FILES ${OPENMW})
endif(dirname)
endif()
endforeach(dir)
# Main executable
add_executable(openmw
${OPENMW_LIBS} ${OPENMW_LIBS_HEADER}
${CONPONENT_FILES}
${OPENMW}
${APPLE_BUNDLE_RESOURCES}
)
@pvdk
Copy link
Author

pvdk commented Jan 28, 2012

I don't know if the source_group part works as I don't have a Windows box to test it on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment