Fixed some issues with the CMake files

actorid
Pieter van der Kloet 13 years ago
parent f14dc90b34
commit ea241d85ef

@ -1,18 +1,16 @@
project(OpenMW)
# config file # config file
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/config.hpp")
configure_file ("${OpenMW_SOURCE_DIR}/config.hpp.cmake" "${OpenMW_SOURCE_DIR}/config.hpp")
# local files # local files
set(GAME set(GAME
main.cpp main.cpp
engine.cpp engine.cpp
) )
set(GAME_HEADER set(GAME_HEADER
engine.hpp engine.hpp
config.hpp) config.hpp
)
source_group(game FILES ${GAME} ${GAME_HEADER}) source_group(game FILES ${GAME} ${GAME_HEADER})
add_openmw_dir (mwrender add_openmw_dir (mwrender
@ -61,14 +59,12 @@ add_openmw_dir (mwmechanics
# Main executable # Main executable
add_executable(openmw add_executable(openmw
${OPENMW_LIBS} ${OPENMW_LIBS_HEADER} ${OPENMW_LIBS} ${OPENMW_LIBS_HEADER}
${CONPONENT_FILES} ${COMPONENT_FILES}
${OPENMW_FILES} ${OPENMW_FILES}
${GAME} ${GAME_HEADER} ${GAME} ${GAME_HEADER}
${APPLE_BUNDLE_RESOURCES} ${APPLE_BUNDLE_RESOURCES}
) )
target_link_libraries (openmw components)
# Sound stuff - here so CMake doesn't stupidly recompile EVERYTHING # Sound stuff - here so CMake doesn't stupidly recompile EVERYTHING
# when we change the backend. # when we change the backend.
include_directories(${SOUND_INPUT_INCLUDES} ${BULLET_INCLUDE_DIRS}) include_directories(${SOUND_INPUT_INCLUDES} ${BULLET_INCLUDE_DIRS})
@ -82,6 +78,7 @@ target_link_libraries(openmw
${SOUND_INPUT_LIBRARY} ${SOUND_INPUT_LIBRARY}
${BULLET_LIBRARIES} ${BULLET_LIBRARIES}
caelum caelum
components
MyGUIEngine MyGUIEngine
MyGUIOgrePlatform MyGUIOgrePlatform
) )
@ -97,4 +94,4 @@ endif (APPLE)
if(DPKG_PROGRAM) if(DPKG_PROGRAM)
INSTALL(TARGETS openmw RUNTIME DESTINATION games COMPONENT openmw) INSTALL(TARGETS openmw RUNTIME DESTINATION games COMPONENT openmw)
endif() endif(DPKG_PROGRAM)

@ -2,7 +2,7 @@
macro (add_openmw_dir dir) macro (add_openmw_dir dir)
set (files) set (files)
foreach (u ${ARGN}) foreach (u ${ARGN})
file (GLOB ALL RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.*") file (GLOB ALL ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.*")
foreach (f ${ALL}) foreach (f ${ALL})
list (APPEND files "${f}") list (APPEND files "${f}")
list (APPEND OPENMW_FILES "${f}") list (APPEND OPENMW_FILES "${f}")
@ -14,7 +14,7 @@ endmacro (add_openmw_dir)
macro (add_component_dir dir) macro (add_component_dir dir)
set (files) set (files)
foreach (u ${ARGN}) foreach (u ${ARGN})
file (GLOB ALL RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.*") file (GLOB ALL ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.*")
foreach (f ${ALL}) foreach (f ${ALL})
list (APPEND files "${f}") list (APPEND files "${f}")
list (APPEND COMPONENT_FILES "${f}") list (APPEND COMPONENT_FILES "${f}")

@ -66,3 +66,7 @@ include_directories(${BULLET_INCLUDE_DIRS})
add_library(components STATIC ${COMPONENT_FILES}) add_library(components STATIC ${COMPONENT_FILES})
target_link_libraries(components ${Boost_LIBRARIES} ${OGRE_LIBRARIES}) target_link_libraries(components ${Boost_LIBRARIES} ${OGRE_LIBRARIES})
# Make the variable accessible for other subdirectories
set(COMPONENT_FILES ${COMPONENT_FILES} PARENT_SCOPE)

Loading…
Cancel
Save