Now including headers in generated projects for Kraken
This commit is contained in:
@@ -59,6 +59,28 @@ macro (add_public_header)
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro (add_private_headers)
|
||||||
|
file (RELATIVE_PATH _relPath "${PROJECT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
foreach (_src ${ARGN})
|
||||||
|
if (_relPath)
|
||||||
|
list (APPEND KRAKEN_PRIVATE_HEADERS "${_relPath}/${_src}")
|
||||||
|
else()
|
||||||
|
list (APPEND KRAKEN_PRIVATE_HEADERS "${_src}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if (_relPath)
|
||||||
|
# propagate KRAKEN_PRIVATE_HEADERS to parent directory
|
||||||
|
set (KRAKEN_PRIVATE_HEADERS ${KRAKEN_PRIVATE_HEADERS} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro (add_source_and_header)
|
||||||
|
foreach (_src ${ARGN})
|
||||||
|
add_sources("${_src}.cpp")
|
||||||
|
add_private_headers("${_src}.h")
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-deprecated-declarations -Wno-c++11-extensions")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-deprecated-declarations -Wno-c++11-extensions")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated -Wno-deprecated-declarations -Wno-c++11-extensions")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated -Wno-deprecated-declarations -Wno-c++11-extensions")
|
||||||
@@ -186,24 +208,24 @@ endif()
|
|||||||
include_directories(3rdparty/spirv-reflect)
|
include_directories(3rdparty/spirv-reflect)
|
||||||
add_sources(3rdparty/spirv-reflect/spirv_reflect.c)
|
add_sources(3rdparty/spirv-reflect/spirv_reflect.c)
|
||||||
|
|
||||||
add_library(kraken STATIC ${SRCS} ${KRAKEN_PUBLIC_HEADERS})
|
add_library(kraken STATIC ${SRCS} ${KRAKEN_PUBLIC_HEADERS} ${KRAKEN_PRIVATE_HEADERS})
|
||||||
TARGET_LINK_LIBRARIES( kraken ${EXTRA_LIBS} )
|
TARGET_LINK_LIBRARIES( kraken ${EXTRA_LIBS} )
|
||||||
SET_TARGET_PROPERTIES(
|
SET_TARGET_PROPERTIES(
|
||||||
kraken
|
kraken
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
PUBLIC_HEADER "${KRAKEN_PUBLIC_HEADERS}"
|
PUBLIC_HEADER "${KRAKEN_PUBLIC_HEADERS}"
|
||||||
PRIVATE_HEADER "${PRIVATE_HEADER_FILES}"
|
PRIVATE_HEADER "${KRAKEN_PRIVATE_HEADERS}"
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "lib${LIB_SUFFIX}"
|
ARCHIVE_OUTPUT_DIRECTORY "lib${LIB_SUFFIX}"
|
||||||
OUTPUT_NAME kraken_static
|
OUTPUT_NAME kraken_static
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(kraken_dynamic SHARED ${SRCS} ${KRAKEN_PUBLIC_HEADERS})
|
add_library(kraken_dynamic SHARED ${SRCS} ${KRAKEN_PUBLIC_HEADERS} ${KRAKEN_PRIVATE_HEADERS})
|
||||||
TARGET_LINK_LIBRARIES( kraken_dynamic ${EXTRA_LIBS} )
|
TARGET_LINK_LIBRARIES( kraken_dynamic ${EXTRA_LIBS} )
|
||||||
SET_TARGET_PROPERTIES(
|
SET_TARGET_PROPERTIES(
|
||||||
kraken_dynamic
|
kraken_dynamic
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
PUBLIC_HEADER "${KRAKEN_PUBLIC_HEADERS}"
|
PUBLIC_HEADER "${KRAKEN_PUBLIC_HEADERS}"
|
||||||
PRIVATE_HEADER "${PRIVATE_HEADER_FILES}"
|
PRIVATE_HEADER "${KRAKEN_PRIVATE_HEADERS}"
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "lib${LIB_SUFFIX}"
|
ARCHIVE_OUTPUT_DIRECTORY "lib${LIB_SUFFIX}"
|
||||||
OUTPUT_NAME kraken
|
OUTPUT_NAME kraken
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,89 +1,91 @@
|
|||||||
include_directories(public)
|
include_directories(public)
|
||||||
add_subdirectory(public)
|
add_subdirectory(public)
|
||||||
set(KRAKEN_PUBLIC_HEADERS "${KRAKEN_PUBLIC_HEADERS}" PARENT_SCOPE)
|
set(KRAKEN_PUBLIC_HEADERS "${KRAKEN_PUBLIC_HEADERS}" PARENT_SCOPE)
|
||||||
|
set(KRAKEN_PRIVATE_HEADERS "${KRAKEN_PRIVATE_HEADERS}" PARENT_SCOPE)
|
||||||
|
|
||||||
# Private Implementation
|
# Private Implementation
|
||||||
add_sources(kraken.cpp)
|
add_sources(kraken.cpp)
|
||||||
add_sources(KRAmbientZone.cpp)
|
add_source_and_header(KRAmbientZone)
|
||||||
add_sources(KRAnimation.cpp)
|
add_source_and_header(KRAnimation)
|
||||||
add_sources(KRAnimationAttribute.cpp)
|
add_source_and_header(KRAnimationAttribute)
|
||||||
add_sources(KRAnimationCurve.cpp)
|
add_source_and_header(KRAnimationCurve)
|
||||||
add_sources(KRAnimationCurveManager.cpp)
|
add_source_and_header(KRAnimationCurveManager)
|
||||||
add_sources(KRAnimationLayer.cpp)
|
add_source_and_header(KRAnimationLayer)
|
||||||
add_sources(KRAnimationManager.cpp)
|
add_source_and_header(KRAnimationManager)
|
||||||
add_sources(KRAudioBuffer.cpp)
|
add_source_and_header(KRAudioBuffer)
|
||||||
add_sources(KRAudioManager.cpp)
|
add_source_and_header(KRAudioManager)
|
||||||
add_sources(KRAudioSample.cpp)
|
add_source_and_header(KRAudioSample)
|
||||||
add_sources(KRAudioSource.cpp)
|
add_source_and_header(KRAudioSource)
|
||||||
add_sources(KRBehavior.cpp)
|
add_source_and_header(KRBehavior)
|
||||||
add_sources(KRBone.cpp)
|
add_source_and_header(KRBone)
|
||||||
add_sources(KRBundle.cpp)
|
add_source_and_header(KRBundle)
|
||||||
add_sources(KRBundleManager.cpp)
|
add_source_and_header(KRBundleManager)
|
||||||
add_sources(KRCamera.cpp)
|
add_source_and_header(KRCamera)
|
||||||
add_sources(KRCollider.cpp)
|
add_source_and_header(KRCollider)
|
||||||
add_sources(KRContext.cpp)
|
add_source_and_header(KRContext)
|
||||||
add_sources(KRUniformBuffer.cpp)
|
add_source_and_header(KRUniformBuffer)
|
||||||
add_sources(KRUniformBufferManager.cpp)
|
add_source_and_header(KRUniformBufferManager)
|
||||||
add_sources(KRDevice.cpp)
|
add_source_and_header(KRDevice)
|
||||||
add_sources(KRDeviceManager.cpp)
|
add_source_and_header(KRDeviceManager)
|
||||||
add_sources(KRRenderPass.cpp)
|
add_source_and_header(KRRenderPass)
|
||||||
add_sources(KRSurface.cpp)
|
add_source_and_header(KRSurface)
|
||||||
add_sources(KRSurfaceManager.cpp)
|
add_source_and_header(KRSurfaceManager)
|
||||||
add_sources(KRStreamerThread.cpp)
|
add_source_and_header(KRStreamerThread)
|
||||||
add_sources(KRSwapchain.cpp)
|
add_source_and_header(KRSwapchain)
|
||||||
add_sources(KRContextObject.cpp)
|
add_source_and_header(KRContextObject)
|
||||||
add_sources(KRDirectionalLight.cpp)
|
add_source_and_header(KRDirectionalLight)
|
||||||
add_sources(KRHelpers.cpp)
|
add_source_and_header(KRHelpers)
|
||||||
add_sources(KRLight.cpp)
|
add_source_and_header(KRLight)
|
||||||
add_sources(KRLocator.cpp)
|
add_source_and_header(KRLocator)
|
||||||
add_sources(KRLODGroup.cpp)
|
add_source_and_header(KRLODGroup)
|
||||||
add_sources(KRLODSet.cpp)
|
add_source_and_header(KRLODSet)
|
||||||
add_sources(KRMaterial.cpp)
|
add_source_and_header(KRMaterial)
|
||||||
add_sources(KRMaterialManager.cpp)
|
add_source_and_header(KRMaterialManager)
|
||||||
add_sources(KRMesh.cpp)
|
add_source_and_header(KRMesh)
|
||||||
add_sources(KRMeshCube.cpp)
|
add_source_and_header(KRMeshCube)
|
||||||
add_sources(KRMeshManager.cpp)
|
add_source_and_header(KRMeshManager)
|
||||||
add_sources(KRMeshQuad.cpp)
|
add_source_and_header(KRMeshQuad)
|
||||||
add_sources(KRMeshSphere.cpp)
|
add_source_and_header(KRMeshSphere)
|
||||||
add_sources(KRModel.cpp)
|
add_source_and_header(KRModel)
|
||||||
add_sources(KRNode.cpp)
|
add_source_and_header(KRNode)
|
||||||
add_sources(KROctree.cpp)
|
add_source_and_header(KROctree)
|
||||||
add_sources(KROctreeNode.cpp)
|
add_source_and_header(KROctreeNode)
|
||||||
add_sources(KRParticleSystem.cpp)
|
add_source_and_header(KRParticleSystem)
|
||||||
add_sources(KRParticleSystemNewtonian.cpp)
|
add_source_and_header(KRParticleSystemNewtonian)
|
||||||
add_sources(KRPointLight.cpp)
|
add_source_and_header(KRPointLight)
|
||||||
add_sources(KRPresentationThread.cpp)
|
add_source_and_header(KRPresentationThread)
|
||||||
add_sources(KRRenderGraph.cpp)
|
add_source_and_header(KRRenderGraph)
|
||||||
add_sources(KRRenderSettings.cpp)
|
add_source_and_header(KRRenderSettings)
|
||||||
add_sources(KRResource+blend.cpp)
|
add_sources(KRResource+blend)
|
||||||
# add_sources(KRResource+fbx.cpp) # TODO - Locate FBX SDK dependencies
|
# add_source(KRResource+fbx.cpp) # TODO - Locate FBX SDK dependencies
|
||||||
add_sources(KRResource+obj.cpp)
|
add_sources(KRResource+obj.cpp)
|
||||||
add_sources(KRResource.cpp)
|
add_private_headers(KRResource.h)
|
||||||
add_sources(KRResourceManager.cpp)
|
add_source_and_header(KRResource)
|
||||||
add_sources(KRReverbZone.cpp)
|
add_source_and_header(KRResourceManager)
|
||||||
add_sources(KRScene.cpp)
|
add_source_and_header(KRReverbZone)
|
||||||
add_sources(KRSceneManager.cpp)
|
add_source_and_header(KRScene)
|
||||||
add_sources(KRShader.cpp)
|
add_source_and_header(KRSceneManager)
|
||||||
add_sources(KRShaderManager.cpp)
|
add_source_and_header(KRShader)
|
||||||
add_sources(KRSource.cpp)
|
add_source_and_header(KRShaderManager)
|
||||||
add_sources(KRSourceManager.cpp)
|
add_source_and_header(KRSource)
|
||||||
add_sources(KRPipeline.cpp)
|
add_source_and_header(KRSourceManager)
|
||||||
add_sources(KRPipelineManager.cpp)
|
add_source_and_header(KRPipeline)
|
||||||
add_sources(KRSampler.cpp)
|
add_source_and_header(KRPipelineManager)
|
||||||
add_sources(KRSamplerManager.cpp)
|
add_source_and_header(KRSampler)
|
||||||
add_sources(KRSpotLight.cpp)
|
add_source_and_header(KRSamplerManager)
|
||||||
add_sources(KRSprite.cpp)
|
add_source_and_header(KRSpotLight)
|
||||||
add_sources(KRTexture.cpp)
|
add_source_and_header(KRSprite)
|
||||||
add_sources(KRTexture2D.cpp)
|
add_source_and_header(KRTexture)
|
||||||
add_sources(KRTextureAnimated.cpp)
|
add_source_and_header(KRTexture2D)
|
||||||
add_sources(KRTextureCube.cpp)
|
add_source_and_header(KRTextureAnimated)
|
||||||
add_sources(KRTextureKTX.cpp)
|
add_source_and_header(KRTextureCube)
|
||||||
add_sources(KRTextureKTX2.cpp)
|
add_source_and_header(KRTextureKTX)
|
||||||
add_sources(KRTextureManager.cpp)
|
add_source_and_header(KRTextureKTX2)
|
||||||
add_sources(KRTexturePVR.cpp)
|
add_source_and_header(KRTextureManager)
|
||||||
add_sources(KRTextureTGA.cpp)
|
add_source_and_header(KRTexturePVR)
|
||||||
add_sources(KRUnknown.cpp)
|
add_source_and_header(KRTextureTGA)
|
||||||
add_sources(KRUnknownManager.cpp)
|
add_source_and_header(KRUnknown)
|
||||||
add_sources(KRViewport.cpp)
|
add_source_and_header(KRUnknownManager)
|
||||||
add_sources(../3rdparty/tinyxml2/tinyxml2.cpp)
|
add_source_and_header(KRViewport)
|
||||||
add_sources(../3rdparty/forsyth/forsyth.cpp)
|
add_source_and_header(../3rdparty/tinyxml2/tinyxml2)
|
||||||
|
add_source_and_header(../3rdparty/forsyth/forsyth)
|
||||||
|
|||||||
Reference in New Issue
Block a user