edits to cycles cmake files so cmake_consistency_check.py can parse them.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 8 Nov 2011 20:27:37 +0000 (20:27 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 8 Nov 2011 20:27:37 +0000 (20:27 +0000)
14 files changed:
build_files/cmake/cmake_consistency_check.py
intern/cycles/CMakeLists.txt
intern/cycles/app/CMakeLists.txt
intern/cycles/blender/CMakeLists.txt
intern/cycles/bvh/CMakeLists.txt
intern/cycles/device/CMakeLists.txt
intern/cycles/doc/CMakeLists.txt
intern/cycles/doc/license/CMakeLists.txt
intern/cycles/kernel/CMakeLists.txt
intern/cycles/kernel/osl/CMakeLists.txt
intern/cycles/kernel/osl/nodes/CMakeLists.txt
intern/cycles/render/CMakeLists.txt
intern/cycles/subd/CMakeLists.txt
intern/cycles/util/CMakeLists.txt

index b1fc88bfe266a0390fd9ce15aa75631e074c90c1..6fdd178929b8f89b8ae1ccb5233dba978af53b58 100755 (executable)
@@ -172,6 +172,12 @@ def cmake_get_src(f):
                                 pass
                             elif new_file.endswith(".def"):
                                 pass
+                            elif new_file.endswith(".cl"):  # opencl
+                                pass
+                            elif new_file.endswith(".cu"):  # cuda
+                                pass
+                            elif new_file.endswith(".osl"):  # open shading language
+                                pass
                             else:
                                 raise Exception("unknown file type - not c or h %s -> %s" % (f, new_file))
 
index d014326fcd55d5b11ec55ae1abc7d1b67e7357c2..b0507d90d4cbb3fc61b0d1061b179b214ebd2630 100644 (file)
@@ -1,6 +1,6 @@
 
 set(CYCLES_INSTALL_PATH "scripts/addons/cycles")
-SET(WITH_CYCLES_BLENDER ON)
+set(WITH_CYCLES_BLENDER ON)
 
 # External Libraries
 
@@ -14,7 +14,7 @@ set(GCC_OPTIM_FLAGS "-ffast-math -msse -msse2 -msse3 -mtune=native")
 if(APPLE)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}")
        set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
-endif(APPLE)
+endif()
 
 if(WIN32)
        if(MSVC)
@@ -24,12 +24,12 @@ if(WIN32)
                set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}")
                set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
        endif()
-endif(WIN32)
+endif()
 
 if(UNIX AND NOT APPLE)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}")
        set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
-endif(UNIX AND NOT APPLE)
+endif()
 
 # Definitions and Includes
 
@@ -73,4 +73,3 @@ add_subdirectory(kernel)
 add_subdirectory(render)
 add_subdirectory(subd)
 add_subdirectory(util)
-
index ef6a80fbe5d2ff6a73c1fa8ea843ef45b5b8c61a..2e2897d0443e4a00f0e7ad35de166d023da313a9 100644 (file)
@@ -1,5 +1,5 @@
 
