cmake: share the DNA_*.h list definition between makesrna and makesdna
authorCampbell Barton <ideasman42@gmail.com>
Fri, 7 Jan 2011 11:08:47 +0000 (11:08 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 7 Jan 2011 11:08:47 +0000 (11:08 +0000)
source/blender/makesdna/CMakeLists.txt
source/blender/makesdna/intern/CMakeLists.txt
source/blender/makesrna/intern/CMakeLists.txt

index e02b33b..b1e1b58 100644 (file)
 #
 # ***** END GPL LICENSE BLOCK *****
 
+# Use PARENT_SCOPE so makesrna can access.
+set(SRC_DNA_INC
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_ID.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_action_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_actuator_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_anim_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_armature_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_boid_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_brush_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_camera_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_cloth_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_color_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_constraint_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_controller_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_curve_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_customdata_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_documentation.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_effect_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_fileglobal_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_genfile.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_gpencil_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_group_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_image_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_ipo_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_key_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_lamp_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_lattice_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_listBase.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_material_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_mesh_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_meshdata_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_meta_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_modifier_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_nla_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_node_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_object_fluidsim.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_object_force.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_object_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_outliner_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_packedFile_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_particle_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_property_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_scene_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_screen_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_sdna_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_sensor_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_sequence_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_smoke_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_sound_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_space_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_text_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_texture_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_userdef_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_vec_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_vfont_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_view2d_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_view3d_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_windowmanager_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/DNA_world_types.h
+
+       PARENT_SCOPE
+)
+
 add_subdirectory(intern)
index 55a6a3c..ba9e7d3 100644 (file)
@@ -44,65 +44,7 @@ if(WIN32 AND NOT UNIX)
        )
 endif()
 
-set(SRC_DNA_INC
-       ../DNA_ID.h
-       ../DNA_action_types.h
-       ../DNA_actuator_types.h
-       ../DNA_anim_types.h
-       ../DNA_armature_types.h
-       ../DNA_boid_types.h
-       ../DNA_brush_types.h
-       ../DNA_camera_types.h
-       ../DNA_cloth_types.h
-       ../DNA_color_types.h
-       ../DNA_constraint_types.h
-       ../DNA_controller_types.h
-       ../DNA_curve_types.h
-       ../DNA_customdata_types.h
-       ../DNA_documentation.h
-       ../DNA_effect_types.h
-       ../DNA_fileglobal_types.h
-       ../DNA_genfile.h
-       ../DNA_gpencil_types.h
-       ../DNA_group_types.h
-       ../DNA_image_types.h
-       ../DNA_ipo_types.h
-       ../DNA_key_types.h
-       ../DNA_lamp_types.h
-       ../DNA_lattice_types.h
-       ../DNA_listBase.h
-       ../DNA_material_types.h
-       ../DNA_mesh_types.h
-       ../DNA_meshdata_types.h
-       ../DNA_meta_types.h
-       ../DNA_modifier_types.h
-       ../DNA_nla_types.h
-       ../DNA_node_types.h
-       ../DNA_object_fluidsim.h
-       ../DNA_object_force.h
-       ../DNA_object_types.h
-       ../DNA_outliner_types.h
-       ../DNA_packedFile_types.h
-       ../DNA_particle_types.h
-       ../DNA_property_types.h
-       ../DNA_scene_types.h
-       ../DNA_screen_types.h
-       ../DNA_sdna_types.h
-       ../DNA_sensor_types.h
-       ../DNA_sequence_types.h
-       ../DNA_smoke_types.h
-       ../DNA_sound_types.h
-       ../DNA_space_types.h
-       ../DNA_text_types.h
-       ../DNA_texture_types.h
-       ../DNA_userdef_types.h
-       ../DNA_vec_types.h
-       ../DNA_vfont_types.h
-       ../DNA_view2d_types.h
-       ../DNA_view3d_types.h
-       ../DNA_windowmanager_types.h
-       ../DNA_world_types.h
-)
+# SRC_DNA_INC is defined in the parent dir
 
 add_executable(makesdna ${SRC} ${SRC_DNA_INC})
 
index ecb0d90..3a6496f 100644 (file)
@@ -38,6 +38,12 @@ list(REMOVE_ITEM DEFSRC ${APISRC})
 string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
 set_source_files_properties(GENSRC PROPERTIES GENERATED true)
 
+set(SRC_RNA_INC
+       ../RNA_access.h
+       ../RNA_define.h
+       ../RNA_enum_types.h
+       ../RNA_types.h
+)
 
 set(SRC
        makesrna.c
@@ -48,27 +54,9 @@ set(SRC
        ../../../../intern/guardedalloc/intern/mmap_win.c
 )
 
-blender_include_dirs(
-       ../../../../intern/audaspace/intern
-       ../../../../intern/guardedalloc
-       ../../../../intern/memutil
-       ..
-       ../../makesdna
-       ../../blenkernel
-       ../../blenlib
-       ../../blenfont
-       ../../ikplugin
-       ../../windowmanager
-       ../../editors/include
-       ../../gpu
-       ../../imbuf
-       ../../render/extern/include
-       ../../../../extern/glew/include
-       .
+set(INC
 )
 
-file(GLOB INC_FILES ../*.h ../../makesdna/*.h)
-
 if(WITH_PYTHON)
        add_definitions(-DWITH_PYTHON)
 endif()
@@ -137,7 +125,26 @@ if(WITH_JACK)
 endif()
 
 # Build makesrna executable
-add_executable(makesrna ${SRC} ${INC_FILES})
+blender_include_dirs(
+       .
+       ..
+       ../../blenkernel
+       ../../blenlib
+       ../../blenfont
+       ../../gpu
+       ../../imbuf
+       ../../ikplugin
+       ../../makesdna
+       ../../windowmanager
+       ../../editors/include
+       ../../render/extern/include
+       ../../../../extern/glew/include
+       ../../../../intern/audaspace/intern
+       ../../../../intern/guardedalloc
+       ../../../../intern/memutil
+)
+
+add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
 target_link_libraries(makesrna bf_dna)
 
 # Output rna_*_gen.c
@@ -153,11 +160,7 @@ set(SRC
        rna_access.c
        ${GENSRC}
 
-       ../RNA_access.h
-       ../RNA_define.h
-       ../RNA_enum_types.h
-       ../RNA_types.h
-
+       ${SRC_RNA_INC}
        rna_internal.h
        rna_internal_types.h
        rna_nodetree_types.h