CMake: add missing headers, use space before comments

This commit is contained in:
Campbell Barton
2019-10-29 01:32:33 +11:00
parent 74c9a4769e
commit 312075e688
37 changed files with 145 additions and 122 deletions

View File

@@ -1579,7 +1579,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
if(MSVC_VERSION GREATER_EQUAL 1911) if(MSVC_VERSION GREATER_EQUAL 1911)
# see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017 # see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
set(_WARNINGS "${_WARNINGS} /w35038") #order of initialisation in c++ constructors set(_WARNINGS "${_WARNINGS} /w35038") # order of initialization in c++ constructors
endif() endif()
string(REPLACE ";" " " _WARNINGS "${_WARNINGS}") string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")

View File

@@ -30,8 +30,8 @@ set(BLOSC_EXTRA_ARGS
) )
if(WIN32) if(WIN32)
#prevent blosc from including it's own local copy of zlib in the object file # Prevent blosc from including it's own local copy of zlib in the object file
#and cause linker errors with everybody else # and cause linker errors with everybody else.
set(BLOSC_EXTRA_ARGS ${BLOSC_EXTRA_ARGS} set(BLOSC_EXTRA_ARGS ${BLOSC_EXTRA_ARGS}
-DPREFER_EXTERNAL_ZLIB=ON -DPREFER_EXTERNAL_ZLIB=ON
) )

View File

@@ -24,7 +24,7 @@ ExternalProject_Add(external_lcms
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LCMS_HASH} URL_HASH MD5=${LCMS_HASH}
PREFIX ${BUILD_DIR}/lcms PREFIX ${BUILD_DIR}/lcms
#patch taken from ocio # Patch taken from ocio.
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_lcms.txt ${BUILD_DIR}/lcms/src/external_lcms/CMakeLists.txt PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_lcms.txt ${BUILD_DIR}/lcms/src/external_lcms/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lcms ${DEFAULT_CMAKE_FLAGS} ${LCMS_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lcms ${DEFAULT_CMAKE_FLAGS} ${LCMS_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/lcms INSTALL_DIR ${LIBDIR}/lcms

View File

@@ -50,7 +50,7 @@ if(WIN32)
-DUSE_EXTERNAL_LCMS=ON -DUSE_EXTERNAL_LCMS=ON
-DINC_1=${LIBDIR}/tinyxml/include -DINC_1=${LIBDIR}/tinyxml/include
-DINC_2=${LIBDIR}/yamlcpp/include -DINC_2=${LIBDIR}/yamlcpp/include
#lie because ocio cmake is demanding boost even though it is not needed # Lie because ocio cmake is demanding boost even though it is not needed.
-DYAML_CPP_VERSION=0.5.0 -DYAML_CPP_VERSION=0.5.0
) )
else() else()

View File

