This commit is contained in:
39
CMakeLists.txt
Normal file
39
CMakeLists.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(CgeFile LANGUAGES C)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
|
||||
set(SOURCES)
|
||||
|
||||
set(SOURCES_WIN32
|
||||
src/win32/File.c
|
||||
)
|
||||
|
||||
set(SOURCES_POSIX
|
||||
src/posix/File.c
|
||||
)
|
||||
|
||||
set(HEADERS
|
||||
CgeFile.h
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
message(STATUS "Platform - Win32")
|
||||
list(APPEND SOURCES ${SOURCES_WIN32})
|
||||
elseif(UNIX)
|
||||
message(STATUS "Platform: Unix (Linux/BSD/MacOS X)")
|
||||
list(APPEND SOURCES ${SOURCES_POSIX})
|
||||
endif()
|
||||
|
||||
add_library(CgeFile STATIC ${SOURCES} ${HEADERS})
|
||||
|
||||
target_include_directories(CgeFile PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
install(TARGETS CgeFile
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
|
||||
install(FILES ${HEADERS} DESTINATION include)
|
||||
Reference in New Issue
Block a user