diff --git a/CMakeLists.txt b/CMakeLists.txt index 12820127..f0d67354 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ # Settings passed on the command line: # -# LIBSTR_LIBS_DIR = the directory which all external libraries may be referenced from. -# LIBSTR_ARCH = the build architecture -# LIBSTR_LINK = whether to build a static or dynamic library. +# PROJECT_LIBS_DIR = the directory which all external libraries may be referenced from. +# PROJECT_ARCH = the build architecture +# PROJECT_LINK = whether to build a static or dynamic library. ############################## # General Settings @@ -14,7 +14,8 @@ project (boss) set (BOSS_SRC "${CMAKE_SOURCE_DIR}/src/metadata.cpp" "${CMAKE_SOURCE_DIR}/src/game.cpp" "${CMAKE_SOURCE_DIR}/src/helpers.cpp" "${CMAKE_SOURCE_DIR}/src/plugin/ModFormat.cpp" "${CMAKE_SOURCE_DIR}/src/plugin/VersionRegex.cpp") # Include source and library directories. -include_directories ("${BOSS_LIBS_DIR}/alphanum" "${BOSS_LIBS_DIR}/utf8" "${BOSS_LIBS_DIR}/boost" "${BOSS_LIBS_DIR}/yaml-cpp/include" "${CMAKE_SOURCE_DIR}/src" "${BOSS_LIBS_DIR}/libloadorder/src") +include_directories ("${PROJECT_LIBS_DIR}/alphanum" "${PROJECT_LIBS_DIR}/utf8" "${PROJECT_LIBS_DIR}/boost" "${PROJECT_LIBS_DIR}/yaml-cpp/include" "${CMAKE_SOURCE_DIR}/src" "${PROJECT_LIBS_DIR}/libloadorder/src") + ############################## # Platform-Specific Settings @@ -22,35 +23,43 @@ include_directories ("${BOSS_LIBS_DIR}/alphanum" "${BOSS_LIBS_DIR}/utf8" "${BOSS # Settings when compiling for Windows. IF (CMAKE_SYSTEM_NAME MATCHES "Windows") - #IF (${BOSS_LINK} MATCHES "STATIC") - # add_definitions (-DBOSS_STATIC) - #ELSE () - # add_definitions (-DBOSS_EXPORT) - #ENDIF () + IF (${PROJECT_LINK} MATCHES "STATIC") + add_definitions (-DLIBLO_STATIC) + add_definitions (-DBOSS_STATIC) + ELSE () + add_definitions (-DLIBLO_STATIC) + add_definitions (-DBOSS_EXPORT) + ENDIF () ENDIF () -# Settings when compiling on Windows. -IF (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") - #set (BOSS_LIBS libboost_filesystem-vc110-mt-1_52 libboost_system-vc110-mt-1_52) - set (CMAKE_CXX_FLAGS "/EHsc") +# Settings when not cross-compiling. +IF (CMAKE_SYSTEM_NAME MATCHES CMAKE_HOST_SYSTEM_NAME) + link_directories ("${PROJECT_LIBS_DIR}/boost/stage-${PROJECT_ARCH}/lib") ENDIF () +link_directories ("${PROJECT_LIBS_DIR}/yaml-cpp/build") +link_directories ("${PROJECT_LIBS_DIR}/libloadorder/build") + # Settings when compiling and cross-compiling on Linux. IF (CMAKE_HOST_SYSTEM_NAME MATCHES "Linux") - set (BOSS_LIBS loadorder yaml-cpp boost_filesystem boost_system boost_regex) - set (CMAKE_C_FLAGS "-m${BOSS_ARCH}") - set (CMAKE_CXX_FLAGS "-m${BOSS_ARCH}") + set (CMAKE_C_FLAGS "-m${PROJECT_ARCH}") + set (CMAKE_CXX_FLAGS "-m${PROJECT_ARCH}") set (CMAKE_EXE_LINKER_FLAGS "-static-libstdc++ -static-libgcc") set (CMAKE_SHARED_LINKER_FLAGS "-static-libstdc++ -static-libgcc") set (CMAKE_MODULE_LINKER_FLAGS "-static-libstdc++ -static-libgcc") - link_directories ("${BOSS_LIBS_DIR}/yaml-cpp/build") - link_directories ("${BOSS_LIBS_DIR}/libloadorder/build") - link_directories ("${BOSS_LIBS_DIR}/boost/stage-${BOSS_ARCH}/lib") - IF (CMAKE_SYSTEM_NAME MATCHES "Windows") - link_directories ("${BOSS_LIBS_DIR}/boost/stage-mingw-${BOSS_ARCH}/lib") + link_directories ("${PROJECT_LIBS_DIR}/boost/stage-mingw-${PROJECT_ARCH}/lib") + set (BOSS_LIBS version) ENDIF () + + set (BOSS_LIBS ${BOSS_LIBS} loadorder yaml-cpp boost_filesystem boost_system boost_regex) +ENDIF () + +# Settings when compiling on Windows. +IF (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") + set (BOSS_LIBS loadorder yaml-cpp libboost_filesystem-vc110-mt-1_52 libboost_system-vc110-mt-1_52) + set (CMAKE_CXX_FLAGS "/EHsc") ENDIF () ############################## @@ -58,7 +67,7 @@ ENDIF () ############################## # Build API. -add_library (boss "${CMAKE_SOURCE_DIR}/src/api.cpp" ${BOSS_SRC}) +add_library (boss ${PROJECT_LINK} "${CMAKE_SOURCE_DIR}/src/api.cpp" ${BOSS_SRC}) target_link_libraries (boss ${BOSS_LIBS}) # Build tester. diff --git a/docs/BOSS API Readme.html b/docs/BOSS API Readme.html index 486f99d8..b05fc890 100644 --- a/docs/BOSS API Readme.html +++ b/docs/BOSS API Readme.html @@ -69,7 +69,7 @@ h3{ -->
The API uses character strings and unsigned integers for data input/output.
The API also provides two new structures:
typedef struct _boss_db_int * boss_db;
@@ -158,20 +158,20 @@ This documentation is a work in progress, covering an API that is also still a w
unsigned int boss_get_error_message (char ** message);
Outputs a string detailing the last error encountered.
void boss_cleanup ();
Frees the memory allocated to the error message string, if boss_get_error_message has been called.
bool boss_is_compatible (const unsigned int versionMajor,
const unsigned int versionMinor,
const unsigned int versionPatch);
@@ -182,7 +182,7 @@ This documentation is a work in progress, covering an API that is also still a w
unsigned int boss_get_version (unsigned int * versionMajor,
unsigned int * versionMinor,
unsigned int * versionPatch);
@@ -195,7 +195,7 @@ This documentation is a work in progress, covering an API that is also still a w
unsigned int boss_create_db (boss_db * db,
const unsigned int clientGame,
const char * gamePath);
@@ -206,7 +206,7 @@ This documentation is a work in progress, covering an API that is also still a w
null. If null, then the API will attempt to detect the game folder location itself using the game's registry entries.
void boss_destroy_db (boss_db db);
Destroys the given database, freeing any memory allocated during its use.
unsigned int boss_load_lists (boss_db db,
const char * masterlistPath,
const char * userlistPath);
@@ -226,7 +226,7 @@ This documentation is a work in progress, covering an API that is also still a w
null. If null, no userlist will be loaded.
unsigned int boss_eval_lists (boss_db db);
Refreshes the active plugin list used during evaluation then evaluates all conditional and regular expression metadata entries. Repeated calls re-evaluate the metadata from scratch. This function affects the output of all the database access functions.
unsigned int boss_get_tag_map (boss_db db,
char *** tagMap,
size_t * numTags);
@@ -246,7 +246,7 @@ This documentation is a work in progress, covering an API that is also still a w
0 if tagMap is null.