updated requrenments of cmake
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,83 +1,83 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
set(project FDVM)
|
set(project FDVM)
|
||||||
#set(CMAKE_C_STANDARD 11)
|
#set(CMAKE_C_STANDARD 11)
|
||||||
#also named as libSage++
|
#also named as libSage++
|
||||||
if (TARGET ${project})
|
if (TARGET ${project})
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif ()
|
||||||
project(${project})
|
project(${project})
|
||||||
message("processing ${project}")
|
message("processing ${project}")
|
||||||
|
|
||||||
# Read pathes to external sapfor directories
|
# Read pathes to external sapfor directories
|
||||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../paths.txt")
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../paths.txt")
|
||||||
message("Found paths.txt, using custom paths.")
|
message("Found paths.txt, using custom paths.")
|
||||||
FILE(STRINGS ../paths.txt SAPFOR_PATHS)
|
FILE(STRINGS ../paths.txt SAPFOR_PATHS)
|
||||||
else ()
|
else ()
|
||||||
message("Not found paths.txt, using default paths.")
|
message("Not found paths.txt, using default paths.")
|
||||||
FILE(STRINGS ../paths.default.txt SAPFOR_PATHS)
|
FILE(STRINGS ../paths.default.txt SAPFOR_PATHS)
|
||||||
endif ()
|
endif ()
|
||||||
foreach (NameAndValue ${SAPFOR_PATHS})
|
foreach (NameAndValue ${SAPFOR_PATHS})
|
||||||
# Strip leading spaces
|
# Strip leading spaces
|
||||||
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
||||||
# Find variable name
|
# Find variable name
|
||||||
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
||||||
# Find the value
|
# Find the value
|
||||||
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
||||||
# Set the variable, note the ../ because we are deeper than the file
|
# Set the variable, note the ../ because we are deeper than the file
|
||||||
set(${Name} "../${Value}")
|
set(${Name} "../${Value}")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
set(SOURCE_LIB
|
set(SOURCE_LIB
|
||||||
${sagepp_sources}/libSage++.cpp
|
${sagepp_sources}/libSage++.cpp
|
||||||
${sage_include_1}/libSage++.h)
|
${sage_include_1}/libSage++.h)
|
||||||
|
|
||||||
|
|
||||||
# if not default ${sagepp_sources} must be set in ../paths.txt
|
# if not default ${sagepp_sources} must be set in ../paths.txt
|
||||||
set(SOURCE_EXE
|
set(SOURCE_EXE
|
||||||
${fdvm_sources}/acc.cpp
|
${fdvm_sources}/acc.cpp
|
||||||
${fdvm_sources}/acc_across.cpp
|
${fdvm_sources}/acc_across.cpp
|
||||||
${fdvm_sources}/acc_across_analyzer.cpp
|
${fdvm_sources}/acc_across_analyzer.cpp
|
||||||
${fdvm_sources}/acc_analyzer.cpp
|
${fdvm_sources}/acc_analyzer.cpp
|
||||||
${fdvm_sources}/acc_data.cpp
|
${fdvm_sources}/acc_data.cpp
|
||||||
${fdvm_sources}/acc_f2c.cpp
|
${fdvm_sources}/acc_f2c.cpp
|
||||||
${fdvm_sources}/acc_f2c_handlers.cpp
|
${fdvm_sources}/acc_f2c_handlers.cpp
|
||||||
${fdvm_sources}/acc_rtc.cpp
|
${fdvm_sources}/acc_rtc.cpp
|
||||||
${fdvm_sources}/acc_rtc.cpp
|
${fdvm_sources}/acc_rtc.cpp
|
||||||
${fdvm_sources}/acc_utilities.cpp
|
${fdvm_sources}/acc_utilities.cpp
|
||||||
${fdvm_sources}/aks_analyzeLoops.cpp
|
${fdvm_sources}/aks_analyzeLoops.cpp
|
||||||
${fdvm_sources}/aks_structs.cpp
|
${fdvm_sources}/aks_structs.cpp
|
||||||
${fdvm_sources}/checkpoint.cpp
|
${fdvm_sources}/checkpoint.cpp
|
||||||
${fdvm_sources}/debug.cpp
|
${fdvm_sources}/debug.cpp
|
||||||
${fdvm_sources}/dvm.cpp
|
${fdvm_sources}/dvm.cpp
|
||||||
${fdvm_sources}/calls.cpp
|
${fdvm_sources}/calls.cpp
|
||||||
${fdvm_sources}/funcall.cpp
|
${fdvm_sources}/funcall.cpp
|
||||||
${fdvm_sources}/help.cpp
|
${fdvm_sources}/help.cpp
|
||||||
${fdvm_sources}/hpf.cpp
|
${fdvm_sources}/hpf.cpp
|
||||||
${fdvm_sources}/io.cpp
|
${fdvm_sources}/io.cpp
|
||||||
${fdvm_sources}/omp.cpp
|
${fdvm_sources}/omp.cpp
|
||||||
${fdvm_sources}/ompdebug.cpp
|
${fdvm_sources}/ompdebug.cpp
|
||||||
${fdvm_sources}/parloop.cpp
|
${fdvm_sources}/parloop.cpp
|
||||||
${fdvm_sources}/stmt.cpp)
|
${fdvm_sources}/stmt.cpp)
|
||||||
|
|
||||||
source_group (SageLib FILES ${SOURCE_LIB})
|
source_group (SageLib FILES ${SOURCE_LIB})
|
||||||
|
|
||||||
# if not default ${fdvm_include}, ${sage_include_1}, ${sage_include_2} must be set in ../paths.txt
|
# if not default ${fdvm_include}, ${sage_include_1}, ${sage_include_2} must be set in ../paths.txt
|
||||||
include_directories(${fdvm_include} ${sage_include_1} ${sage_include_2})
|
include_directories(${fdvm_include} ${sage_include_1} ${sage_include_2})
|
||||||
add_executable(FDVM ${SOURCE_EXE} ${SOURCE_LIB})
|
add_executable(FDVM ${SOURCE_EXE} ${SOURCE_LIB})
|
||||||
|
|
||||||
if (MSVC_IDE)
|
if (MSVC_IDE)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions("-D _CRT_SECURE_NO_WARNINGS")
|
add_definitions("-D _CRT_SECURE_NO_WARNINGS")
|
||||||
add_definitions("-D SYS5")
|
add_definitions("-D SYS5")
|
||||||
add_definitions("-D YYDEBUG")
|
add_definitions("-D YYDEBUG")
|
||||||
|
|
||||||
add_subdirectory(../SageOldSrc ${CMAKE_CURRENT_BINARY_DIR}/SageOldSrc)
|
add_subdirectory(../SageOldSrc ${CMAKE_CURRENT_BINARY_DIR}/SageOldSrc)
|
||||||
add_subdirectory(../SageNewSrc ${CMAKE_CURRENT_BINARY_DIR}/SageNewSrc)
|
add_subdirectory(../SageNewSrc ${CMAKE_CURRENT_BINARY_DIR}/SageNewSrc)
|
||||||
target_link_libraries(FDVM SageOldSrc SageNewSrc)
|
target_link_libraries(FDVM SageOldSrc SageNewSrc)
|
||||||
|
|||||||
@@ -1,66 +1,66 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
set(project Parser)
|
set(project Parser)
|
||||||
#set(CMAKE_C_STANDARD 11)
|
#set(CMAKE_C_STANDARD 11)
|
||||||
#also named as libSage++
|
#also named as libSage++
|
||||||
if (TARGET ${project})
|
if (TARGET ${project})
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif ()
|
||||||
project(${project})
|
project(${project})
|
||||||
message("processing ${project}")
|
message("processing ${project}")
|
||||||
|
|
||||||
# Read pathes to external sapfor directories
|
# Read pathes to external sapfor directories
|
||||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../paths.txt")
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../paths.txt")
|
||||||
message("Found paths.txt, using custom paths.")
|
message("Found paths.txt, using custom paths.")
|
||||||
FILE(STRINGS ../paths.txt SAPFOR_PATHS)
|
FILE(STRINGS ../paths.txt SAPFOR_PATHS)
|
||||||
else ()
|
else ()
|
||||||
message("Not found paths.txt, using default paths.")
|
message("Not found paths.txt, using default paths.")
|
||||||
FILE(STRINGS ../paths.default.txt SAPFOR_PATHS)
|
FILE(STRINGS ../paths.default.txt SAPFOR_PATHS)
|
||||||
endif ()
|
endif ()
|
||||||
foreach (NameAndValue ${SAPFOR_PATHS})
|
foreach (NameAndValue ${SAPFOR_PATHS})
|
||||||
# Strip leading spaces
|
# Strip leading spaces
|
||||||
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
||||||
# Find variable name
|
# Find variable name
|
||||||
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
||||||
# Find the value
|
# Find the value
|
||||||
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
||||||
# Set the variable, note the ../ because we are deeper than the file
|
# Set the variable, note the ../ because we are deeper than the file
|
||||||
set(${Name} "../${Value}")
|
set(${Name} "../${Value}")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
# if not default ${sagepp_sources} must be set in ../paths.txt
|
# if not default ${sagepp_sources} must be set in ../paths.txt
|
||||||
set(SOURCE_EXE
|
set(SOURCE_EXE
|
||||||
${parser_sources}/cftn.c
|
${parser_sources}/cftn.c
|
||||||
${parser_sources}/errors.c
|
${parser_sources}/errors.c
|
||||||
${parser_sources}/gram1.tab.c
|
${parser_sources}/gram1.tab.c
|
||||||
${parser_sources}/hash.c
|
${parser_sources}/hash.c
|
||||||
${parser_sources}/init.c
|
${parser_sources}/init.c
|
||||||
${parser_sources}/lexfdvm.c
|
${parser_sources}/lexfdvm.c
|
||||||
${parser_sources}/lists.c
|
${parser_sources}/lists.c
|
||||||
${parser_sources}/low_hpf.c
|
${parser_sources}/low_hpf.c
|
||||||
${parser_sources}/misc.c
|
${parser_sources}/misc.c
|
||||||
${parser_sources}/stat.c
|
${parser_sources}/stat.c
|
||||||
${parser_sources}/sym.c
|
${parser_sources}/sym.c
|
||||||
${parser_sources}/types.c
|
${parser_sources}/types.c
|
||||||
${parser_sources}/unparse_hpf.c
|
${parser_sources}/unparse_hpf.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# if not default ${fdvm_include}, ${sage_include_1}, ${sage_include_2} must be set in ../paths.txt
|
# if not default ${fdvm_include}, ${sage_include_1}, ${sage_include_2} must be set in ../paths.txt
|
||||||
include_directories(${fdvm_include} ${sage_include_1} ${sage_include_2})
|
include_directories(${fdvm_include} ${sage_include_1} ${sage_include_2})
|
||||||
add_executable(Parser ${SOURCE_EXE})
|
add_executable(Parser ${SOURCE_EXE})
|
||||||
|
|
||||||
if (MSVC_IDE)
|
if (MSVC_IDE)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions("-D __SPF")
|
add_definitions("-D __SPF")
|
||||||
add_definitions("-D _CRT_SECURE_NO_WARNINGS")
|
add_definitions("-D _CRT_SECURE_NO_WARNINGS")
|
||||||
add_definitions("-D SYS5")
|
add_definitions("-D SYS5")
|
||||||
add_definitions("-D YYDEBUG")
|
add_definitions("-D YYDEBUG")
|
||||||
|
|
||||||
add_subdirectory(../SageOldSrc ${CMAKE_CURRENT_BINARY_DIR}/SageOldSrc)
|
add_subdirectory(../SageOldSrc ${CMAKE_CURRENT_BINARY_DIR}/SageOldSrc)
|
||||||
target_link_libraries(Parser SageOldSrc)
|
target_link_libraries(Parser SageOldSrc)
|
||||||
|
|||||||
@@ -1,49 +1,49 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
set(project SageLib)
|
set(project SageLib)
|
||||||
#also named as libSage++
|
#also named as libSage++
|
||||||
if (TARGET ${project})
|
if (TARGET ${project})
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif ()
|
||||||
project(${project})
|
project(${project})
|
||||||
message("processing ${project}")
|
message("processing ${project}")
|
||||||
|
|
||||||
# Read pathes to external sapfor directories
|
# Read pathes to external sapfor directories
|
||||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../paths.txt")
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../paths.txt")
|
||||||
message("Found paths.txt, using custom paths.")
|
message("Found paths.txt, using custom paths.")
|
||||||
FILE(STRINGS ../paths.txt SAPFOR_PATHS)
|
FILE(STRINGS ../paths.txt SAPFOR_PATHS)
|
||||||
else ()
|
else ()
|
||||||
message("Not found paths.txt, using default paths.")
|
message("Not found paths.txt, using default paths.")
|
||||||
FILE(STRINGS ../paths.default.txt SAPFOR_PATHS)
|
FILE(STRINGS ../paths.default.txt SAPFOR_PATHS)
|
||||||
endif ()
|
endif ()
|
||||||
foreach (NameAndValue ${SAPFOR_PATHS})
|
foreach (NameAndValue ${SAPFOR_PATHS})
|
||||||
# Strip leading spaces
|
# Strip leading spaces
|
||||||
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
||||||
# Find variable name
|
# Find variable name
|
||||||
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
||||||
# Find the value
|
# Find the value
|
||||||
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
||||||
# Set the variable, note the ../ because we are deeper than the file
|
# Set the variable, note the ../ because we are deeper than the file
|
||||||
set(${Name} "../${Value}")
|
set(${Name} "../${Value}")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
# if not default ${sagepp_sources} must be set in ../paths.txt
|
# if not default ${sagepp_sources} must be set in ../paths.txt
|
||||||
set(SOURCE_LIB
|
set(SOURCE_LIB
|
||||||
${sagepp_sources}/libSage++.cpp
|
${sagepp_sources}/libSage++.cpp
|
||||||
${sage_include_1}/libSage++.h
|
${sage_include_1}/libSage++.h
|
||||||
)
|
)
|
||||||
|
|
||||||
# if not default ${fdvm_include}, ${sage_include_1}, ${sage_include_2} must be set in ../paths.txt
|
# if not default ${fdvm_include}, ${sage_include_1}, ${sage_include_2} must be set in ../paths.txt
|
||||||
include_directories(${fdvm_include} ${sage_include_1} ${sage_include_2})
|
include_directories(${fdvm_include} ${sage_include_1} ${sage_include_2})
|
||||||
add_library(SageLib STATIC ${SOURCE_LIB})
|
add_library(SageLib STATIC ${SOURCE_LIB})
|
||||||
|
|
||||||
add_subdirectory(../SageOldSrc ${CMAKE_CURRENT_BINARY_DIR}/SageOldSrc)
|
add_subdirectory(../SageOldSrc ${CMAKE_CURRENT_BINARY_DIR}/SageOldSrc)
|
||||||
target_link_libraries(SageLib SageOldSrc)
|
target_link_libraries(SageLib SageOldSrc)
|
||||||
|
|
||||||
if (MSVC_IDE)
|
if (MSVC_IDE)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
set(project SageNewSrc)
|
set(project SageNewSrc)
|
||||||
#set(CMAKE_C_STANDARD 11)
|
#set(CMAKE_C_STANDARD 11)
|
||||||
#also named as libSage
|
#also named as libSage
|
||||||
if (TARGET ${project})
|
if (TARGET ${project})
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif ()
|
||||||
project(${project})
|
project(${project})
|
||||||
message("processing ${project}")
|
message("processing ${project}")
|
||||||
|
|
||||||
# Read pathes to external sapfor directories
|
# Read pathes to external sapfor directories
|
||||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../paths.txt")
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../paths.txt")
|
||||||
message("Found paths.txt, using custom paths.")
|
message("Found paths.txt, using custom paths.")
|
||||||
FILE(STRINGS ../paths.txt SAPFOR_PATHS)
|
FILE(STRINGS ../paths.txt SAPFOR_PATHS)
|
||||||
else ()
|
else ()
|
||||||
message("Not found paths.txt, using default paths.")
|
message("Not found paths.txt, using default paths.")
|
||||||
FILE(STRINGS ../paths.default.txt SAPFOR_PATHS)
|
FILE(STRINGS ../paths.default.txt SAPFOR_PATHS)
|
||||||
endif ()
|
endif ()
|
||||||
foreach (NameAndValue ${SAPFOR_PATHS})
|
foreach (NameAndValue ${SAPFOR_PATHS})
|
||||||
# Strip leading spaces
|
# Strip leading spaces
|
||||||
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
||||||
# Find variable name
|
# Find variable name
|
||||||
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
||||||
# Find the value
|
# Find the value
|
||||||
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
||||||
# Set the variable, note the ../ because we are deeper than the file
|
# Set the variable, note the ../ because we are deeper than the file
|
||||||
set(${Name} "../${Value}")
|
set(${Name} "../${Value}")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
# if not default ${sage_sources} must be set in ../paths.txt
|
# if not default ${sage_sources} must be set in ../paths.txt
|
||||||
set(SOURCE_LIB
|
set(SOURCE_LIB
|
||||||
${sage_sources}/annotate.tab.c
|
${sage_sources}/annotate.tab.c
|
||||||
${sage_sources}/comments.c
|
${sage_sources}/comments.c
|
||||||
${sage_sources}/low_level.c
|
${sage_sources}/low_level.c
|
||||||
${sage_sources}/toolsann.c
|
${sage_sources}/toolsann.c
|
||||||
${sage_sources}/unparse.c
|
${sage_sources}/unparse.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# if not default ${fdvm_include}, ${sage_include_1}, ${sage_include_2} must be set in ../paths.txt
|
# if not default ${fdvm_include}, ${sage_include_1}, ${sage_include_2} must be set in ../paths.txt
|
||||||
include_directories(${fdvm_include} ${sage_include_1} ${sage_include_2})
|
include_directories(${fdvm_include} ${sage_include_1} ${sage_include_2})
|
||||||
add_library(SageNewSrc STATIC ${SOURCE_LIB})
|
add_library(SageNewSrc STATIC ${SOURCE_LIB})
|
||||||
|
|
||||||
add_subdirectory(../SageOldSrc ${CMAKE_CURRENT_BINARY_DIR}/SageOldSrc)
|
add_subdirectory(../SageOldSrc ${CMAKE_CURRENT_BINARY_DIR}/SageOldSrc)
|
||||||
target_link_libraries(SageNewSrc SageOldSrc)
|
target_link_libraries(SageNewSrc SageOldSrc)
|
||||||
|
|
||||||
if (MSVC_IDE)
|
if (MSVC_IDE)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
||||||
endif()
|
endif()
|
||||||
@@ -1,63 +1,63 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
set(project SageOldSrc)
|
set(project SageOldSrc)
|
||||||
#set(CMAKE_C_STANDARD 11)
|
#set(CMAKE_C_STANDARD 11)
|
||||||
#also named as libDB
|
#also named as libDB
|
||||||
if (TARGET ${project})
|
if (TARGET ${project})
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif ()
|
||||||
project(${project})
|
project(${project})
|
||||||
message("processing ${project}")
|
message("processing ${project}")
|
||||||
|
|
||||||
# Read pathes to external sapfor directories
|
# Read pathes to external sapfor directories
|
||||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../paths.txt")
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../paths.txt")
|
||||||
message("Found paths.txt, using custom paths.")
|
message("Found paths.txt, using custom paths.")
|
||||||
FILE(STRINGS ../paths.txt SAPFOR_PATHS)
|
FILE(STRINGS ../paths.txt SAPFOR_PATHS)
|
||||||
else ()
|
else ()
|
||||||
message("Not found paths.txt, using default paths.")
|
message("Not found paths.txt, using default paths.")
|
||||||
FILE(STRINGS ../paths.default.txt SAPFOR_PATHS)
|
FILE(STRINGS ../paths.default.txt SAPFOR_PATHS)
|
||||||
endif ()
|
endif ()
|
||||||
foreach (NameAndValue ${SAPFOR_PATHS})
|
foreach (NameAndValue ${SAPFOR_PATHS})
|
||||||
# Strip leading spaces
|
# Strip leading spaces
|
||||||
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
||||||
# Find variable name
|
# Find variable name
|
||||||
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
||||||
# Find the value
|
# Find the value
|
||||||
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
||||||
# Set the variable, note the ../ because we are deeper than the file
|
# Set the variable, note the ../ because we are deeper than the file
|
||||||
set(${Name} "../${Value}")
|
set(${Name} "../${Value}")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
# if not default ${libdb_sources} must be set in ../paths.txt
|
# if not default ${libdb_sources} must be set in ../paths.txt
|
||||||
set(SOURCE_LIB
|
set(SOURCE_LIB
|
||||||
${libdb_sources}/anal_ind.c
|
${libdb_sources}/anal_ind.c
|
||||||
${libdb_sources}/db.c
|
${libdb_sources}/db.c
|
||||||
${libdb_sources}/dbutils.c
|
${libdb_sources}/dbutils.c
|
||||||
${libdb_sources}/db_unp.c
|
${libdb_sources}/db_unp.c
|
||||||
${libdb_sources}/db_unp_comm.c
|
${libdb_sources}/db_unp_comm.c
|
||||||
${libdb_sources}/db_unp_vpc.c
|
${libdb_sources}/db_unp_vpc.c
|
||||||
${libdb_sources}/garb_coll.c
|
${libdb_sources}/garb_coll.c
|
||||||
${libdb_sources}/glob_anal.c
|
${libdb_sources}/glob_anal.c
|
||||||
${libdb_sources}/ker_fun.c
|
${libdb_sources}/ker_fun.c
|
||||||
${libdb_sources}/list.c
|
${libdb_sources}/list.c
|
||||||
${libdb_sources}/make_nodes.c
|
${libdb_sources}/make_nodes.c
|
||||||
${libdb_sources}/mod_ref.c
|
${libdb_sources}/mod_ref.c
|
||||||
${libdb_sources}/ndeps.c
|
${libdb_sources}/ndeps.c
|
||||||
${libdb_sources}/readnodes.c
|
${libdb_sources}/readnodes.c
|
||||||
${libdb_sources}/sets.c
|
${libdb_sources}/sets.c
|
||||||
${libdb_sources}/setutils.c
|
${libdb_sources}/setutils.c
|
||||||
${libdb_sources}/symb_alg.c
|
${libdb_sources}/symb_alg.c
|
||||||
${libdb_sources}/writenodes.c
|
${libdb_sources}/writenodes.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# if not default ${fdvm_include}, ${sage_include_1}, ${sage_include_2} must be set in ../paths.txt
|
# if not default ${fdvm_include}, ${sage_include_1}, ${sage_include_2} must be set in ../paths.txt
|
||||||
include_directories(${fdvm_include} ${sage_include_1} ${sage_include_2})
|
include_directories(${fdvm_include} ${sage_include_1} ${sage_include_2})
|
||||||
add_library(SageOldSrc STATIC ${SOURCE_LIB})
|
add_library(SageOldSrc STATIC ${SOURCE_LIB})
|
||||||
|
|
||||||
if (MSVC_IDE)
|
if (MSVC_IDE)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user