New CMakeFile to cross-compiling
This commit is contained in:
parent
62194ead52
commit
15032331ee
50
CMakeLists.txt
Normal file
50
CMakeLists.txt
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# CMakeLists.txt
|
||||||
|
|
||||||
|
# Written by JackCarterSmith, 2020
|
||||||
|
# This code is released under the RSE license.
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.1)
|
||||||
|
cmake_policy(VERSION 3.1)
|
||||||
|
|
||||||
|
# define project
|
||||||
|
project(rse-texture VERSION 1.0.1 DESCRIPTION "RogueSquadron Extractor - Texture" LANGUAGES C)
|
||||||
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
|
set(RSE_TEX_NAME RSE_Texture-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
#include(CheckTypeSize)
|
||||||
|
#include(CheckFunctionExists)
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
|
# needed packages
|
||||||
|
|
||||||
|
find_package(ZLIB REQUIRED)
|
||||||
|
include_directories(${ZLIB_INCLUDE_DIR})
|
||||||
|
find_package(PNG REQUIRED)
|
||||||
|
include_directories(${PNG_INCLUDE_DIR})
|
||||||
|
|
||||||
|
# define src/headers files
|
||||||
|
|
||||||
|
FILE(GLOB RSE_TEX_SRCS src/*.c)
|
||||||
|
FILE(GLOB RSE_TEX_HRDS src/*.h)
|
||||||
|
SOURCE_GROUP("Source Files" FILES ${RSE_TEX_SRCS})
|
||||||
|
SOURCE_GROUP("Header Files" FILES ${RSE_TEX_HRDS})
|
||||||
|
|
||||||
|
# begin building RSE-Texture
|
||||||
|
|
||||||
|
#include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
add_executable(rse-texture ${RSE_TEX_SRCS} ${RSE_TEX_HRDS})
|
||||||
|
set_target_properties(rse-texture PROPERTIES OUTPUT_NAME ${RSE_TEX_NAME})
|
||||||
|
if(MSVC)
|
||||||
|
# msvc does not append 'lib' - do it here to have consistent name
|
||||||
|
set_target_properties(rse-texture PROPERTIES PREFIX "lib")
|
||||||
|
set_target_properties(rse-texture PROPERTIES IMPORT_PREFIX "lib")
|
||||||
|
endif()
|
||||||
|
target_link_libraries(rse-texture ${ZLIB_LIBRARIES} ${PNG_LIBRARIES})
|
||||||
|
|
||||||
|
# install executable
|
||||||
|
|
||||||
|
install(TARGETS rse-texture
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
)
|
@ -4,7 +4,7 @@ CFLAGS= -Wall -O3
|
|||||||
LDFLAGS= -lz -lpng
|
LDFLAGS= -lz -lpng
|
||||||
|
|
||||||
TARGET=RSE-Texture
|
TARGET=RSE-Texture
|
||||||
VERSION=1.0a
|
VERSION=1.0b
|
||||||
SRC_DIR=src
|
SRC_DIR=src
|
||||||
SRC= $(wildcard $(SRC_DIR)/*.c)
|
SRC= $(wildcard $(SRC_DIR)/*.c)
|
||||||
INCLUDES=-I$(SRC_DIR)
|
INCLUDES=-I$(SRC_DIR)
|
Loading…
x
Reference in New Issue
Block a user