1 message( STATUS "Building external libraries. This may take awhile..." )
2 list(APPEND CMAKE_MESSAGE_INDENT " ")
3 # Set up basic environment variables
5 set( ENV{CC} ${CMAKE_C_COMPILER} )
6 set( ENV{CXX} ${CMAKE_CXX_COMPILER} )
7 set( ENV{FC} ${CMAKE_Fortran_COMPILER} )
8 set( ENV{FCFLAGS} ${CMAKE_Fortran_FLAGS} )
9 # set( ENV{F77} gfortran )
10 set( ENV{FFLAGS} ${CMAKE_Fortran_FLAGS} )
11 # set( ENV{LDFLAGS} -L$DIR/grib2/lib )
12 # set( ENV{CPPFLAGS} -I$DIR/grib2/include )
14 ################################################################################
18 ################################################################################
19 set( TARGET_FOLDER zlib-1.2.11 )
20 set( TAG_FILE ${INTERNAL_GRIB2_PATH}/include/zlib.h )
21 if ( NOT EXISTS "${TAG_FILE}" )
22 set( LOG_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_FOLDER}-configure.log )
23 message( STATUS "Configuring ${TARGET_FOLDER}...")
26 ./configure --prefix=${INTERNAL_GRIB2_PATH} --static
27 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_FOLDER}
28 OUTPUT_FILE ${LOG_FILE}
29 ERROR_FILE ${LOG_FILE}
31 RESULT_VARIABLE ${TARGET_FOLDER}_STATUS_CONF
33 if ( ${TARGET_FOLDER}_STATUS_CONF AND NOT ${TARGET_FOLDER}_STATUS_CONF EQUAL 0 )
34 message( FATAL_ERROR "Failed to configure ${TARGET_FOLDER}, see log file ${LOG_FILE} for more details" )
36 message( STATUS "Finished configuring ${TARGET_FOLDER}" )
39 set( LOG_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_FOLDER}-build.log )
40 message( STATUS "Building ${TARGET_FOLDER}...")
44 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_FOLDER}
45 OUTPUT_FILE ${LOG_FILE}
46 ERROR_FILE ${LOG_FILE}
48 RESULT_VARIABLE ${TARGET_FOLDER}_STATUS
50 if ( ${TARGET_FOLDER}_STATUS AND NOT ${TARGET_FOLDER}_STATUS EQUAL 0 AND NOT EXISTS "${TAG_FILE}" )
51 message( FATAL_ERROR "Failed to build ${TARGET_FOLDER}, see log file ${LOG_FILE} for more details" )
53 message( STATUS "Finished building ${TARGET_FOLDER}" )
56 message( STATUS "External ${TARGET_FOLDER} already built, skipping" )
59 ################################################################################
63 ################################################################################
64 set( TARGET_FOLDER libpng-1.6.37 )
65 set( TAG_FILE ${INTERNAL_GRIB2_PATH}/include/png.h )
66 if ( NOT EXISTS "${TAG_FILE}" )
67 set( LOG_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_FOLDER}-configure.log )
68 message( STATUS "Configuring ${TARGET_FOLDER}...")
71 ./configure --prefix=${INTERNAL_GRIB2_PATH} --disable-shared --with-zlib-prefix=${INTERNAL_GRIB2_PATH}/
72 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_FOLDER}
73 OUTPUT_FILE ${LOG_FILE}
74 ERROR_FILE ${LOG_FILE}
76 RESULT_VARIABLE ${TARGET_FOLDER}_STATUS_CONF
78 if ( ${TARGET_FOLDER}_STATUS_CONF AND NOT ${TARGET_FOLDER}_STATUS_CONF EQUAL 0 )
79 message( FATAL_ERROR "Failed to configure ${TARGET_FOLDER}, see log file ${LOG_FILE} for more details" )
81 message( STATUS "Finished configuring ${TARGET_FOLDER}" )
84 set( LOG_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_FOLDER}-build.log )
85 message( STATUS "Building ${TARGET_FOLDER}...")
89 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_FOLDER}
90 OUTPUT_FILE ${LOG_FILE}
91 ERROR_FILE ${LOG_FILE}
93 RESULT_VARIABLE ${TARGET_FOLDER}_STATUS
95 if ( ${TARGET_FOLDER}_STATUS AND NOT ${TARGET_FOLDER}_STATUS EQUAL 0 AND NOT EXISTS "${TAG_FILE}" )
96 message( FATAL_ERROR "Failed to build ${TARGET_FOLDER}, see log file ${LOG_FILE} for more details" )
98 message( STATUS "Finished building ${TARGET_FOLDER}" )
101 message( STATUS "External ${TARGET_FOLDER} already built, skipping" )
104 ################################################################################
107 ##!TODO This is "failing" due to automake-1.14 missing. Make this a clean build
109 ################################################################################
110 set( TARGET_FOLDER jasper-1.900.29 )
111 set( TAG_FILE ${INTERNAL_GRIB2_PATH}/include/jasper/jasper.h )
112 if ( NOT EXISTS "${TAG_FILE}" )
113 set( LOG_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_FOLDER}-configure.log )
114 message( STATUS "Configuring ${TARGET_FOLDER}...")
117 ./configure --prefix=${INTERNAL_GRIB2_PATH} --disable-shared
118 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_FOLDER}
119 OUTPUT_FILE ${LOG_FILE}
120 ERROR_FILE ${LOG_FILE}
121 # COMMAND_ECHO STDOUT
122 RESULT_VARIABLE ${TARGET_FOLDER}_STATUS_CONF
124 if ( ${TARGET_FOLDER}_STATUS_CONF AND NOT ${TARGET_FOLDER}_STATUS_CONF EQUAL 0 )
125 message( FATAL_ERROR "Failed to configure ${TARGET_FOLDER}, see log file ${LOG_FILE} for more details" )
127 message( STATUS "Finished configuring ${TARGET_FOLDER}" )
130 set( LOG_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_FOLDER}-build.log )
131 message( STATUS "Building ${TARGET_FOLDER}...")
135 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_FOLDER}
136 OUTPUT_FILE ${LOG_FILE}
137 ERROR_FILE ${LOG_FILE}
138 # COMMAND_ECHO STDOUT
139 RESULT_VARIABLE ${TARGET_FOLDER}_STATUS
141 if ( ${TARGET_FOLDER}_STATUS AND NOT ${TARGET_FOLDER}_STATUS EQUAL 0 AND NOT EXISTS "${TAG_FILE}" )
142 message( FATAL_ERROR "Failed to build ${TARGET_FOLDER}, see log file ${LOG_FILE} for more details" )
144 message( STATUS "Finished building ${TARGET_FOLDER}" )
147 message( STATUS "External ${TARGET_FOLDER} already built, skipping" )
149 list(POP_BACK CMAKE_MESSAGE_INDENT)