cleanup, add default binary dif + win32 copy action

This commit is contained in:
learn_more 2013-08-30 23:58:56 +02:00
parent 120b2ffa34
commit ea24d79332
5 changed files with 16 additions and 8 deletions

View File

@ -5,7 +5,6 @@ set(OpenSpades_VERSION_MAJOR 0)
set(OpenSpades_VERSION_MINOR 0)
set(OpenSpades_VERSION_REVISION 7)
include(FindSDL)
if(NOT SDL_FOUND)
message(FATAL_ERROR "OpenSDL not found, set ENV{SDLDIR} to point to OpenSDL, and optionally set the cmake var SDL_LIBRARY_TEMP to the lib dir")
@ -67,9 +66,12 @@ check_function_exists(gethostbyname_r HAS_GETHOSTBYNAME_R)
check_function_exists(inet_pton HAS_INET_PTON)
check_function_exists(inet_ntop HAS_INET_NTOP)
set(RESDIR "" CACHE STRING "Resource dir to use while developing")
if(RESDIR)
set(OPENSPADES_RESDIR "" CACHE STRING "Resource dir to use while developing")
if(OPENSPADES_RESDIR)
set(RESDIR ${OPENSPADES_RESDIR})
set(RESDIR_DEFINED TRUE)
mark_as_advanced(RESDIR)
mark_as_advanced(RESDIR_DEFINED)
endif()

View File

@ -24,7 +24,4 @@
#cmakedefine RESDIR_DEFINED
#if defined(RESDIR_DEFINED)
#define RESDIR "${RESDIR}"
#endif

View File

@ -1,6 +1,6 @@
if(RESDIR)
if(RESDIR_DEFINED)
add_custom_target(copy_resources ALL COMMENT "Copying resources")
file(GLOB_RECURSE SHADERS Shaders/*)

View File

@ -20,6 +20,15 @@ include_directories("Enet/include")
add_executable(OpenSpades ${AUDIO_FILES} ${AUDIO_AL_FILES} ${BINPACK_FILES} ${CLIENT_FILES} ${CORE_FILES} ${DRAW_FILES} ${ENET_FILES} ${GUI_FILES} ${IMPORTS_FILES} ${KISS_FILES}
${POLY2TRI_COMMON_FILES} ${POLY2TRI_SWEEP_FILES} ${UNZIP_FILES})
set_target_properties(OpenSpades PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(OpenSpades PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set_target_properties(OpenSpades PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set_target_properties(OpenSpades PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if(WIN32)
string(REGEX REPLACE "\\.lib$" ".dll" SDL_DLL ${SDL_LIBRARY})
add_custom_command(TARGET OpenSpades POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${SDL_DLL}" "${CMAKE_BINARY_DIR}/bin/\$\(Configuration\)/")
endif()
source_group("Audio" FILES ${AUDIO_FILES})
source_group("Audio\\AL" FILES ${AUDIO_AL_FILES})
source_group("binpack2d" FILES ${BINPACK_FILES})

View File

@ -111,7 +111,7 @@ int main(int argc, char ** argv)
}
SPLog("Log Started.");
#ifdef RESDIR
#if defined(RESDIR_DEFINED)
spades::FileManager::AddFileSystem
(new spades::DirectoryFileSystem(RESDIR, false));
#endif