Skip to content

Commit

Permalink
+ Public include directories moved to "include" directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladislav Zezula committed Nov 6, 2016
1 parent 3849673 commit 3c8cc59
Show file tree
Hide file tree
Showing 17 changed files with 81 additions and 66 deletions.
75 changes: 36 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
project(StormLib)
cmake_minimum_required(VERSION 2.6)

include_directories(include)

set(LIBRARY_NAME storm)

set(SRC_FILES
Expand Down Expand Up @@ -301,16 +303,16 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL Linux)
endif()
endif()

option(BUILD_SHARED_LIBS "Compile shared libraries" OFF)

add_library(${LIBRARY_NAME} ${SRC_FILES} ${SRC_ADDITIONAL_FILES})
target_link_libraries(${LIBRARY_NAME} ${LINK_LIBS})
target_compile_definitions(${LIBRARY_NAME} PUBLIC -D__STORMLIB_NO_AUTO_LINK__) #CMake should take care of the linking
target_include_directories(${LIBRARY_NAME} PUBLIC include/)
set_target_properties(${LIBRARY_NAME} PROPERTIES PUBLIC_HEADER "include/StormLib.h;include/StormPort.h")
if(BUILD_SHARED_LIBS)
option(WITH_STATIC "Compile static linked library" OFF)
if(WITH_STATIC)
add_library(${LIBRARY_NAME} STATIC ${SRC_FILES} ${SRC_ADDITIONAL_FILES})
target_link_libraries(${LIBRARY_NAME} ${LINK_LIBS})
else()
add_library(${LIBRARY_NAME} SHARED ${SRC_FILES} ${SRC_ADDITIONAL_FILES})
target_link_libraries(${LIBRARY_NAME} ${LINK_LIBS})
if(APPLE)
set_target_properties(${LIBRARY_NAME} PROPERTIES FRAMEWORK true)
set_target_properties(${LIBRARY_NAME} PROPERTIES PUBLIC_HEADER "include/StormLib.h include/StormPort.h")
set_target_properties(${LIBRARY_NAME} PROPERTIES LINK_FLAGS "-framework Carbon")
endif()
if(UNIX)
Expand All @@ -326,42 +328,37 @@ if(BUILD_SHARED_LIBS)
if(WIN32)
set_target_properties(${LIBRARY_NAME} PROPERTIES OUTPUT_NAME StormLib)
endif()
endif()
install(TARGETS ${LIBRARY_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
FRAMEWORK DESTINATION /Library/Frameworks
PUBLIC_HEADER DESTINATION include
INCLUDES DESTINATION include)

#CPack configurtion
SET(CPACK_GENERATOR "DEB" "RPM")
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MPQ manipulation library")
SET(CPACK_PACKAGE_VENDOR "Ladislav Zezula")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}")
install(TARGETS ${LIBRARY_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib FRAMEWORK DESTINATION /Library/Frameworks)

#DEB configuration
SET(CPACK_DEBIAN_PACKAGE_SECTION "libs")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.zezula.net/en/mpq/stormlib.html")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "[email protected]")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "zlib1g,bzip2")
#CPack configurtion
SET(CPACK_GENERATOR "DEB" "RPM")
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MPQ manipulation library")
SET(CPACK_PACKAGE_VENDOR "Ladislav Zezula")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}")

