Changed build system to CMake
This commit is contained in:
parent
2bd8605711
commit
f6a02dc850
@ -9,6 +9,8 @@
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
@ -16,7 +18,7 @@
|
||||
<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1767279125." name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.263074825" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
|
||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.361182110" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
|
||||
<builder autoBuildTarget="" buildPath="${workspace_loc:/Farmlands}/Debug" cleanBuildTarget="" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="org.eclipse.cdt.build.core.internal.builder.1184678368" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="org.eclipse.cdt.build.core.internal.builder"/>
|
||||
<builder arguments="-C ${workspace_loc:/Farmlands}/build/Debug" autoBuildTarget="" buildPath="${workspace_loc:/Farmlands}/Debug" cleanBuildTarget="clean" command="make" id="cdt.managedbuild.target.gnu.builder.exe.debug.1757627442" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1607221000" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
|
||||
<tool command="g++" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1808198807" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
|
||||
<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.593370343" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
||||
@ -83,6 +85,8 @@
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
@ -90,7 +94,7 @@
|
||||
<folderInfo id="cdt.managedbuild.config.gnu.exe.release.1609929883." name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.2003855563" name="Linux GCC" nonInternalBuilderId="cdt.managedbuild.target.gnu.builder.exe.release" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
|
||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.2010013881" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
|
||||
<builder autoBuildTarget="all" buildPath="${workspace_loc:/Farmlands}/Release" cleanBuildTarget="clean" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="org.eclipse.cdt.build.core.internal.builder.2098680958" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.internal.builder"/>
|
||||
<builder arguments="-C ${workspace_loc:/Farmlands}/build/Release" buildPath="${workspace_loc:/Farmlands}/Release" cleanBuildTarget="clean" command="make" id="cdt.managedbuild.target.gnu.builder.exe.release.11977805" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1727165317" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1249722811" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
|
||||
<option id="gnu.cpp.compiler.exe.release.option.optimization.level.1342166702" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
|
||||
|
11
.externalToolBuilders/CMake Project Generator.launch
Normal file
11
.externalToolBuilders/CMake Project Generator.launch
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
|
||||
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> <resources> <item path="/Farmlands/build/Debug" type="2"/> <item path="/Farmlands/build/Release" type="2"/> </resources>}"/>
|
||||
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> <resources> <item path="/Farmlands/CMakeLists.txt" type="1"/> </resources>}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/usr/bin/cmake"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-DCMAKE_BUILD_TYPE=${config_name:Farmlands} ../.."/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc}/Farmlands/build/${config_name:Farmlands}"/>
|
||||
</launchConfiguration>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
|
||||
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
|
||||
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="true"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/Farmlands/build/prepareAssets.py}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="incremental,"/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Farmlands}"/>
|
||||
</launchConfiguration>
|
6
.project
6
.project
@ -16,11 +16,7 @@
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>LaunchConfigHandle</key>
|
||||
<value><project>/.externalToolBuilders/Prepare Assets.launch</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>incclean</key>
|
||||
<value>true</value>
|
||||
<value><project>/.externalToolBuilders/CMake Project Generator.launch</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
|
BIN
.sconsign.dblite
Normal file
BIN
.sconsign.dblite
Normal file
Binary file not shown.
35
CMakeLists.txt
Normal file
35
CMakeLists.txt
Normal file
@ -0,0 +1,35 @@
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
project (Farmlands)
|
||||
|
||||
set (SRC_DIR "src")
|
||||
set (ASSET_DIR "assets")
|
||||
set (BUILD_DIR "build")
|
||||
set (LIBS "SDL2" "SDL2_image" "SDL2_ttf" "boost_filesystem" "boost_system")
|
||||
set (TARGET "Farmlands")
|
||||
|
||||
file (GLOB_RECURSE FILES_CPP "${SRC_DIR}/*.cpp")
|
||||
file (GLOB_RECURSE FILES_ASSETS "${ASSET_DIR}/*")
|
||||
|
||||
add_executable(${TARGET} ${FILES_CPP})
|
||||
target_link_libraries(${TARGET} ${LIBS})
|
||||
set_property(TARGET ${TARGET} PROPERTY CXX_STANDARD 11)
|
||||
set_property(TARGET ${TARGET} PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
include_directories ( ${SRC_DIR} )
|
||||
|
||||
add_custom_target (
|
||||
PREPARE_ASSETS
|
||||
COMMAND python3 "${BUILD_DIR}/prepareAssets.py"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
|
||||
add_dependencies(${TARGET} PREPARE_ASSETS)
|
||||
|
||||
# Eclipse related configuration
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
|
||||
endif (CMAKE_COMPILER_IS_GNUCC)
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
|
||||
endif (CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
set (CMAKE_VERBOSE_MAKEFILE ON)
|
@ -5,7 +5,6 @@ import sys
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
|
||||
ASSETS_DIR="assets"
|
||||
RESOURCES_FILE="src/resources/Resources.g.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user