-include_directories(
+set(INC
        .
        ../device
        ../kernel
@@ -7,7 +7,8 @@ include_directories(
        ../bvh
        ../util
        ../render
-       ../subd)
+       ../subd
+)
 
 set(LIBRARIES
        cycles_device
@@ -19,7 +20,8 @@ set(LIBRARIES
        ${BOOST_LIBRARIES}
        ${OPENGL_LIBRARIES}
        ${CYCLES_GLEW_LIBRARY}
-       ${OPENIMAGEIO_LIBRARIES})
+       ${OPENIMAGEIO_LIBRARIES}
+)
 
 link_directories(${OPENIMAGEIO_LIBPATH} ${BOOST_LIBPATH})
 
@@ -35,21 +37,33 @@ if(WITH_CYCLES_PARTIO)
        list(APPEND LIBRARIES ${PARTIO_LIBRARIES})
 endif()
 
+include_directories(${INC})
+
 if(WITH_CYCLES_TEST)
-       add_executable(cycles_test cycles_test.cpp cycles_xml.cpp cycles_xml.h)
+       set(SRC
+               cycles_test.cpp
+               cycles_xml.cpp
+               cycles_xml.h
+       )
+       add_executable(cycles_test ${SRC})
        target_link_libraries(cycles_test ${LIBRARIES})
 
        if(UNIX AND NOT APPLE)
                set_target_properties(cycles_test PROPERTIES INSTALL_RPATH $ORIGIN/lib)
        endif()
+       unset(SRC)
 endif()
 
 if(WITH_CYCLES_NETWORK)
-       add_executable(cycles_server cycles_server.cpp)
+       set(SRC
+               cycles_server.cpp
+       )
+       add_executable(cycles_server ${SRC})
        target_link_libraries(cycles_server ${LIBRARIES})
 
        if(UNIX AND NOT APPLE)
                set_target_properties(cycles_server PROPERTIES INSTALL_RPATH $ORIGIN/lib)
        endif()
+       unset(SRC)
 endif()
 
index a4f290f4abdebc4b467833e0fd5924b92c6f1180..f3da1a30eb2665681d62e7239d0f9209385c8673 100644 (file)
@@ -1,5 +1,21 @@
 
-set(sources
+set(INC
+       ../render
+       ../device
+       ../kernel
+       ../kernel/svm
+       ../util
+       ../subd
+)
+
+set(INC_SYS
+       ${BLENDER_INCLUDE_DIRS}
+       ${PYTHON_INCLUDE_DIRS}
+       ${GLEW_INCLUDE_PATH}
+)
+
+
+set(SRC
        blender_camera.cpp
        blender_mesh.cpp
        blender_object.cpp
@@ -10,30 +26,22 @@ set(sources
 
        blender_sync.h
        blender_session.h
-       blender_util.h)
+       blender_util.h
+)
 
-set(addonfiles
+set(ADDON_FILES
        addon/__init__.py
        addon/engine.py 
        addon/enums.py
        addon/presets.py
        addon/properties.py
        addon/ui.py
-       addon/xml.py)
+       addon/xml.py
+)
 
-include_directories(
-       ../render
-       ../device
-       ../kernel
-       ../kernel/svm
-       ../util
-       ../subd
-       ${BLENDER_INCLUDE_DIRS}
-       ${PYTHON_INCLUDE_DIRS}
-       ${GLEW_INCLUDE_PATH})
+blender_add_lib(bf_intern_cycles "${SRC}" "${INC}" "${INC_SYS}")
 
-blender_add_lib(bf_intern_cycles "${sources}" "" "")
 add_dependencies(bf_intern_cycles bf_rna)
 
-delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${addonfiles}" ${CYCLES_INSTALL_PATH})
+delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${ADDON_FILES}" ${CYCLES_INSTALL_PATH})
 
index b35c20b7a3840f22faca5b9fa77afc2650b48818..decc576fe51e393c3874317c5d58a48b7cd4feae 100644 (file)
@@ -1,18 +1,28 @@
 
-include_directories(. ../kernel ../kernel/svm ../render ../util ../device)
+set(INC
+       .
+       ../kernel
+       ../kernel/svm
+       ../render
+       ../util
+       ../device
+)
 
-set(sources
+set(SRC
        bvh.cpp
        bvh_build.cpp
        bvh_node.cpp
-       bvh_sort.cpp)
+       bvh_sort.cpp
+)
 
-set(headers
+set(SRC_HEADERS
        bvh.h
        bvh_build.h
        bvh_node.h
        bvh_params.h
-       bvh_sort.h)
+       bvh_sort.h
+)
 
-add_library(cycles_bvh ${sources} ${headers})
+include_directories(${INC})
 
+add_library(cycles_bvh ${SRC} ${SRC_HEADERS})
index 3d8c2d5e2cdb4c2c4e238f77b870b13c9aaee931..e1fb44b92b43ce576439f5ea3088ec840b8f0c51 100644 (file)
@@ -1,5 +1,5 @@
 
-include_directories(
+set(INC
        .
        ../kernel
        ../kernel/svm
@@ -7,21 +7,26 @@ include_directories(
        ../util
        ../render
        ${OPENGL_INCLUDE_DIR}
-       ${GLEW_INCLUDE_PATH})
+       ${GLEW_INCLUDE_PATH}
+)
 
-set(sources
+set(SRC
        device.cpp
        device_cpu.cpp
        device_cuda.cpp
        device_multi.cpp
        device_network.cpp
-       device_opencl.cpp)
+       device_opencl.cpp
+)
 
-set(headers
+set(SRC_HEADERS
        device.h
        device_intern.h
-       device_network.h)
+       device_network.h
+)
 
 add_definitions(-DGLEW_STATIC)
-add_library(cycles_device ${sources} ${headers})
 
+include_directories(${INC})
+
+add_library(cycles_device ${SRC} ${SRC_HEADERS})
index 4ae0d12a06045813d8f145d08b21f6dc0fb935c4..a8d1b53b47e89c457fa630eed3bbc58262286d98 100644 (file)
@@ -1,3 +1,2 @@
 
 add_subdirectory(license)
-
index 14049d4a88a1d0426af37e6f372b5d66180c146c..bc11a9eb35bc7c87306ff21828e902cf873395de 100644 (file)
@@ -1,5 +1,5 @@
 
-set(licenses
+set(LICENSES
        Apache_2.0.txt
        Blender.txt
        GPL.txt
@@ -7,7 +7,7 @@ set(licenses
        NVidia.txt
        OSL.txt
        Sobol.txt
-       readme.txt)
-
-delayed_install(${CMAKE_CURRENT_SOURCE_DIR}  "${licenses}" ${CYCLES_INSTALL_PATH}/license)
+       readme.txt
+)
 
+delayed_install(${CMAKE_CURRENT_SOURCE_DIR}  "${LICENSES}" ${CYCLES_INSTALL_PATH}/license)
index 99427e02c54e57ec195702437393598226a1bb91..3a06aecdfcfd7b5a1cf1fd06df2b9ea63db75b74 100644 (file)
@@ -1,10 +1,18 @@
 
-set(sources
+set(INC
+       .
+       ../util
+       osl
+       svm
+)
+
+set(SRC
        kernel.cpp
        kernel.cl
-       kernel.cu)
+       kernel.cu
+)
 
-set(headers
+set(SRC_HEADERS
        kernel.h
        kernel_bvh.h
        kernel_camera.h
@@ -27,9 +35,10 @@ set(headers
        kernel_shader.h
        kernel_textures.h
        kernel_triangle.h
-       kernel_types.h)
+       kernel_types.h
+)
 
-set(svm_headers
+set(SRC_SVM_HEADERS
        svm/bsdf.h
        svm/bsdf_ashikhmin_velvet.h
        svm/bsdf_diffuse.h
@@ -66,13 +75,14 @@ set(svm_headers
        svm/svm_voronoi.h
        svm/svm_wave.h
        svm/volume.h
-       )
+)
 
-set(util_headers
+set(SRC_UTIL_HEADERS
        ../util/util_color.h
        ../util/util_math.h
        ../util/util_transform.h
-       ../util/util_types.h)
+       ../util/util_types.h
+)
 
 # OSL module
 
@@ -82,9 +92,9 @@ endif()
 
 # CPU module
 
-include_directories(. ../util osl svm)
+include_directories(${INC})
 
-add_library(cycles_kernel ${sources} ${headers} ${svm_headers})
+add_library(cycles_kernel ${SRC} ${SRC_HEADERS} ${SRC_SVM_HEADERS})
 
 if(WITH_CYCLES_CUDA)
        add_dependencies(cycles_kernel cycles_kernel_cuda)
@@ -92,17 +102,16 @@ endif()
 
 # OPENCL kernel
 
-#set(kernel_preprocessed ${CMAKE_CURRENT_BINARY_DIR}/kernel_preprocessed.cl)
+#set(KERNEL_PREPROCESSED ${CMAKE_CURRENT_BINARY_DIR}/kernel_preprocessed.cl)
 #add_custom_command(
-#      OUTPUT ${kernel_preprocessed}
-#      COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DWITH_OPENCL -o ${kernel_preprocessed}
-#      DEPENDS ${kernel_sources} ${util_headers})
-#add_custom_target(cycles_kernel_preprocess ALL DEPENDS ${kernel_preprocessed})
-#delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${kernel_preprocessed}" ${CYCLES_INSTALL_PATH}/kernel)
+#      OUTPUT ${KERNEL_PREPROCESSED}
+#      COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DWITH_OPENCL -o ${KERNEL_PREPROCESSED}
+#      DEPENDS ${SRC_KERNEL} ${SRC_UTIL_HEADERS})
+#add_custom_target(cycles_kernel_preprocess ALL DEPENDS ${KERNEL_PREPROCESSED})
+#delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${KERNEL_PREPROCESSED}" ${CYCLES_INSTALL_PATH}/kernel)
 
 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernel.cl" ${CYCLES_INSTALL_PATH}/kernel)
 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernel.cu" ${CYCLES_INSTALL_PATH}/kernel)
-delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${headers}" ${CYCLES_INSTALL_PATH}/kernel)
-delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${svm_headers}" ${CYCLES_INSTALL_PATH}/kernel/svm)
-delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${util_headers}" ${CYCLES_INSTALL_PATH}/kernel)
-
+delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel)
+delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SVM_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/svm)
+delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_UTIL_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel)
index 4a3a6f6798aa524078694cff460713e97979bd5c..b010bba4d2595eb9bc2ecfeea5ef2ef2fc746f9a 100644 (file)
@@ -1,7 +1,14 @@
 
-include_directories(. ../ ../svm ../../render ../../util ../../device)
+set(INC
+       .
+       ../
+       ../svm
+       ../../render
+       ../../util
+       ../../device
+)
 
-set(sources
+set(SRC
        background.cpp
        bsdf_ashikhmin_velvet.cpp
        bsdf_diffuse.cpp
@@ -17,17 +24,20 @@ set(sources
        osl_closures.cpp
        osl_services.cpp
        osl_shader.cpp
-       vol_subsurface.cpp)
+       vol_subsurface.cpp
+)
 
-set(headers
+set(HEADER_SRC
        osl_closures.h
        osl_globals.h
        osl_services.h
-       osl_shader.h)
+       osl_shader.h
+)
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
 
-add_library(cycles_kernel_osl ${sources} ${headers})
+include_directories(${INC})
 
-add_subdirectory(nodes)
+add_library(cycles_kernel_osl ${SRC} ${HEADER_SRC})
 
+add_subdirectory(nodes)
index 7d37bb09d7146f780274f5f7da04cbd9fc1c76bd..389638b671b1882dea6711439c3813629df1cd51 100644 (file)
@@ -1,7 +1,7 @@
 
 # OSL node shaders
 
-set(osl_sources
+set(SRC_OSL
        node_add_closure.osl
        node_attribute.osl
        node_background.osl
@@ -45,26 +45,35 @@ set(osl_sources
        node_velvet_bsdf.osl
        node_voronoi_texture.osl
        node_ward_bsdf.osl
-       node_wood_texture.osl)
+       node_wood_texture.osl
+)
 
-set(osl_headers
+set(SRC_OSL_HEADERS
        node_texture.h
-       stdosl.h)
+       stdosl.h
+)
 
-set(oso_sources)
+set(SRC_OSO
 
-foreach(_file ${osl_sources})
-       set(osl_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
-       string(REPLACE ".osl" ".oso" oso_file ${osl_file})
-       string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} oso_file ${oso_file})
+)
+
+# TODO, add a module to compile OSL
+foreach(_file ${SRC_OSL})
+       set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
+       string(REPLACE ".osl" ".oso" _OSO_FILE ${_OSL_FILE})  # TODO, replace extension only
+       string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE})
        add_custom_command(
-               OUTPUT ${oso_file} 
-               COMMAND ${OSL_COMPILER} -O2 ${osl_file}
-               DEPENDS ${osl_file} ${osl_headers})
-       list(APPEND oso_sources ${oso_file})
+               OUTPUT ${_OSO_FILE} 
+               COMMAND ${OSL_COMPILER} -O2 ${_OSL_FILE}
+               DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS})
+       list(APPEND SRC_OSO
+               ${_OSO_FILE}
+       )
+       
+       unset(_OSL_FILE)
+       unset(_OSO_FILE)
 endforeach()
 