#RPM configuration
SET(CPACK_RPM_PACKAGE_RELEASE 1)
SET(CPACK_RPM_PACKAGE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
SET(CPACK_RPM_PACKAGE_GROUP "${PROJECT_NAME}")
SET(CPACK_RPM_PACKAGE_URL "http://www.zezula.net/en/mpq/stormlib.html")
SET(CPACK_RPM_PACKAGE_REQUIRES "zlib,bzip2")
#DEB configuration
SET(CPACK_DEBIAN_PACKAGE_SECTION "libs")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.zezula.net/en/mpq/stormlib.html")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "[email protected]")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "zlib1g,bzip2")

INCLUDE(CPack)
#RPM configuration
SET(CPACK_RPM_PACKAGE_RELEASE 1)
SET(CPACK_RPM_PACKAGE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
SET(CPACK_RPM_PACKAGE_GROUP "${PROJECT_NAME}")
SET(CPACK_RPM_PACKAGE_URL "http://www.zezula.net/en/mpq/stormlib.html")
SET(CPACK_RPM_PACKAGE_REQUIRES "zlib,bzip2")

INCLUDE(CPack)

endif()

option(WITH_TEST "Compile Test application" OFF)
if(WITH_TEST)
Expand Down
4 changes: 2 additions & 2 deletions StormLib.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ rem Example: StormLib.bat x64 Debug

if not exist ..\aaa goto exit

copy src\StormPort.h ..\aaa\inc
copy src\StormLib.h ..\aaa\inc
copy include\StormPort.h ..\aaa\inc
copy include\StormLib.h ..\aaa\inc

if x%1 == xWin32 goto PlatformWin32
if x%1 == xx64 goto PlatformWin64
Expand Down
4 changes: 4 additions & 0 deletions StormLib_dll.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -120,6 +121,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -195,6 +197,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
Expand Down Expand Up @@ -271,6 +274,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
Expand Down
8 changes: 4 additions & 4 deletions StormLib_test.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="./src/libtomcrypt/src/headers"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__STORMLIB_TEST__;__STORMLIB_DUMP_DATA__"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -130,7 +130,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="./src/libtomcrypt/src/headers"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__STORMLIB_TEST__"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -208,7 +208,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="./src/libtomcrypt/src/headers"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__STORMLIB_TEST__"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
Expand Down Expand Up @@ -286,7 +286,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="./src/libtomcrypt/src/headers"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__STORMLIB_TEST__"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
Expand Down
16 changes: 16 additions & 0 deletions StormLib_vs08.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -108,6 +109,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -171,6 +173,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -235,6 +238,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -299,6 +303,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Expand Down Expand Up @@ -362,6 +367,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Expand Down Expand Up @@ -424,6 +430,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
Expand Down Expand Up @@ -487,6 +494,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
Expand Down Expand Up @@ -548,6 +556,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -612,6 +621,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -675,6 +685,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -739,6 +750,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -803,6 +815,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Expand Down Expand Up @@ -866,6 +879,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Expand Down Expand Up @@ -928,6 +942,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
Expand Down Expand Up @@ -991,6 +1006,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
Expand Down
2 changes: 1 addition & 1 deletion src/SBaseDumpData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/* 26.01.11 1.00 Lad The first version of SBaseDumpData.cpp */
/*****************************************************************************/

#define __STORMLIB_SELF__
#define __STORMLIB_NO_AUTO_LINK__
#include <StormLib.h>
#include "StormCommon.h"

Expand Down
3 changes: 2 additions & 1 deletion src/adpcm/adpcm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
/* 10.01.13 3.00 Lad Refactored, beautified, documented :-) */
/*****************************************************************************/

#include <StormPort.h>
#include <stddef.h>

#include "adpcm.h"

//-----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion src/huffman/huff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <assert.h>
#include <string.h>

#include <StormPort.h>
#include "huff.h"

//-----------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions src/libtomcrypt/src/headers/tomcrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ extern "C" {
/* descriptor table size */
#define TAB_SIZE 32

#ifdef _MSC_VER
#pragma warning(disable: 4333) // der_encode_utf8_string.c(91) : warning C4333: '>>' : right shift by too large amount, data loss
#endif

/* error codes [will be expanded in future releases] */
enum {
CRYPT_OK=0, /* Result OK */
Expand Down
2 changes: 1 addition & 1 deletion src/libtomcrypt/src/pk/asn1/der_encode_setof.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen,
}

/* get the size of the static header */
hdrlen = ((unsigned long)ptr) - ((unsigned long)buf);
hdrlen = (unsigned long)((size_t)ptr - (size_t)buf);


/* scan for edges */
Expand Down
2 changes: 0 additions & 2 deletions src/pklib/pklib.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#ifndef __PKLIB_H__
#define __PKLIB_H__

#include <StormPort.h>

//-----------------------------------------------------------------------------
// Defines

Expand Down
2 changes: 0 additions & 2 deletions src/sparse/sparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#ifndef __SPARSE_H__
#define __SPARSE_H__

#include <StormPort.h>

void CompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer);
int DecompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer);

Expand Down
Loading

0 comments on commit 3c8cc59

Please sign in to comment.