添加部分CMakeLists.txt

This commit is contained in:
HEYAHONG 2023-05-28 21:57:45 +08:00
parent 436e3da700
commit 02bd72e0d8
No known key found for this signature in database
GPG Key ID: BD5679034F83A8A9
4 changed files with 187 additions and 0 deletions

8
pdcurses/CMakeLists.txt Normal file
View File

@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.13)
project(PDCursesCore C CXX ASM)
file(GLOB PDCURSESCORE_CXX_C_FILES *.c)
add_library(PDCursesCore ${PDCURSESCORE_CXX_C_FILES})
target_include_directories(PDCursesCore BEFORE
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ )

62
sdl1/CMakeLists.txt Normal file
View File

@ -0,0 +1,62 @@
cmake_minimum_required(VERSION 3.13)
set(PDCURSESLIB PDCursesSDL1)
project(${PDCURSESLIB} C CXX ASM)
file(GLOB PD_C_FILES pd*.c)
add_library(${PDCURSESLIB} ${PD_C_FILES})
target_include_directories(${PDCURSESLIB} BEFORE
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
)
option(DEBUG "PDCDEBUG" OFF)
if(DEBUG)
target_compile_definitions(${PDCURSESLIB} PUBLIC "-DPDCDEBUG")
endif()
option(WIDE "PDC_WIDE" OFF)
if(WIDE)
target_compile_definitions(${PDCURSESLIB} PUBLIC "-DPDC_WIDE")
target_link_libraries(${PDCURSESLIB} SDL_ttf)
endif()
option(UTF8 "PDC_FORCE_UTF8" ON)
if(UTF8)
target_compile_definitions(${PDCURSESLIB} PUBLIC "-DPDC_FORCE_UTF8")
endif()
#PDCursesCore
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../pdcurses pdcurses)
target_link_libraries(PDCursesCore ${PDCURSESLIB})
include(FindPkgConfig)
#SDL1
pkg_check_modules(SDL REQUIRED IMPORTED_TARGET sdl)
target_link_libraries(${PDCURSESLIB} PkgConfig::SDL)
#Demos
set(DEMOS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../demos/)
add_executable(firework ${DEMOS_DIR}/firework.c )
target_link_libraries(firework PDCursesCore)
add_executable(ozdemo ${DEMOS_DIR}/ozdemo.c )
target_link_libraries(ozdemo PDCursesCore)
add_executable(ptest ${DEMOS_DIR}/ptest.c )
target_link_libraries(ptest PDCursesCore)
add_executable(rain ${DEMOS_DIR}/rain.c )
target_link_libraries(rain PDCursesCore)
add_executable(testcurs ${DEMOS_DIR}/testcurs.c )
target_link_libraries(testcurs PDCursesCore)
add_executable(tuidemo ${DEMOS_DIR}/tuidemo.c ${DEMOS_DIR}/tui.c )
target_link_libraries(tuidemo PDCursesCore)
add_executable(worm ${DEMOS_DIR}/worm.c )
target_link_libraries(worm PDCursesCore)
add_executable(xmas ${DEMOS_DIR}/xmas.c )
target_link_libraries(xmas PDCursesCore)
add_executable(sdltest sdltest.c )
target_link_libraries(sdltest PDCursesCore)

62
sdl2/CMakeLists.txt Normal file
View File

