Skip to content

Commit

Permalink
Add hqx as submodule dll
Browse files Browse the repository at this point in the history
Change MSVC build paths
  • Loading branch information
cxong committed Aug 15, 2013
1 parent 7da7009 commit f919f5b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 64 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "src/tests/cbehave"]
path = src/tests/cbehave
url = https://github.com/cxong/cbehave.git
[submodule "src/cdogs/hqx"]
path = src/cdogs/hqx
url = https://github.com/cxong/hqx.git
23 changes: 12 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,16 @@ include_directories(.)

set(CDOGS_DATA_DIR "")
set(CDOGS_CFG_DIR ".cdogs/")
IF(MSVC)
SET(SOURCE_DIRECTORY "${CMAKE_BINARY_DIR}")
SET(OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/cdogs-sdl")
ELSE()
SET(SOURCE_DIRECTORY "..")
SET(OUTPUT_DIRECTORY "../cdogs-sdl")
ENDIF()
# TODO: fix workaround due to path difference
SET(SOURCE_DIRECTORY "..")
SET(OUTPUT_DIRECTORY "../cdogs-sdl")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "..")
IF(UNIX)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "..")
CONFIGURE_FILE(${SOURCE_DIRECTORY}/build/linux/cdogs-sdl.cmake ${SOURCE_DIRECTORY}/build/linux/cdogs-sdl)
ENDIF()
IF(WIN32)
CONFIGURE_FILE(${SOURCE_DIRECTORY}/build/windows/cdogs.rc.cmake ${SOURCE_DIRECTORY}/build/windows/cdogs.rc)
ENDIF()
CONFIGURE_FILE(cdogs/sys_config.h.cmake ${SOURCE_DIRECTORY}/src/cdogs/sys_config.h)
CONFIGURE_FILE(${SOURCE_DIRECTORY}/src/cdogs/sys_config.h.cmake ${SOURCE_DIRECTORY}/src/cdogs/sys_config.h)
CONFIGURE_FILE(${SOURCE_DIRECTORY}/README.md.cmake ${SOURCE_DIRECTORY}/README.md)

add_subdirectory(cdogs)
Expand Down Expand Up @@ -194,7 +188,7 @@ SET(CPACK_PACKAGE_EXECUTABLES "..\\\\cdogs-sdl;C-Dogs SDL")
IF(MSVC)
SET(CPACK_GENERATOR NSIS)
SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
SET(CPACK_RESOURCE_FILE_LICENSE ${SOURCE_DIRECTORY}/doc/COPYING.GPL)
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_DIRECTORY}/doc/COPYING.GPL)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "C-Dogs SDL")
SET(CPACK_NSIS_MUI_ICON ${SOURCE_DIRECTORY}/cdogs-icon.ico)
SET(CPACK_CREATE_DESKTOP_LINKS cdogs-sdl)
Expand All @@ -214,3 +208,10 @@ SET(CDOGS_SDL_EDITOR_HEADERS
charsed.h)
add_executable(cdogs-sdl-editor ${CDOGS_SDL_EDITOR_SOURCES} ${CDOGS_SDL_EDITOR_HEADERS} ${CDOGS_SDL_EXTRA})
target_link_libraries(cdogs-sdl-editor cdogs json hqx ${SDL_LIBRARY} ${SDLMIXER_LIBRARY} ${EXTRA_LIBRARIES})

if(MSVC)
add_custom_command(
TARGET cdogs-sdl
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${SOURCE_DIRECTORY}/src/cdogs/hqx/hqx.dll ${SOURCE_DIRECTORY})
endif()
4 changes: 2 additions & 2 deletions src/cdogs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_subdirectory(hqx)
include_directories(.)
add_subdirectory(hqx/src)
include_directories(hqx/src)

set(CDOGS_SOURCES
actors.c
Expand Down
2 changes: 1 addition & 1 deletion src/cdogs/blit.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <string.h>
#include <math.h>

#include <hqx/hqx.h>
#include <hqx.h>
#include <SDL.h>

#include "config.h"
Expand Down
2 changes: 1 addition & 1 deletion src/cdogs/grafx.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <fcntl.h>
#include <sys/types.h>

#include <hqx/hqx.h>
#include <hqx.h>
#include <SDL_events.h>
#include <SDL_mouse.h>

Expand Down
1 change: 1 addition & 0 deletions src/cdogs/hqx
Submodule hqx added at ce5b24
49 changes: 0 additions & 49 deletions src/cdogs/sys_config.h

This file was deleted.

0 comments on commit f919f5b

Please sign in to comment.