summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2015-09-09 19:36:47 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2015-09-09 19:36:47 (GMT)
commite040db8331952bc417b1aba78f1e6809028532f4 (patch)
tree56476f01132146ae0b0f5d9d51a563494744a9f2 /src/CMakeLists.txt
parent61090f2cc38cc8eaab75593dd48930acc2f5f1b1 (diff)
downloadhdf5-e040db8331952bc417b1aba78f1e6809028532f4.zip
hdf5-e040db8331952bc417b1aba78f1e6809028532f4.tar.gz
hdf5-e040db8331952bc417b1aba78f1e6809028532f4.tar.bz2
[svn-r27725] Add initial commands to properly build the generated files.
Added HDF5_GENERATE_HEADERS ON to cacheinit.cmake file. Tested: local linux
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt55
1 files changed, 32 insertions, 23 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dc6ba0a..d840c21 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -22,8 +22,8 @@ set (H5_HDRS
${HDF5_SRC_DIR}/hdf5.h
${HDF5_SRC_DIR}/H5api_adpt.h
${HDF5_SRC_DIR}/H5public.h
- ${HDF5_SRC_DIR}/H5version.h
- ${HDF5_SRC_DIR}/H5overflow.h
+ #${HDF5_SRC_DIR}/H5version.h
+ #${HDF5_SRC_DIR}/H5overflow.h
)
IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" )
@@ -133,12 +133,12 @@ set (H5E_SRCS
)
set (H5E_HDRS
- ${HDF5_SRC_DIR}/H5Edefin.h
- ${HDF5_SRC_DIR}/H5Einit.h
+ #${HDF5_SRC_DIR}/H5Edefin.h
+ #${HDF5_SRC_DIR}/H5Einit.h
${HDF5_SRC_DIR}/H5Epkg.h
- ${HDF5_SRC_DIR}/H5Epubgen.h
+ #${HDF5_SRC_DIR}/H5Epubgen.h
${HDF5_SRC_DIR}/H5Epublic.h
- ${HDF5_SRC_DIR}/H5Eterm.h
+ #${HDF5_SRC_DIR}/H5Eterm.h
)
IDE_GENERATED_PROPERTIES ("H5E" "${H5E_HDRS}" "${H5E_SRCS}" )
@@ -801,57 +801,66 @@ add_custom_command (
WORKING_DIRECTORY ${HDF5_BINARY_DIR}
)
-if (GENERATE_ERROR_HEADERS)
+if (HDF5_GENERATE_HEADERS)
find_package (Perl)
if (PERL_FOUND)
add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/H5Edefin.h
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5Edefin.h ${CMAKE_CURRENT_BINARY_DIR}/H5Einit.h ${CMAKE_CURRENT_BINARY_DIR}/H5Epubgen.h ${CMAKE_CURRENT_BINARY_DIR}/H5Eterm.h
PRE_BUILD
COMMAND ${PERL_EXECUTABLE}
- ARGS ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SOURCE_DIR}/src/H5err.txt
+ ARGS ${HDF5_SOURCE_DIR}/bin/make_err.pl ${HDF5_SOURCE_DIR}/src/H5err.txt
DEPENDS ${HDF5_SOURCE_DIR}/src/H5err.txt
COMMENT " Creating err header"
)
add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/H5version.h
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5version.h
PRE_BUILD
COMMAND ${PERL_EXECUTABLE}
- ARGS ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SOURCE_DIR}/src/H5vers.txt
+ ARGS ${HDF5_SOURCE_DIR}/bin/make_vers.pl ${HDF5_SOURCE_DIR}/src/H5vers.txt
DEPENDS ${HDF5_SOURCE_DIR}/src/H5vers.txt
COMMENT " Creating API version macro"
)
add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/H5overflow.h
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5overflow.h
PRE_BUILD
COMMAND ${PERL_EXECUTABLE}
- ARGS ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SOURCE_DIR}/src/H5overflow.txt
+ ARGS ${HDF5_SOURCE_DIR}/bin/make_overflow.pl ${HDF5_SOURCE_DIR}/src/H5overflow.txt
DEPENDS ${HDF5_SOURCE_DIR}/src/H5overflow.txt
COMMENT " Creating Assignment overflow macro"
)
add_custom_target(run_perl_scripts ALL
- DEPENDS ${HDF5_BINARY_DIR}/H5Edefin.h ${HDF5_BINARY_DIR}/H5version.h ${HDF5_BINARY_DIR}/H5overflow.h
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/H5Edefin.h ${CMAKE_CURRENT_BINARY_DIR}/H5version.h ${CMAKE_CURRENT_BINARY_DIR}/H5overflow.h
)
else (PERL_FOUND)
message (STATUS "Cannot generate headers - perl not found")
endif (PERL_FOUND)
-endif (GENERATE_ERROR_HEADERS)
+endif (HDF5_GENERATE_HEADERS)
#-----------------------------------------------------------------------------
# Add H5Tinit source to build - generated by H5Detect/CMake at configure time
#-----------------------------------------------------------------------------
set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c)
-set_source_files_properties (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED)
set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c)
-set_source_files_properties (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED)
-set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h)
-set_source_files_properties (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED)
-set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h)
-set_source_files_properties (${HDF5_BINARY_DIR}/H5version.h GENERATED)
-set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h)
-set_source_files_properties (${HDF5_BINARY_DIR}/H5overflow.h GENERATED)
+
+if (HDF5_GENERATE_HEADERS)
+ set (common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/H5Edefin.h)
+ set (common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/H5Einit.h)
+ set (common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/H5Epubgen.h)
+ set (common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/H5Eterm.h)
+ set (common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/H5version.h)
+ set (common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/H5overflow.h)
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})
+else (HDF5_GENERATE_HEADERS)
+ 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)
+endif (HDF5_GENERATE_HEADERS)
add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS})
TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ")