summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-01 21:42:56 +0200
committerAki <please@ignore.pl>2022-04-01 22:21:44 +0200
commit3f320f31fc4f9e90302bd62208a52bfd8d3fd7c2 (patch)
tree234fe74a29b15e37b8dbd40d1d58da9286c6b851
parent3c487c5cd69c53d6fea948643c0a76df03516605 (diff)
downloadstarshatter-3f320f31fc4f9e90302bd62208a52bfd8d3fd7c2.zip
starshatter-3f320f31fc4f9e90302bd62208a52bfd8d3fd7c2.tar.gz
starshatter-3f320f31fc4f9e90302bd62208a52bfd8d3fd7c2.tar.bz2
Separated Main to own module
Intent is to separate headless server and game and make a dedicated executable for each. While this can be done without any directory changes, this is intended to cause as many compilation and linking errors as possible in order to clean them up and refactor general structure of the whole project.
-rw-r--r--CMakeLists.txt1
-rw-r--r--StarsEx/CMakeLists.txt11
-rw-r--r--Starshatter/CMakeLists.txt23
-rw-r--r--Starshatter/Main.cpp (renamed from StarsEx/Main.cpp)0
-rw-r--r--Starshatter/Stars.ico (renamed from StarsEx/Stars.ico)bin2998 -> 2998 bytes
-rw-r--r--Starshatter/Starshatter.rc.conf (renamed from StarsEx/Stars.rc.conf)0
-rw-r--r--Starshatter/resource.h (renamed from StarsEx/resource.h)0
7 files changed, 26 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 008dbe0..d527cac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,4 +21,5 @@ add_subdirectory(FoundationEx)
# add_subdirectory(Magic2) # TODO: AFX/MFC will be useless, port it to e.g., Qt right away.
add_subdirectory(NetEx)
add_subdirectory(StarsEx)
+add_subdirectory(Starshatter)
install(FILES NOTICE COPYING DESTINATION ${CMAKE_INSTALL_PREFIX})
diff --git a/StarsEx/CMakeLists.txt b/StarsEx/CMakeLists.txt
index 6961ad4..b66eb85 100644
--- a/StarsEx/CMakeLists.txt
+++ b/StarsEx/CMakeLists.txt
@@ -1,8 +1,7 @@
project(StarsEx)
include(GitDescribe)
-include(GitToResource)
-add_executable(
- StarsEx WIN32
+add_library(
+ StarsEx STATIC
ActiveWindow.cpp
Archive.cpp
Asteroid.cpp
@@ -126,7 +125,6 @@ add_executable(
Locale_ss.cpp
MCIWave.cpp
MachineInfo.cpp
- Main.cpp
MapView.cpp
Menu.cpp
MenuDlg.cpp
@@ -301,15 +299,11 @@ target_compile_definitions(
PRIVATE _ALLOW_KEYWORD_MACROS
)
git_describe(VERSION)
-git_to_resource(RC_VERSION ${VERSION})
-configure_file(Stars.rc.conf ${CMAKE_CURRENT_BINARY_DIR}/Stars.rc @ONLY)
configure_file(VersionInfo.cpp.conf ${CMAKE_CURRENT_BINARY_DIR}/VersionInfo.cpp @ONLY)
target_sources(
StarsEx
- PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/Stars.rc
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/VersionInfo.cpp
)
-set_target_properties(StarsEx PROPERTIES OUTPUT_NAME Starshatter)
if(MSVC)
target_include_directories(
StarsEx
@@ -345,4 +339,3 @@ else()
PUBLIC -l:libdxguid.a
)
endif()
-install(TARGETS StarsEx RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
diff --git a/Starshatter/CMakeLists.txt b/Starshatter/CMakeLists.txt
new file mode 100644
index 0000000..9623f9a
--- /dev/null
+++ b/Starshatter/CMakeLists.txt
@@ -0,0 +1,23 @@
+project(Starshatter)
+include(GitDescribe)
+include(GitToResource)
+add_executable(
+ Starshatter WIN32
+ Main.cpp
+ )
+target_include_directories(
+ Starshatter
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+target_link_libraries(
+ Starshatter
+ PRIVATE StarsEx
+ )
+git_describe(VERSION)
+git_to_resource(RC_VERSION ${VERSION})
+configure_file(Starshatter.rc.conf ${CMAKE_CURRENT_BINARY_DIR}/Starshatter.rc @ONLY)
+target_sources(
+ Starshatter
+ PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/Starshatter.rc
+ )
+install(TARGETS Starshatter RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
diff --git a/StarsEx/Main.cpp b/Starshatter/Main.cpp
index a71476d..a71476d 100644
--- a/StarsEx/Main.cpp
+++ b/Starshatter/Main.cpp
diff --git a/StarsEx/Stars.ico b/Starshatter/Stars.ico
index 69980ca..69980ca 100644
--- a/StarsEx/Stars.ico
+++ b/Starshatter/Stars.ico
Binary files differ
diff --git a/StarsEx/Stars.rc.conf b/Starshatter/Starshatter.rc.conf
index 45479d3..45479d3 100644
--- a/StarsEx/Stars.rc.conf
+++ b/Starshatter/Starshatter.rc.conf
diff --git a/StarsEx/resource.h b/Starshatter/resource.h
index 4dd9864..4dd9864 100644
--- a/StarsEx/resource.h
+++ b/Starshatter/resource.h