This repository has been archived by the owner on Sep 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#6) Added CMakeLists.txt for all targets
Added CMakeLists.txt build rules to `src/common`, `src/capi` and `src/main`. Added build rules for creating static library targets for FalloutNV, Oblivion and Skyrim to folder `src/game/<game>` . Added a fake intermediate library `src/game` that serves as a quick referral for adding dependences to the three implemented games indirectly. For this I required to add a dummy empty `game.cpp` file as CMake doesn't accept libraries with no source code. Also adjusted pre-existing CMakeLists.txt for the new folder structure and static libraries usage.
- Loading branch information
Showing
10 changed files
with
246 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Settings passed on the command line: | ||
# | ||
# CBash_BUILD_SHARED_LIBS | ||
# CBash_USE_STATIC_RUNTIME | ||
# CBash_NO_BOOST_ZLIB | ||
|
||
############################## | ||
# General Settings | ||
############################## | ||
|
||
|
||
file (GLOB_RECURSE CBASH_HEADERS "${CBASH_INCLUDE}/*.h" ) | ||
|
||
list(APPEND CBASH_HEADERS | ||
"Version.h" | ||
"resource.h" | ||
) | ||
|
||
set (CBASH_SOURCES | ||
"CBash.cpp" | ||
"CBash.rc" | ||
) | ||
|
||
|
||
# Include source and library directories. | ||
include_directories (${CBASH_INCLUDE} ${CBASH_SOURCE} ${Boost_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) | ||
|
||
############################## | ||
# Actual Building | ||
############################## | ||
|
||
# Build CBash. | ||
add_library (CBash ${CBASH_SOURCES} ${CBASH_HEADERS} ${CBASH_GEN_HDRS}) | ||
target_link_libraries (CBash ${Boost_LIBRARIES} ${CBASH_LIBS} libcommon libgame libmain) | ||
|
||
|
||
# Always write the output file directly into the 'tests' directory (even on MSVC) | ||
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) | ||
set_target_properties(CBash PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CBASH_RELEASE}) | ||
set_target_properties(CBash PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CBASH_RELEASE}) | ||
foreach(config ${CMAKE_CONFIGURATION_TYPES}) | ||
string(TOUPPER ${config} config) | ||
set_target_properties(CBash PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${config} ${CBASH_RELEASE}) | ||
set_target_properties(CBash PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${config} ${CBASH_RELEASE}) | ||
endforeach() | ||
endif() | ||
|
||
cotire(CBash) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
# Include source and library directories. | ||
# include_directories (${CBASH_INCLUDE} | ||
# ${Boost_INCLUDE_DIRS} | ||
# ${ZLIB_INCLUDE_DIR}) | ||
|
||
set (COMMON_HEADERS | ||
"Allocator.h" | ||
"Common.h" | ||
"GenericChunks.h" | ||
"GenericRecord.h" | ||
"MacroDefinitions.h" | ||
"ModFile.h" | ||
"TES4Record.h" | ||
) | ||
|
||
set (COMMON_SOURCES | ||
|
||
"Common.cpp" | ||
"GenericChunks.cpp" | ||
"GenericRecord.cpp" | ||
"ModFile.cpp" | ||
"TES4Record.cpp" | ||
"TES4RecordAPI.cpp" | ||
) | ||
|
||
include_directories (${CBASH_INCLUDE} ${Boost_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) | ||
|
||
add_library(libcommon STATIC ${COMMON_HEADERS} ${COMMON_SOURCES}) | ||
|
||
cotire(libcommon) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
add_subdirectory(Oblivion) | ||
add_subdirectory(Skyrim) | ||
add_subdirectory(FalloutNewVegas) | ||
|
||
|
||
add_library(libgame STATIC game.cpp) | ||
target_link_libraries(libgame libgame_oblivion libgame_skyrim libgame_falloutnv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
# Include source and library directories. | ||
# include_directories (${CBASH_INCLUDE} | ||
# ${Boost_INCLUDE_DIRS} | ||
# ${ZLIB_INCLUDE_DIR}) | ||
|
||
|
||
file (GLOB_RECURSE FALLOUTNV_RECORD_HEADERS "Records/*.h" ) | ||
file (GLOB_RECURSE FALLOUTNV_RECORD_SOURCES "Records/*.cpp" ) | ||
file (GLOB_RECURSE FALLOUTNV_RECORD_API "Records/API/*.cpp" ) | ||
|
||
set (FALLOUTNV_HEADERS | ||
|
||
"GRUPRecord.h" | ||
"FNVFile.h" | ||
"FNVRecord.h" | ||
${FALLOUTNV_RECORD_HEADERS} | ||
) | ||
|
||
set (FALLOUTNV_SOURCES | ||
|
||
"FNVFile.cpp" | ||
"FNVRecord.cpp" | ||
${FALLOUTNV_RECORD_SOURCES} | ||
${FALLOUTNV_RECORD_API} | ||
) | ||
|
||
add_library(libgame_falloutnv STATIC ${FALLOUTNV_HEADERS} ${FALLOUTNV_SOURCES}) | ||
target_link_libraries (libgame_falloutnv ${Boost_LIBRARIES} ${CBASH_LIBS} libcommon) | ||
|
||
cotire(libgame_falloutnv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
# Include source and library directories. | ||
# include_directories (${CBASH_INCLUDE} | ||
# ${Boost_INCLUDE_DIRS} | ||
# ${ZLIB_INCLUDE_DIR}) | ||
|
||
|
||
file (GLOB_RECURSE OBLIVION_RECORD_HEADERS "Records/*.h" ) | ||
file (GLOB_RECURSE OBLIVION_RECORD_SOURCES "Records/*.cpp" ) | ||
file (GLOB_RECURSE OBLIVION_RECORD_API "Records/API/*.cpp" ) | ||
|
||
set (OBLIVION_HEADERS | ||
|
||
"GRUPRecord.h" | ||
"TES4File.h" | ||
${OBLIVION_RECORD_HEADERS} | ||
) | ||
|
||
set (OBLIVION_SOURCES | ||
|
||
"TES4File.cpp" | ||
${OBLIVION_RECORD_SOURCES} | ||
${OBLIVION_RECORD_API} | ||
) | ||
|
||
|
||
add_library(libgame_oblivion STATIC ${OBLIVION_HEADERS} ${OBLIVION_SOURCES}) | ||
target_link_libraries (libgame_oblivion ${Boost_LIBRARIES} ${CBASH_LIBS} libcommon) | ||
|
||
cotire(libgame_oblivion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
# Include source and library directories. | ||
# include_directories (${CBASH_INCLUDE} | ||
# ${Boost_INCLUDE_DIRS} | ||
# ${ZLIB_INCLUDE_DIR}) | ||
|
||
|
||
file (GLOB SKYRIM_RECORD_HEADERS "Records/*.h" ) | ||
file (GLOB SKYRIM_RECORD_SOURCES "Records/*.cpp" ) | ||
|
||
file (GLOB_RECURSE SKYRIM_VMAD_HEADERS "VMAD/*.h" ) | ||
file (GLOB_RECURSE SKYRIM_VMAD_SOURCES "VMAD/*.cpp" ) | ||
|
||
file (GLOB SKYRIM_RECORD_API "Records/API/*.cpp" ) | ||
|
||
set (SKYRIM_HEADERS | ||
|
||
"GRUPRecord.h" | ||
"SkyrimCommon.h" | ||
"SkyrimChunks.h" | ||
"TES5ModFile.h" | ||
"TES5Record.h" | ||
"TES5File.h" | ||
|
||
${SKYRIM_VMAD_HEADERS} | ||
${SKYRIM_RECORD_HEADERS} | ||
) | ||
|
||
set (SKYRIM_SOURCES | ||
|
||
"SkyrimChunks.cpp" | ||
"SkyrimCommon.cpp" | ||
"TES5File.cpp" | ||
"TES5Record.cpp" | ||
|
||
${SKYRIM_VMAD_SOURCES} | ||
${SKYRIM_RECORD_SOURCES} | ||
${SKYRIM_RECORD_API} | ||
) | ||
|
||
add_library(libgame_skyrim STATIC ${SKYRIM_HEADERS} ${SKYRIM_SOURCES}) | ||
target_link_libraries (libgame_skyrim ${Boost_LIBRARIES} ${CBASH_LIBS} libcommon) | ||
|
||
cotire(libgame_skyrim) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Settings passed on the command line: | ||
# | ||
# CBash_BUILD_SHARED_LIBS | ||
# CBash_USE_STATIC_RUNTIME | ||
# CBash_NO_BOOST_ZLIB | ||
|
||
############################## | ||
# General Settings | ||
############################## | ||
|
||
|
||
|
||
set(CBASH_HEADERS | ||
"Collection.h" | ||
"Visitors.h" | ||
) | ||
|
||
set (CBASH_SOURCES | ||
"Collection.cpp" | ||
"Visitors.cpp" | ||
) | ||
|
||
############################## | ||
# Actual Building | ||
############################## | ||
|
||
include_directories ( | ||
${CBASH_SOURCE}/game | ||
) | ||
|
||
# Build CBash. | ||
add_library (libmain STATIC ${CBASH_HEADERS} ${CBASH_SOURCES}) | ||
target_link_libraries (libmain libcommon libgame) | ||
|
||
|
||
cotire(libmain) | ||
|