cleanup, add default binary dif + win32 copy action
This commit is contained in:
parent
120b2ffa34
commit
ea24d79332
@ -5,7 +5,6 @@ set(OpenSpades_VERSION_MAJOR 0)
|
|||||||
set(OpenSpades_VERSION_MINOR 0)
|
set(OpenSpades_VERSION_MINOR 0)
|
||||||
set(OpenSpades_VERSION_REVISION 7)
|
set(OpenSpades_VERSION_REVISION 7)
|
||||||
|
|
||||||
|
|
||||||
include(FindSDL)
|
include(FindSDL)
|
||||||
if(NOT SDL_FOUND)
|
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")
|
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_pton HAS_INET_PTON)
|
||||||
check_function_exists(inet_ntop HAS_INET_NTOP)
|
check_function_exists(inet_ntop HAS_INET_NTOP)
|
||||||
|
|
||||||
set(RESDIR "" CACHE STRING "Resource dir to use while developing")
|
set(OPENSPADES_RESDIR "" CACHE STRING "Resource dir to use while developing")
|
||||||
if(RESDIR)
|
if(OPENSPADES_RESDIR)
|
||||||
|
set(RESDIR ${OPENSPADES_RESDIR})
|
||||||
set(RESDIR_DEFINED TRUE)
|
set(RESDIR_DEFINED TRUE)
|
||||||
|
mark_as_advanced(RESDIR)
|
||||||
|
mark_as_advanced(RESDIR_DEFINED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,7 +24,4 @@
|
|||||||
|
|
||||||
|
|
||||||
#cmakedefine RESDIR_DEFINED
|
#cmakedefine RESDIR_DEFINED
|
||||||
|
|
||||||
#if defined(RESDIR_DEFINED)
|
|
||||||
#define RESDIR "${RESDIR}"
|
#define RESDIR "${RESDIR}"
|
||||||
#endif
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
if(RESDIR)
|
if(RESDIR_DEFINED)
|
||||||
add_custom_target(copy_resources ALL COMMENT "Copying resources")
|
add_custom_target(copy_resources ALL COMMENT "Copying resources")
|
||||||
|
|
||||||
file(GLOB_RECURSE SHADERS Shaders/*)
|
file(GLOB_RECURSE SHADERS Shaders/*)
|
||||||
|
@ -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}
|
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})
|
${POLY2TRI_COMMON_FILES} ${POLY2TRI_SWEEP_FILES} ${UNZIP_FILES})
|
||||||
set_target_properties(OpenSpades PROPERTIES LINKER_LANGUAGE CXX)
|
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" FILES ${AUDIO_FILES})
|
||||||
source_group("Audio\\AL" FILES ${AUDIO_AL_FILES})
|
source_group("Audio\\AL" FILES ${AUDIO_AL_FILES})
|
||||||
source_group("binpack2d" FILES ${BINPACK_FILES})
|
source_group("binpack2d" FILES ${BINPACK_FILES})
|
||||||
|
@ -111,7 +111,7 @@ int main(int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
SPLog("Log Started.");
|
SPLog("Log Started.");
|
||||||
|
|
||||||
#ifdef RESDIR
|
#if defined(RESDIR_DEFINED)
|
||||||
spades::FileManager::AddFileSystem
|
spades::FileManager::AddFileSystem
|
||||||
(new spades::DirectoryFileSystem(RESDIR, false));
|
(new spades::DirectoryFileSystem(RESDIR, false));
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user