Cleanup and fixed first time generation.

This commit is contained in:
Joshua Brookover
2016-09-18 02:45:49 -05:00
parent 911cf46567
commit 92aa04bd00
5 changed files with 19 additions and 19 deletions

View File

@@ -16,12 +16,17 @@ if( APPLE )
set( CMAKE_CXX_FLAGS "-ObjC++" )
endif()
option( BGFX_BUILD_TOOLS "Build bgfx tools." ON )
option( BGFX_BUILD_EXAMPLES "Build bgfx examples." ON )
option( BGFX_BUILD_TOOLS "Build bgfx tools." ON )
option( BGFX_BUILD_EXAMPLES "Build bgfx examples." ON )
option( BGFX_INSTALL "Create installation target." ON )
option( BGFX_USE_OVR "Build with OVR support." OFF )
option( BGFX_INSTALL "Create installation target." ON )
option( BGFX_USE_OVR "Build with OVR support." OFF )
if( NOT BX_DIR )
set( BX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bx" CACHE STRING "Location of bgfx." )
endif()
if( NOT BGFX_DIR )
set( BGFX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bgfx" CACHE STRING "Location of bgfx." )
endif()
if( BGFX_USE_OVR )
include( cmake/ovr.cmake )

View File

@@ -14,7 +14,7 @@ endif()
file( GLOB OCORNUT_IMGUI_SOURCES ${BGFX_DIR}/3rdparty/ocornut-imgui/*.cpp ${BGFX_DIR}/3rdparty/ocornut-imgui/*.h ${BGFX_DIR}/3rdparty/ocornut-imgui/*.inl )
add_library( ocornut-imgui STATIC ${OCORNUT_IMGUI_SOURCES} )
add_library( ocornut-imgui STATIC EXCLUDE_FROM_ALL ${OCORNUT_IMGUI_SOURCES} )
target_compile_definitions( ocornut-imgui PRIVATE "-D_CRT_SECURE_NO_WARNINGS" "-D__STDC_FORMAT_MACROS" )
target_include_directories( ocornut-imgui PUBLIC ${BGFX_DIR}/3rdparty )
target_link_libraries( ocornut-imgui PUBLIC bx )

View File

@@ -8,11 +8,6 @@
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# The bgfx location is customizable via cache variable BGFX_DIR
if( NOT BGFX_DIR )
set( BGFX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bgfx" CACHE STRING "Location of bgfx." )
endif()
# Ensure the directory exists
if( NOT IS_DIRECTORY ${BGFX_DIR} )
message( SEND_ERROR "Could not load bgfx, directory does not exist. ${BGFX_DIR}" )
@@ -52,15 +47,13 @@ endif()
# Frameworks required on OS X
if( APPLE )
find_library( CARBON_LIBRARY Carbon )
find_library( COCOA_LIBRARY Cocoa )
find_library( METAL_LIBRARY Metal )
find_library( QUARTZCORE_LIBRARY QuartzCore )
mark_as_advanced( CARBON_LIBRARY )
mark_as_advanced( COCOA_LIBRARY )
mark_as_advanced( METAL_LIBRARY )
mark_as_advanced( QUARTZCORE_LIBRARY )
target_link_libraries( bgfx PUBLIC ${CARBON_LIBRARY} ${COCOA_LIBRARY} ${METAL_LIBRARY} ${QUARTZCORE_LIBRARY} )
target_link_libraries( bgfx PUBLIC ${COCOA_LIBRARY} ${METAL_LIBRARY} ${QUARTZCORE_LIBRARY} )
endif()
# Excluded files from compilation

View File

@@ -8,11 +8,6 @@
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# The bx location is customizable via cache variable BX_DIR
if( NOT BX_DIR )
set( BX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bx" CACHE STRING "Location of bgfx." )
endif()
# Ensure the directory exists
if( NOT IS_DIRECTORY ${BX_DIR} )
message( SEND_ERROR "Could not load bx, directory does not exist. ${BX_DIR}" )

View File

@@ -16,3 +16,10 @@ add_library( bgfx-bounds INTERFACE )
target_sources( bgfx-bounds INTERFACE ${BGFX_DIR}/examples/common/bounds.cpp )
target_include_directories( bgfx-bounds INTERFACE ${BGFX_DIR}/include )
target_include_directories( bgfx-bounds INTERFACE ${BGFX_DIR}/examples/common )
# Frameworks required on OS X
if( APPLE )
find_library( COCOA_LIBRARY Cocoa )
mark_as_advanced( COCOA_LIBRARY )
target_link_libraries( bgfx-vertexdecl INTERFACE ${COCOA_LIBRARY} )
endif()