Adding some of the previous configure options

This commit is contained in:
Alex Lin 2019-11-07 11:18:24 -06:00
parent 0cbbb37a73
commit 4d85ddb47a
6 changed files with 27 additions and 18 deletions

View File

@ -4,12 +4,18 @@ set(TRICK_MAJOR 19)
set(TRICK_MINOR 1)
set(TRICK_TINY dev)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
set(TRICK_FORCE_32BIT OFF CACHE BOOL "Set Trick to compile in 32bit mode")
#set(USE_JAVA ON CACHE BOOL "Use java")
set(USE_ER7_UTILS ON CACHE BOOL "Use er7_utils")
set(UDUNITS2_ROOT "" CACHE STRING "UDUNITS home directory")
message("UDUNITS2_ROOT = ${UDUNITS2_ROOT}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib64)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib64)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
include(UseJava)
find_package(Java REQUIRED)
find_package(BISON REQUIRED)
@ -27,7 +33,10 @@ find_package(HDF5)
find_package(GSL)
add_definitions( -DTRICK_VER=${TRICK_MAJOR} )
add_definitions( -DUSE_ER7_UTILS_INTEGRATORS)
if(USE_ER7_UTILS)
add_definitions( -DUSE_ER7_UTILS_INTEGRATORS)
endif()
if(GSL_FOUND)
add_definitions( -D_HAVE_GSL)
@ -44,14 +53,18 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lex_yacc)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mongoose)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/swig)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/share/trick/makefiles/config_user.mk.in ${CMAKE_CURRENT_BINARY_DIR}/share/trick/makefiles/config_user.mk)
file(GLOB_RECURSE ER7_UTIL_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/trick_source/er7_utils ${CMAKE_CURRENT_SOURCE_DIR}/trick_source/er7_utils/*.hh)
foreach ( infile ${ER7_UTIL_HEADERS} )
get_filename_component(dir ${infile} DIRECTORY)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/trick_source/er7_utils/${infile} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/include/er7_utils/${dir}")
endforeach(infile)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/share/trick/makefiles/config_user.mk.in ${CMAKE_CURRENT_BINARY_DIR}/share/trick/makefiles/config_user.mk)
###############################################################
# mongoose lib
###############################################################
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/mongoose/mongoose.h
COMMAND curl --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/6.16/mongoose.h
@ -65,10 +78,6 @@ add_custom_command(
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/mongoose/mongoose.h
)
###############################################################
# mongoose lib
###############################################################
add_library(mongoose STATIC ${CMAKE_CURRENT_BINARY_DIR}/mongoose/mongoose.c)
target_include_directories( mongoose PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include/mongoose )
@ -100,11 +109,10 @@ set ( ICG_SRC
trick_source/sim_services/UdUnits/map_trick_units_to_udunits
)
add_definitions( -g -DTRICK_VERSION="${TRICK_MAJOR}.${TRICK_MINOR}.${TRICK_TINY}" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS)
add_definitions( -DLIBCLANG_MAJOR=${LLVM_VERSION_MAJOR} -DLIBCLANG_MINOR=${LLVM_VERSION_MINOR})
add_definitions( -DLIBCLANG_MAJOR=7 -DLIBCLANG_MINOR=0)
add_executable( trick-ICG ${ICG_SRC} )
target_compile_options( trick-ICG PUBLIC -g -DTRICK_VERSION="${TRICK_MAJOR}.${TRICK_MINOR}.${TRICK_TINY}" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS)
target_compile_options( trick-ICG PUBLIC -DLIBCLANG_MAJOR=${LLVM_VERSION_MAJOR} -DLIBCLANG_MINOR=${LLVM_VERSION_MINOR})
target_include_directories( trick-ICG PUBLIC ${UDUNITS2_INCLUDES} )
target_include_directories( trick-ICG PUBLIC ${LLVM_INCLUDE_DIR} )
target_include_directories( trick-ICG PUBLIC include )

View File

@ -5,6 +5,7 @@
# UDUNITS2_LIBRARIES - libraries to link with
# UDUNITS2_FOUND - True if UDUNITS2 was found.
message(STATUS "UDUNITS2_ROOT = ${UDUNITS2_ROOT}")
if (UDUNITS2_INCLUDES)
# Already in cache, be silent
set (UDUNITS2_FIND_QUIETLY TRUE)
@ -67,7 +68,7 @@ set(CMAKE_REQUIRED_LIBRARIES ${UDUNITS2_LIBRARIES})
check_c_source_runs("${UDUNITS2_TEST_SRC}" UDUNITS2_WORKS_WITHOUT_EXPAT)
if(${UDUNITS2_WORKS_WITHOUT_EXPAT})
message(STATUS "UDUNITS-2 does not require expat")
#message(STATUS "UDUNITS-2 does not require expat")
else()
find_package(EXPAT REQUIRED)
@ -79,7 +80,7 @@ else()
message(FATAL_ERROR "UDUNITS-2 does not seem to work with or without expat")
endif()
message(STATUS "UDUNITS-2 requires EXPAT")
#message(STATUS "UDUNITS-2 requires EXPAT")
set (UDUNITS2_LIBRARIES "${UDUNITS2_LIBRARIES};${EXPAT_LIBRARIES}" CACHE STRING "" FORCE)
endif()

View File

@ -70,7 +70,7 @@ sub gte (@) {
if ( $system_type eq "Linux" ) {
$def{"TRICK_HOST_CPU"} = $system_type . "_" . $gcc_version ;
$machine_hardware = `uname -m` ;
if ( (! exists $ENV{"TRICK_FORCE_32BIT"} or $ENV{"TRICK_FORCE_32BIT"} == 0) and $machine_hardware eq "x86_64\n") {
if ( (! exists $ENV{"TRICK_FORCE_32BIT"} or $ENV{"TRICK_FORCE_32BIT"} == "OFF") and $machine_hardware eq "x86_64\n") {
$def{"TRICK_HOST_CPU"} .= "_x86_64" ;
}
}
@ -86,7 +86,7 @@ sub gte (@) {
$def{"TRICK_DEBUG"} = "0" ;
$def{"TRICK_EDITOR"} = "" ;
$def{"TRICK_EXEC_LINK_LIBS"} = "" ;
$def{"TRICK_FORCE_32BIT"} = "0" ;
$def{"TRICK_FORCE_32BIT"} = "OFF" ;
$def{"TRICK_GTE_EXT"} = "" ;
$def{"TRICK_HOME"} = "$trick_home" ;
$def{"TRICK_HOST_CPU_USER_SUFFIX"} = "" ;

View File

@ -112,7 +112,7 @@ ifeq ($(USE_ER7_UTILS), 1)
endif
endif
ifeq ($(TRICK_FORCE_32BIT), 1)
ifeq ($(TRICK_FORCE_32BIT),ON)
TRICK_ICGFLAGS += -m32
TRICK_SYSTEM_CXXFLAGS += -m32
TRICK_SYSTEM_LDFLAGS += -m32

View File

@ -28,7 +28,7 @@ else
LIBS = -lrt
endif
ifeq ($(TRICK_FORCE_32BIT), 1)
ifeq ($(TRICK_FORCE_32BIT),ON)
FLAGS += -m32
endif

View File

@ -76,7 +76,7 @@ CPP_PRE_DEFS =
CPP_POST_DEFS =
CPPFLAGS = $(CPP_PRE_DEFS) $(TRICK_CFLAGS) $(CPP_POST_DEFS)
ifeq ($(TRICK_FORCE_32BIT), 1)
ifeq ($(TRICK_FORCE_32BIT),ON)
CPPFLAGS += -m32
endif