-add_custom_target(shader ALL DEPENDS ${oso_sources} ${osl_headers})
-
-delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${oso_sources}" ${CYCLES_INSTALL_PATH}/shader)
+add_custom_target(shader ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS})
 
+delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader)
index 14859aa4414708a474f99b50bc9faf8c55619a9c..1dcd70bdf65184172af93a57fa82d6244e59f97e 100644 (file)
@@ -1,5 +1,5 @@
 
-include_directories(
+set(INC
        .
        ../device
        ../kernel
@@ -7,9 +7,10 @@ include_directories(
        ../kernel/osl
        ../bvh
        ../util
-       ${GLEW_INCLUDE_PATH})
+       ${GLEW_INCLUDE_PATH}
+)
 
-set(sources
+set(SRC
        attribute.cpp
        background.cpp
        buffers.cpp
@@ -30,9 +31,10 @@ set(sources
        shader.cpp
        sobol.cpp
        svm.cpp
-       tile.cpp)
+       tile.cpp
+)
 
-set(headers
+set(SRC_HEADERS
        attribute.h
        background.h
        buffers.h
@@ -52,9 +54,12 @@ set(headers
        shader.h
        sobol.h
        svm.h
-       tile.h)
+       tile.h
+)
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
 
-add_library(cycles_render ${sources} ${headers})
+include_directories(${INC})
+
+add_library(cycles_render ${SRC} ${SRC_HEADERS})
 
index 79ed73134f245b912cf23bbbbf8f2384d8bd18c3..75f70753ddfabcde54ba68eba077269f5d3703b1 100644 (file)
@@ -1,16 +1,23 @@
 
-include_directories(. ../util ../kernel ../kernel/svm ../render)
+set(INC
+       .
+       ../util
+       ../kernel
+       ../kernel/svm
+       ../render
+)
 
-set(sources
+set(SRC
        subd_build.cpp
        subd_dice.cpp
        subd_mesh.cpp
        subd_patch.cpp
        subd_ring.cpp
        subd_split.cpp
-       subd_stencil.cpp)
+       subd_stencil.cpp
+)
 
-set(headers
+set(SRC_HEADERS
        subd_build.h
        subd_dice.h
        subd_edge.h
@@ -20,7 +27,9 @@ set(headers
        subd_ring.h
        subd_split.h
        subd_stencil.h
-       subd_vert.h)
+       subd_vert.h
+)
 
-add_library(cycles_subd ${sources} ${headers})
+include_directories(${INC})
 
+add_library(cycles_subd ${SRC} ${SRC_HEADERS})
index a7f7c66350940df391eb695b495773b5ed50e710..da183aaaeb231aba45716ffdee7c8a80d9cc8914 100644 (file)
@@ -1,10 +1,11 @@
 
-include_directories(
+set(INC
        .
        ${GLEW_INCLUDE_PATH}
-       ${OPENGL_INCLUDE_DIR})
+       ${OPENGL_INCLUDE_DIR}
+)
 
-set(sources
+set(SRC
        util_cache.cpp
        util_cuda.cpp
        util_dynlib.cpp
@@ -15,13 +16,16 @@ set(sources
        util_string.cpp
        util_system.cpp
        util_time.cpp
-       util_transform.cpp)
+       util_transform.cpp
+)
 
 if(WITH_CYCLES_TEST)
-       list(APPEND sources util_view.cpp)
+       list(APPEND SRC
+               util_view.cpp
+       )
 endif()
 
-set(headers
+set(SRC_HEADERS
        util_algorithm.h
        util_args.h
        util_boundbox.h
@@ -51,7 +55,9 @@ set(headers
        util_types.h
        util_view.h
        util_vector.h
-       util_xml.h)
+       util_xml.h
+)
 
-add_library(cycles_util ${sources} ${headers})
+include_directories(${INC})
 
+add_library(cycles_util ${SRC} ${SRC_HEADERS})