summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2015-09-17 16:07:09 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2015-09-17 16:07:09 (GMT)
commit2ddf84b036f7d458bf2878db3ca36336c0ca7de7 (patch)
treee80c8889d9d198a72c6440e1b1486fd2bf827330 /src/CMakeLists.txt
parenta8bd6fa91e929a4b55d5041f71a48f499b893de3 (diff)
downloadhdf5-2ddf84b036f7d458bf2878db3ca36336c0ca7de7.zip
hdf5-2ddf84b036f7d458bf2878db3ca36336c0ca7de7.tar.gz
hdf5-2ddf84b036f7d458bf2878db3ca36336c0ca7de7.tar.bz2
[svn-r27817] Fix generated file dependencies
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt86
1 files changed, 46 insertions, 40 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ad116a0..3940c60 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -721,7 +721,6 @@ set (H5_PUBLIC_HEADERS
${H5Z_HDRS}
)
-
set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5private.h
${HDF5_SRC_DIR}/H5Aprivate.h
@@ -768,37 +767,13 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5win32defs.h
)
-#-----------------------------------------------------------------------------
-# Setup the H5Detect utility which generates H5Tinit with platform
-# specific type checks inside
-#-----------------------------------------------------------------------------
-add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
-TARGET_C_PROPERTIES (H5detect STATIC " " " ")
-if (MSVC OR MINGW)
- target_link_libraries (H5detect "ws2_32.lib")
-endif (MSVC OR MINGW)
-
-set (CMD $<TARGET_FILE:H5detect>)
-add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c
- COMMAND ${CMD}
- ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c
- DEPENDS H5detect
-)
-
-add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
-TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ")
-if (MSVC OR MINGW)
- target_link_libraries (H5make_libsettings "ws2_32.lib")
-endif (MSVC OR MINGW)
-
-set (CMD $<TARGET_FILE:H5make_libsettings>)
-add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
- COMMAND ${CMD}
- ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
- DEPENDS H5make_libsettings
- WORKING_DIRECTORY ${HDF5_BINARY_DIR}
+set (H5_GENERATED_HEADERS
+ ${HDF5_SRC_DIR}/H5Edefin.h
+ ${HDF5_SRC_DIR}/H5Einit.h
+ ${HDF5_SRC_DIR}/H5Epubgen.h
+ ${HDF5_SRC_DIR}/H5Eterm.h
+ ${HDF5_SRC_DIR}/H5version.h
+ ${HDF5_SRC_DIR}/H5overflow.h
)
if (HDF5_GENERATE_HEADERS)
@@ -831,6 +806,9 @@ if (HDF5_GENERATE_HEADERS)
COMMENT " Creating Assignment overflow macro"
)
+ add_custom_target(generate_precompiled DEPENDS
+ "${HDF5_SRC_DIR}/H5version.h;${HDF5_SRC_DIR}/H5overflow.h")
+
add_custom_target(run_perl_scripts ALL
DEPENDS ${HDF5_SRC_DIR}/H5Edefin.h ${HDF5_SRC_DIR}/H5version.h ${HDF5_SRC_DIR}/H5overflow.h
)
@@ -840,19 +818,47 @@ if (HDF5_GENERATE_HEADERS)
endif (HDF5_GENERATE_HEADERS)
#-----------------------------------------------------------------------------
+# Setup the H5Detect utility which generates H5Tinit with platform
+# specific type checks inside
+#-----------------------------------------------------------------------------
+add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
+TARGET_C_PROPERTIES (H5detect STATIC " " " ")
+if (MSVC OR MINGW)
+ target_link_libraries (H5detect "ws2_32.lib")
+endif (MSVC OR MINGW)
+add_dependencies(H5detect generate_precompiled)
+
+set (CMD $<TARGET_FILE:H5detect>)
+add_custom_command (
+ OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c
+ COMMAND ${CMD}
+ ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c
+ DEPENDS H5detect
+)
+
+add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
+TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ")
+if (MSVC OR MINGW)
+ target_link_libraries (H5make_libsettings "ws2_32.lib")
+endif (MSVC OR MINGW)
+add_dependencies(H5make_libsettings generate_precompiled)
+
+set (CMD $<TARGET_FILE:H5make_libsettings>)
+add_custom_command (
+ OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
+ COMMAND ${CMD}
+ ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
+ DEPENDS H5make_libsettings
+ WORKING_DIRECTORY ${HDF5_BINARY_DIR}
+)
+
+#-----------------------------------------------------------------------------
# Add H5Tinit source to build - generated by H5Detect/CMake at configure time
#-----------------------------------------------------------------------------
set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c)
set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c)
-set (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5Edefin.h)
-set (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5Einit.h)
-set (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5Epubgen.h)
-set (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5Eterm.h)
-set (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5version.h)
-set (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5overflow.h)
-
-add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS})
+add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ")
target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS})
if (NOT WIN32)