summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt12
-rw-r--r--src/CMakeLists.txt13
-rw-r--r--test/envs/opengl/CMakeLists.txt13
-rw-r--r--test/unit/CMakeLists.txt10
-rw-r--r--test/unit/ui/CMakeLists.txt5
5 files changed, 19 insertions, 34 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ca364e..7ee21cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,12 +45,18 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
set(PLATFORM_LINUX 0)
set(PLATFORM_MACOSX 0)
set(PLATFORM_OTHER 0)
+
+ # Platform-dependent implementation of system.h
+ set(SYSTEM_CPP_MODULE "system_windows.cpp")
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
message(STATUS "Build for Linux system")
set(PLATFORM_WINDOWS 0)
set(PLATFORM_LINUX 1)
set(PLATFORM_MACOSX 0)
set(PLATFORM_OTHER 0)
+
+ # Platform-dependent implementation of system.h
+ set(SYSTEM_CPP_MODULE "system_linux.cpp")
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
message(STATUS "Build for Mac OSX system")
set(PLATFORM_WINDOWS 0)
@@ -58,6 +64,9 @@ elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
set(PLATFORM_MACOSX 1)
set(PLATFORM_OTHER 0)
+ # Platform-dependent implementation of system.h
+ set(SYSTEM_CPP_MODULE "system_macosx.cpp")
+
set(USE_SDL_MAIN 1) # fixes SDL_main
else()
message(STATUS "Build for other system")
@@ -65,6 +74,9 @@ else()
set(PLATFORM_LINUX 0)
set(PLATFORM_MACOSX 0)
set(PLATFORM_OTHER 1)
+
+ # Platform-dependent implementation of system.h
+ set(SYSTEM_CPP_MODULE "system_other.cpp")
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 958f86c..ef59973 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -56,24 +56,13 @@ if(PLATFORM_WINDOWS)
set(RES_FILES "../desktop/colobot.rc")
endif()
-# Platform-dependent implementation of system.h
-if(PLATFORM_WINDOWS)
- set(SYSTEM_CPP_MODULE "system_windows.cpp")
-elseif(PLATFORM_LINUX)
- set(SYSTEM_CPP_MODULE "system_linux.cpp")
-elseif(PLATFORM_MACOSX)
- set(SYSTEM_CPP_MODULE "system_macosx.cpp")
- set(SYSTEM_CPP_MODULE ${SYSTEM_CPP_MODULE} "app/system_other.cpp")
-else()
- set(SYSTEM_CPP_MODULE "system_other.cpp")
-endif()
-
# Source files
set(SOURCES
app/app.cpp
app/main.cpp
app/system.cpp
app/${SYSTEM_CPP_MODULE}
+app/system_other.cpp
common/event.cpp
common/image.cpp
common/iman.cpp
diff --git a/test/envs/opengl/CMakeLists.txt b/test/envs/opengl/CMakeLists.txt
index 2855318..a78962c 100644
--- a/test/envs/opengl/CMakeLists.txt
+++ b/test/envs/opengl/CMakeLists.txt
@@ -2,15 +2,6 @@ set(SRC_DIR ${colobot_SOURCE_DIR}/src)
configure_file(${SRC_DIR}/common/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/common/config.h)
-# Platform-dependent implementation of system.h
-if(PLATFORM_WINDOWS)
- set(SYSTEM_CPP_MODULE "system_windows.cpp")
-elseif(PLATFORM_LINUX)
- set(SYSTEM_CPP_MODULE "system_linux.cpp")
-else()
- set(SYSTEM_CPP_MODULE "system_other.cpp")
-endif()
-
set(TEXTURE_SOURCES
${SRC_DIR}/graphics/core/color.cpp
${SRC_DIR}/graphics/opengl/gldevice.cpp
@@ -28,6 +19,7 @@ ${SRC_DIR}/common/image.cpp
${SRC_DIR}/common/stringutils.cpp
${SRC_DIR}/app/system.cpp
${SRC_DIR}/app/${SYSTEM_CPP_MODULE}
+${SRC_DIR}/app/system_other.cpp
model_test.cpp
)
@@ -38,6 +30,7 @@ ${SRC_DIR}/common/logger.cpp
${SRC_DIR}/common/image.cpp
${SRC_DIR}/app/system.cpp
${SRC_DIR}/app/${SYSTEM_CPP_MODULE}
+${SRC_DIR}/app/system_other.cpp
transform_test.cpp
)
@@ -48,6 +41,7 @@ ${SRC_DIR}/common/logger.cpp
${SRC_DIR}/common/image.cpp
${SRC_DIR}/app/system.cpp
${SRC_DIR}/app/${SYSTEM_CPP_MODULE}
+${SRC_DIR}/app/system_other.cpp
light_test.cpp
)
@@ -68,6 +62,7 @@ ${SDLIMAGE_LIBRARY}
${OPENGL_LIBRARY}
${GLEW_LIBRARY}
${PNG_LIBRARIES}
+${Boost_LIBRARIES}
)
add_executable(texture_test ${TEXTURE_SOURCES})
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 1f5e1bc..38bffda 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -18,20 +18,12 @@ endif()
# Configure file
configure_file(${SRC_DIR}/common/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/common/config.h)
-# Platform-dependent implementation of system.h
-if(PLATFORM_WINDOWS)
- set(SYSTEM_CPP_MODULE "system_windows.cpp")
-elseif(PLATFORM_LINUX)
- set(SYSTEM_CPP_MODULE "system_linux.cpp")
-else()
- set(SYSTEM_CPP_MODULE "system_other.cpp")
-endif()
-
# Code sources
set(COLOBOT_SOURCES
${SRC_DIR}/app/app.cpp
${SRC_DIR}/app/system.cpp
${SRC_DIR}/app/${SYSTEM_CPP_MODULE}
+${SRC_DIR}/app/system_other.cpp
${SRC_DIR}/common/event.cpp
${SRC_DIR}/common/image.cpp
${SRC_DIR}/common/iman.cpp
diff --git a/test/unit/ui/CMakeLists.txt b/test/unit/ui/CMakeLists.txt
index 97dd681..8086967 100644
--- a/test/unit/ui/CMakeLists.txt
+++ b/test/unit/ui/CMakeLists.txt
@@ -10,21 +10,18 @@ ${CLIPBOARD_INCLUDE_DIR}
# Platform-dependent implementation of CSystemUtils
if(PLATFORM_WINDOWS)
- set(SYSTEM_CPP_MODULE "system_windows.cpp")
elseif(PLATFORM_LINUX)
- set(SYSTEM_CPP_MODULE "system_linux.cpp")
set(ADDITIONAL_LIB "-lX11")
elseif(PLATFORM_MACOSX)
- set(SYSTEM_CPP_MODULE "system_other.cpp")
set(ADDITIONAL_LIB "${X11_X11_LIB}")
else()
- set(SYSTEM_CPP_MODULE "system_other.cpp")
set(ADDITIONAL_LIB "-lX11")
endif()
add_executable(edit_test
${SRC_DIR}/app/system.cpp
${SRC_DIR}/app/${SYSTEM_CPP_MODULE}
+${SRC_DIR}/app/system_other.cpp
${SRC_DIR}/common/event.cpp
${SRC_DIR}/common/logger.cpp
${SRC_DIR}/common/misc.cpp