@@ -44,7 +44,7 @@ if(WIN32)
ExternalProject_Add_Step(external_openexr after_install ExternalProject_Add_Step(external_openexr after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${HARVEST_TARGET}/openexr/lib COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${HARVEST_TARGET}/openexr/lib
#libs have moved between versions, just duplicate it for now. # Libs have moved between versions, just duplicate it for now.
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${LIBDIR}/ilmbase/lib COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${LIBDIR}/ilmbase/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/include ${HARVEST_TARGET}/openexr/include COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/include ${HARVEST_TARGET}/openexr/include
DEPENDEES install DEPENDEES install

View File

@@ -38,7 +38,7 @@ ExternalProject_Add(external_openjpeg
INSTALL_DIR ${LIBDIR}/openjpeg INSTALL_DIR ${LIBDIR}/openjpeg
) )
#on windows ffmpeg wants a mingw build, while oiio needs a msvc build # On windows ffmpeg wants a mingw build, while oiio needs a msvc build.
if(MSVC) if(MSVC)
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS}) set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
ExternalProject_Add(external_openjpeg_msvc ExternalProject_Add(external_openjpeg_msvc

View File

@@ -190,7 +190,7 @@ set(DEFAULT_CMAKE_FLAGS
) )
if(WIN32) if(WIN32)
#we need both flavors to build the thumbnail dlls # We need both flavors to build the thumbnail dlls
if(MSVC12) if(MSVC12)
set(GENERATOR_32 "Visual Studio 12 2013") set(GENERATOR_32 "Visual Studio 12 2013")
set(GENERATOR_64 "Visual Studio 12 2013 Win64") set(GENERATOR_64 "Visual Studio 12 2013 Win64")

View File

@@ -21,7 +21,7 @@ set(SNDFILE_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR
if(WIN32) if(WIN32)
set(SNDFILE_ENV set ${SNDFILE_ENV} &&) set(SNDFILE_ENV set ${SNDFILE_ENV} &&)
#shared for windows because static libs will drag in a libgcc dependency. # Shared for windows because static libs will drag in a libgcc dependency.
set(SNDFILE_OPTIONS --disable-static --enable-shared ) set(SNDFILE_OPTIONS --disable-static --enable-shared )
else() else()
set(SNDFILE_OPTIONS --enable-static --disable-shared ) set(SNDFILE_OPTIONS --enable-static --disable-shared )

View File

@@ -90,7 +90,7 @@ set(ALEMBIC_VERSION 1.7.8)
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz) set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz)
set(ALEMBIC_MD5 d095c2feb5e183b824904db7b63c1d30) set(ALEMBIC_MD5 d095c2feb5e183b824904db7b63c1d30)
## hash is for 3.1.2 # hash is for 3.1.2
set(GLFW_GIT_UID 30306e54705c3adae9fe082c816a3be71963485c) set(GLFW_GIT_UID 30306e54705c3adae9fe082c816a3be71963485c)
set(GLFW_URI https://github.com/glfw/glfw/archive/${GLFW_GIT_UID}.zip) set(GLFW_URI https://github.com/glfw/glfw/archive/${GLFW_GIT_UID}.zip)
set(GLFW_HASH 20cacb1613da7eeb092f3ac4f6b2b3d0) set(GLFW_HASH 20cacb1613da7eeb092f3ac4f6b2b3d0)
@@ -203,7 +203,7 @@ set(XVIDCORE_VERSION 1.3.5)
set(XVIDCORE_URI http://downloads.xvid.org/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz) set(XVIDCORE_URI http://downloads.xvid.org/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(XVIDCORE_HASH 165ba6a2a447a8375f7b06db5a3c91810181f2898166e7c8137401d7fc894cf0) set(XVIDCORE_HASH 165ba6a2a447a8375f7b06db5a3c91810181f2898166e7c8137401d7fc894cf0)
#this has to be in sync with the version in blenders /extern folder # This has to be in sync with the version in blenders /extern folder.
set(OPENJPEG_VERSION 2.3.0) set(OPENJPEG_VERSION 2.3.0)
set(OPENJPEG_SHORT_VERSION 2.3) set(OPENJPEG_SHORT_VERSION 2.3)
# Use slightly newer commit after release which includes a cmake fix # Use slightly newer commit after release which includes a cmake fix

View File

@@ -149,6 +149,9 @@ def cmake_get_src(f):
if not l.startswith("#"): if not l.startswith("#"):
# Remove in-line comments.
l = l.split(" # ")[0].rstrip()
if ")" in l: if ")" in l:
if l.strip() != ")": if l.strip() != ")":
raise Exception("strict formatting not kept '*)' %s:%d" % (f, i)) raise Exception("strict formatting not kept '*)' %s:%d" % (f, i))

View File

@@ -147,9 +147,9 @@ function(blender_include_dirs
get_filename_component(_ABS_INC ${_INC} ABSOLUTE) get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
list(APPEND _ALL_INCS ${_ABS_INC}) list(APPEND _ALL_INCS ${_ABS_INC})
# for checking for invalid includes, disable for regular use # for checking for invalid includes, disable for regular use
##if(NOT EXISTS "${_ABS_INC}/") # if(NOT EXISTS "${_ABS_INC}/")
## message(FATAL_ERROR "Include not found: ${_ABS_INC}/") # message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
##endif() # endif()
endforeach() endforeach()
include_directories(${_ALL_INCS}) include_directories(${_ALL_INCS})
endfunction() endfunction()
@@ -162,9 +162,9 @@ function(blender_include_dirs_sys
foreach(_INC ${ARGV}) foreach(_INC ${ARGV})
get_filename_component(_ABS_INC ${_INC} ABSOLUTE) get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
list(APPEND _ALL_INCS ${_ABS_INC}) list(APPEND _ALL_INCS ${_ABS_INC})
##if(NOT EXISTS "${_ABS_INC}/") # if(NOT EXISTS "${_ABS_INC}/")
## message(FATAL_ERROR "Include not found: ${_ABS_INC}/") # message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
##endif() # endif()
endforeach() endforeach()
include_directories(SYSTEM ${_ALL_INCS}) include_directories(SYSTEM ${_ALL_INCS})
endfunction() endfunction()
@@ -569,7 +569,7 @@ function(setup_liblinks
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
) )
#system libraries with no dependencies such as platform link libs or opengl should go last # System libraries with no dependencies such as platform link libs or opengl should go last.
target_link_libraries(${target} target_link_libraries(${target}
${BLENDER_GL_LIBRARIES}) ${BLENDER_GL_LIBRARIES})

View File

@@ -587,7 +587,7 @@ endif()
# used in many places so include globally, like OpenGL # used in many places so include globally, like OpenGL
blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}") blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}")
#find signtool # Find signtool.
set(ProgramFilesX86_NAME "ProgramFiles(x86)") #env dislikes the ( ) set(ProgramFilesX86_NAME "ProgramFiles(x86)") #env dislikes the ( )
find_program(SIGNTOOL_EXE signtool find_program(SIGNTOOL_EXE signtool
HINTS HINTS

View File

@@ -32,6 +32,7 @@ set(SRC
blender_viewport.cpp blender_viewport.cpp
CCL_api.h CCL_api.h
blender_device.h
blender_object_cull.h blender_object_cull.h
blender_sync.h blender_sync.h
blender_session.h blender_session.h

View File

@@ -41,9 +41,13 @@ if(WITH_CYCLES_STANDALONE)
endif() endif()
if(CYCLES_STANDALONE_REPOSITORY) if(CYCLES_STANDALONE_REPOSITORY)
list(APPEND INC_SYS ../../third_party/numaapi/include) list(APPEND INC_SYS
../../third_party/numaapi/include
)
else() else()
list(APPEND INC_SYS ../../numaapi/include) list(APPEND INC_SYS
../../numaapi/include
)
endif() endif()
set(SRC_HEADERS set(SRC_HEADERS
@@ -140,6 +144,7 @@ set(SRC_HEADERS
util_types_ushort4.h util_types_ushort4.h
util_types_vector3.h util_types_vector3.h
util_types_vector3_impl.h util_types_vector3_impl.h
util_unique_ptr.h
util_vector.h util_vector.h
util_version.h util_version.h
util_view.h util_view.h

View File

@@ -152,6 +152,7 @@ elseif(APPLE AND NOT WITH_X11)
intern/GHOST_DisplayManagerCocoa.h intern/GHOST_DisplayManagerCocoa.h
intern/GHOST_SystemCocoa.h intern/GHOST_SystemCocoa.h
intern/GHOST_WindowCocoa.h intern/GHOST_WindowCocoa.h
intern/GHOST_WindowViewCocoa.h
) )
if(NOT WITH_GL_EGL) if(NOT WITH_GL_EGL)
@@ -182,6 +183,7 @@ elseif(WITH_X11)
intern/GHOST_WindowX11.cpp intern/GHOST_WindowX11.cpp
intern/GHOST_DisplayManagerX11.h intern/GHOST_DisplayManagerX11.h
intern/GHOST_IconX11.h
intern/GHOST_SystemX11.h intern/GHOST_SystemX11.h
intern/GHOST_TaskbarX11.h intern/GHOST_TaskbarX11.h
intern/GHOST_WindowX11.h intern/GHOST_WindowX11.h

View File

@@ -38,6 +38,10 @@ set(SRC
# only so the header is known by cmake # only so the header is known by cmake
../atomic/atomic_ops.h ../atomic/atomic_ops.h
../atomic/intern/atomic_ops_ext.h
../atomic/intern/atomic_ops_msvc.h
../atomic/intern/atomic_ops_unix.h
../atomic/intern/atomic_ops_utils.h
) )
set(LIB set(LIB

View File

@@ -90,6 +90,7 @@ set(SRC
../include/ED_transverts.h ../include/ED_transverts.h
../include/ED_types.h ../include/ED_types.h
../include/ED_undo.h ../include/ED_undo.h
../include/ED_userpref.h
../include/ED_util.h ../include/ED_util.h
../include/ED_uvedit.h ../include/ED_uvedit.h
../include/ED_view3d.h ../include/ED_view3d.h

View File

@@ -92,6 +92,7 @@ set(SRC
${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c ${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
${SRC_DNA_INC} ${SRC_DNA_INC}
dna_rename_defs.h
dna_utils.h dna_utils.h
) )
@@ -132,6 +133,7 @@ set(SRC
../DNA_cachefile_defaults.h ../DNA_cachefile_defaults.h
../DNA_camera_defaults.h ../DNA_camera_defaults.h
../DNA_curve_defaults.h ../DNA_curve_defaults.h
../DNA_defaults.h
../DNA_image_defaults.h ../DNA_image_defaults.h
../DNA_lattice_defaults.h ../DNA_lattice_defaults.h
../DNA_light_defaults.h ../DNA_light_defaults.h
@@ -142,9 +144,11 @@ set(SRC
../DNA_meta_defaults.h ../DNA_meta_defaults.h
../DNA_object_defaults.h ../DNA_object_defaults.h
../DNA_scene_defaults.h ../DNA_scene_defaults.h
../DNA_speaker_defaults.h
../DNA_texture_defaults.h ../DNA_texture_defaults.h
../DNA_vec_defaults.h ../DNA_vec_defaults.h
../DNA_view3d_defaults.h ../DNA_view3d_defaults.h
../DNA_world_defaults.h
) )
set(LIB set(LIB

View File

@@ -174,7 +174,7 @@ set(INC
../../../../intern/clog ../../../../intern/clog
# Needed for defaults forward declarations. # Needed for defaults forward declarations.
../../../blender/blenloader ../../blenloader
${CMAKE_BINARY_DIR}/source/blender/makesdna/intern ${CMAKE_BINARY_DIR}/source/blender/makesdna/intern
) )

View File

@@ -100,6 +100,8 @@ set(SRC
wm_event_types.h wm_event_types.h
wm_files.h wm_files.h
wm_window.h wm_window.h
intern/wm_platform_support.h
intern/wm_window_private.h
gizmo/WM_gizmo_api.h gizmo/WM_gizmo_api.h
gizmo/WM_gizmo_types.h gizmo/WM_gizmo_types.h
gizmo/wm_gizmo_fn.h gizmo/wm_gizmo_fn.h

View File

@@ -28,9 +28,9 @@ set(TEST_OUT_DIR ${CMAKE_BINARY_DIR}/tests)
file(MAKE_DIRECTORY ${TEST_OUT_DIR}) file(MAKE_DIRECTORY ${TEST_OUT_DIR})
file(MAKE_DIRECTORY ${TEST_OUT_DIR}/io_tests) file(MAKE_DIRECTORY ${TEST_OUT_DIR}/io_tests)
#~ if(NOT IS_DIRECTORY ${TEST_SRC_DIR}) # if(NOT IS_DIRECTORY ${TEST_SRC_DIR})
#~ message(FATAL_ERROR "CMake test directory not found!") # message(FATAL_ERROR "CMake test directory not found!")
#~ endif() # endif()
# Run Blender command with parameters. # Run Blender command with parameters.
function(add_blender_test testname) function(add_blender_test testname)

View File

@@ -29,9 +29,9 @@ set(TEST_OUT_DIR ${CMAKE_BINARY_DIR}/tests)
# ugh, any better way to do this on testing only? # ugh, any better way to do this on testing only?
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_OUT_DIR}) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_OUT_DIR})
#~ if(NOT IS_DIRECTORY ${TEST_SRC_DIR}) # if(NOT IS_DIRECTORY ${TEST_SRC_DIR})
#~ message(FATAL_ERROR "CMake test directory not found!") # message(FATAL_ERROR "CMake test directory not found!")
#~ endif() # endif()
# all calls to blender use this # all calls to blender use this
if(APPLE) if(APPLE)
@@ -61,5 +61,6 @@ endmacro()
# Tests are disabled because they only work on Windows # Tests are disabled because they only work on Windows
# Tests will be redone completely to work reliable # Tests will be redone completely to work reliable
#
# COLLADA_TEST(mesh simple mesh_simple.blend) # COLLADA_TEST(mesh simple mesh_simple.blend)
# COLLADA_TEST(animation simple suzannes_parent_inverse.blend) # COLLADA_TEST(animation simple suzannes_parent_inverse.blend)

View File

@@ -25,9 +25,9 @@ set(TEST_OUT_DIR ${CMAKE_BINARY_DIR}/tests)
# ugh, any better way to do this on testing only? # ugh, any better way to do this on testing only?
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_OUT_DIR}) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_OUT_DIR})
#~ if(NOT IS_DIRECTORY ${TEST_SRC_DIR}) # if(NOT IS_DIRECTORY ${TEST_SRC_DIR})
#~ message(FATAL_ERROR "CMake test directory not found!") # message(FATAL_ERROR "CMake test directory not found!")
#~ endif() # endif()
# for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no # for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no
set(TEST_BLENDER_EXE $<TARGET_FILE:blender> --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts) set(TEST_BLENDER_EXE $<TARGET_FILE:blender> --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)