@ -0,0 +1,62 @@
cmake_minimum_required(VERSION 3.13)
set(PDCURSESLIB PDCursesSDL2)
project(${PDCURSESLIB} C CXX ASM)
file(GLOB PD_C_FILES pd*.c)
add_library(${PDCURSESLIB} ${PD_C_FILES})
target_include_directories(${PDCURSESLIB} BEFORE
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
)
option(DEBUG "PDCDEBUG" OFF)
if(DEBUG)
target_compile_definitions(${PDCURSESLIB} PUBLIC "-DPDCDEBUG")
endif()
option(WIDE "PDC_WIDE" OFF)
if(WIDE)
target_compile_definitions(${PDCURSESLIB} PUBLIC "-DPDC_WIDE")
target_link_libraries(${PDCURSESLIB} SDL2_ttf)
endif()
option(UTF8 "PDC_FORCE_UTF8" ON)
if(UTF8)
target_compile_definitions(${PDCURSESLIB} PUBLIC "-DPDC_FORCE_UTF8")
endif()
#PDCursesCore
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../pdcurses pdcurses)
target_link_libraries(PDCursesCore ${PDCURSESLIB})
include(FindPkgConfig)
#SDL2
pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)
target_link_libraries(${PDCURSESLIB} PkgConfig::SDL2)
#Demos
set(DEMOS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../demos/)
add_executable(firework ${DEMOS_DIR}/firework.c )
target_link_libraries(firework PDCursesCore)
add_executable(ozdemo ${DEMOS_DIR}/ozdemo.c )
target_link_libraries(ozdemo PDCursesCore)
add_executable(ptest ${DEMOS_DIR}/ptest.c )
target_link_libraries(ptest PDCursesCore)
add_executable(rain ${DEMOS_DIR}/rain.c )
target_link_libraries(rain PDCursesCore)
add_executable(testcurs ${DEMOS_DIR}/testcurs.c )
target_link_libraries(testcurs PDCursesCore)
add_executable(tuidemo ${DEMOS_DIR}/tuidemo.c ${DEMOS_DIR}/tui.c )
target_link_libraries(tuidemo PDCursesCore)
add_executable(worm ${DEMOS_DIR}/worm.c )
target_link_libraries(worm PDCursesCore)
add_executable(xmas ${DEMOS_DIR}/xmas.c )
target_link_libraries(xmas PDCursesCore)
add_executable(sdltest sdltest.c )
target_link_libraries(sdltest PDCursesCore)

55
wincon/CMakeLists.txt Normal file
View File

@ -0,0 +1,55 @@
cmake_minimum_required(VERSION 3.13)
set(PDCURSESLIB PDCursesWinCon)
project(${PDCURSESLIB} C CXX ASM)
file(GLOB PD_C_FILES pd*.c)
add_library(${PDCURSESLIB} ${PD_C_FILES})
target_include_directories(${PDCURSESLIB} BEFORE
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
)
option(DEBUG "PDCDEBUG" OFF)
if(DEBUG)
target_compile_definitions(${PDCURSESLIB} PUBLIC "-DPDCDEBUG")
endif()
option(WIDE "PDC_WIDE" ON)
if(WIDE)
target_compile_definitions(${PDCURSESLIB} PUBLIC "-DPDC_WIDE")
endif()
option(UTF8 "PDC_FORCE_UTF8" ON)
if(UTF8)
target_compile_definitions(${PDCURSESLIB} PUBLIC "-DPDC_FORCE_UTF8")
endif()
#PDCursesCore
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../pdcurses pdcurses)
target_link_libraries(PDCursesCore ${PDCURSESLIB})
#Demos
set(DEMOS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../demos/)
add_executable(firework ${DEMOS_DIR}/firework.c )
target_link_libraries(firework PDCursesCore)
add_executable(ozdemo ${DEMOS_DIR}/ozdemo.c )
target_link_libraries(ozdemo PDCursesCore)
add_executable(ptest ${DEMOS_DIR}/ptest.c )
target_link_libraries(ptest PDCursesCore)
add_executable(rain ${DEMOS_DIR}/rain.c )
target_link_libraries(rain PDCursesCore)
add_executable(testcurs ${DEMOS_DIR}/testcurs.c )
target_link_libraries(testcurs PDCursesCore)
add_executable(tuidemo ${DEMOS_DIR}/tuidemo.c ${DEMOS_DIR}/tui.c )
target_link_libraries(tuidemo PDCursesCore)
add_executable(worm ${DEMOS_DIR}/worm.c )
target_link_libraries(worm PDCursesCore)
add_executable(xmas ${DEMOS_DIR}/xmas.c )
target_link_libraries(xmas PDCursesCore)