2019-05-23 16:04:29 -07:00
|
|
|
cmake_minimum_required(VERSION 3.12)
|
|
|
|
|
|
|
|
project(pwe_core CXX C)
|
|
|
|
|
|
|
|
find_package(tinyxml2 CONFIG REQUIRED)
|
|
|
|
find_package(logvisor CONFIG REQUIRED)
|
2019-11-24 18:46:57 -08:00
|
|
|
find_package(nod CONFIG REQUIRED)
|
2019-05-23 16:04:29 -07:00
|
|
|
find_package(lzokay CONFIG REQUIRED)
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
find_package(assimp CONFIG REQUIRED)
|
2019-05-25 23:24:13 -07:00
|
|
|
find_package(ZLIB REQUIRED)
|
2021-08-06 15:52:21 -07:00
|
|
|
find_package(Threads REQUIRED)
|
2019-05-25 23:24:13 -07:00
|
|
|
|
2019-05-23 16:04:29 -07:00
|
|
|
file(GLOB_RECURSE source_files
|
|
|
|
"*.c"
|
|
|
|
"*.cpp"
|
|
|
|
"*.h"
|
|
|
|
"*.hpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(pwe_core ${source_files})
|
|
|
|
|
|
|
|
target_compile_features(pwe_core PRIVATE cxx_std_17)
|
|
|
|
|
|
|
|
target_include_directories(pwe_core
|
|
|
|
PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/..>
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
OpenGL
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(
|
|
|
|
pwe_core
|
2019-06-04 17:44:39 -07:00
|
|
|
libcommon
|
2019-05-23 16:04:29 -07:00
|
|
|
nod::nod
|
|
|
|
logvisor::logvisor
|
|
|
|
lzokay::lzokay
|
|
|
|
OpenGL::GL
|
2019-05-23 18:02:08 -07:00
|
|
|
assimp::assimp
|
2021-08-06 15:52:21 -07:00
|
|
|
Threads::Threads
|
2019-05-23 18:02:08 -07:00
|
|
|
${ZLIB_LIBRARY}
|
2019-05-23 16:04:29 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_definitions(
|
|
|
|
pwe_core
|
|
|
|
PRIVATE
|
|
|
|
USE_LZOKAY
|
|
|
|
PUBLIC
|
|
|
|
UNICODE
|
|
|
|
GLEW_STATIC
|
|
|
|
)
|
|
|
|
|
2019-06-04 17:44:39 -07:00
|
|
|
gather_include_directories(pwe_core_include_directories pwe_core)
|
2019-05-23 16:04:29 -07:00
|
|
|
|
|
|
|
add_codegen_targets(
|
|
|
|
"${source_files}"
|
|
|
|
codegen_generated_files
|
|
|
|
"${PROJECT_SOURCE_DIR}"
|
|
|
|
"${PROJECT_BINARY_DIR}"
|
2019-06-04 17:44:39 -07:00
|
|
|
"${pwe_core_include_directories}"
|
2019-05-23 16:04:29 -07:00
|
|
|
)
|
|
|
|
add_custom_target(pwe_core_codegen DEPENDS ${codegen_generated_files} SOURCES ${source_files})
|
|
|
|
|
|
|
|
# Add the generated sources to the library target
|
|
|
|
target_sources(pwe_core PRIVATE ${codegen_generated_files})
|