Update CMakeLists.txt
This commit is contained in:
parent
e65297de1e
commit
a168893acc
@ -29,13 +29,10 @@ add_compile_definitions(FT_CONFIG_OPTION_ERROR_STRINGS) # Freetype error strings
|
|||||||
|
|
||||||
if(${KEKENGINE_DEBUG})
|
if(${KEKENGINE_DEBUG})
|
||||||
add_compile_options(-Wall -g)
|
add_compile_options(-Wall -g)
|
||||||
message("Compiler flags A")
|
|
||||||
else()
|
else()
|
||||||
add_compile_options(-Wall -O3)
|
add_compile_options(-Wall -O3)
|
||||||
message("Compiler flags B")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(dependencies/microtar)
|
add_subdirectory(dependencies/microtar)
|
||||||
|
|
||||||
# kekengine resources
|
# kekengine resources
|
||||||
@ -43,12 +40,14 @@ add_custom_target(kekengine_res ALL DEPENDS ${KEKENGINE_RESOURCE_FILES})
|
|||||||
|
|
||||||
add_custom_command(TARGET kekengine_res PRE_BUILD
|
add_custom_command(TARGET kekengine_res PRE_BUILD
|
||||||
BYPRODUCTS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources.tar
|
BYPRODUCTS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources.tar
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
|
||||||
COMMAND ${CMAKE_COMMAND} -E
|
COMMAND ${CMAKE_COMMAND} -E
|
||||||
chdir ${KEKENGINE_RESOURCE_DIR}
|
chdir ${KEKENGINE_RESOURCE_DIR}
|
||||||
tar cf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources.tar ${KEKENGINE_RELATIVE_RESOURCE_FILES})
|
tar cf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources.tar ${KEKENGINE_RELATIVE_RESOURCE_FILES})
|
||||||
|
|
||||||
# libkekengine
|
# libkekengine
|
||||||
add_library(kekengine ${KEKENGINE_SOURCE_FILES})
|
add_library(kekengine ${KEKENGINE_SOURCE_FILES})
|
||||||
|
add_dependencies(kekengine kekengine_res)
|
||||||
|
|
||||||
target_link_libraries(kekengine PUBLIC glfw GLEW GL microtar)
|
target_link_libraries(kekengine PUBLIC glfw GLEW GL microtar)
|
||||||
target_include_directories(kekengine PRIVATE "src/kekengine/include")
|
target_include_directories(kekengine PRIVATE "src/kekengine/include")
|
||||||
@ -59,18 +58,22 @@ pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
|||||||
target_link_libraries(kekengine PUBLIC ${GTK3_LIBRARIES})
|
target_link_libraries(kekengine PUBLIC ${GTK3_LIBRARIES})
|
||||||
target_include_directories(kekengine PRIVATE ${GTK3_INCLUDE_DIRS})
|
target_include_directories(kekengine PRIVATE ${GTK3_INCLUDE_DIRS})
|
||||||
|
|
||||||
# kekgame resources
|
if(${KEKENGINE_BUILD_KEKGAME})
|
||||||
add_custom_target(kekgame_res ALL
|
# kekgame resources
|
||||||
DEPENDS ${KEKGAME_RESOURCE_FILES} kekengine_res)
|
add_custom_target(kekgame_res ALL
|
||||||
|
DEPENDS ${KEKGAME_RESOURCE_FILES} kekengine_res)
|
||||||
|
|
||||||
add_custom_command(TARGET kekgame_res PRE_BUILD
|
add_custom_command(TARGET kekgame_res PRE_BUILD
|
||||||
BYPRODUCTS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources.tar
|
BYPRODUCTS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources.tar
|
||||||
COMMAND ${CMAKE_COMMAND} -E
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
|
||||||
chdir ${KEKGAME_RESOURCE_DIR}
|
COMMAND ${CMAKE_COMMAND} -E
|
||||||
tar rf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources.tar ${KEKGAME_RELATIVE_RESOURCE_FILES})
|
chdir ${KEKGAME_RESOURCE_DIR}
|
||||||
|
tar rf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources.tar ${KEKGAME_RELATIVE_RESOURCE_FILES})
|
||||||
|
|
||||||
# kekgame
|
# kekgame
|
||||||
add_executable(kekgame ${KEKGAME_SOURCE_FILES})
|
add_executable(kekgame ${KEKGAME_SOURCE_FILES})
|
||||||
|
add_dependencies(kekgame kekgame_res)
|
||||||
|
|
||||||
target_link_libraries(kekgame PUBLIC kekengine)
|
target_link_libraries(kekgame PUBLIC kekengine)
|
||||||
target_include_directories(kekgame PRIVATE "src/kekengine/include")
|
target_include_directories(kekgame PRIVATE "src/kekengine/include")
|
||||||
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user