Created
January 28, 2012 00:44
-
-
Save pvdk/1691838 to your computer and use it in GitHub Desktop.
Proposal for CMakeLists.txt in /apps/openmw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know if the source_group part works as I don't have a Windows box to test it on.