-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Massive code relocation and a new (real) build system using CMake
- Loading branch information
Showing
1,451 changed files
with
163 additions
and
2,915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
project(HyPhy) | ||
|
||
set(DEFAULT_COMPILE_FLAGS "-w -c -fsigned-char -fast -O3") | ||
|
||
set(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "Installation prefix") | ||
|
||
add_subdirectory(contrib/gtest-1.6.0) | ||
set_property( | ||
TARGET gtest gtest_main | ||
PROPERTY EXCLUDE_FROM_ALL true | ||
) | ||
|
||
# file(GLOB_RECURSE HYPHY_STDLIB res/) | ||
# add_custom_command(OUTPUT ${HYPHY_STDLIB} | ||
|
||
install(DIRECTORY res/ DESTINATION lib/hyphy) | ||
|
||
# uninstall target | ||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" | ||
IMMEDIATE @ONLY | ||
) | ||
add_custom_target(uninstall | ||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake | ||
) | ||
|
||
file(GLOB SRC_CORE src/core/*.cpp) | ||
file(GLOB SRC_NEW src/new/*.cpp) | ||
file(GLOB SRC_GTESTS tests/gtests/*.cpp) | ||
|
||
set(SRC_LINK src/lib/Link/THyPhy.cpp) | ||
set(SRC_PREFS src/gui/preferences.cpp) | ||
set(SRC_SQLITE3 contrib/SQLite-3.6.17/sqlite3.c) | ||
set(SRC_UNIXMAIN src/mains/unix.cpp) | ||
set(SRC_UTILS src/utils/hyphyunixutils.cpp) | ||
|
||
set(SRC_COMMON ${SRC_CORE} ${SRC_NEW} ${SRC_SQLITE3} ${SRC_UTILS}) | ||
|
||
set_property( | ||
SOURCE ${SRC_SQLITE3} | ||
APPEND PROPERTY COMPILE_FLAGS "-Wno-int-to-pointer-cast -Wno-pointer-to-int-cast" | ||
) | ||
|
||
add_library(hyphy_mp SHARED | ||
EXCLUDE_FROM_ALL | ||
${SRC_COMMON} ${SRC_LINK} ${SRC_PREFS} | ||
) | ||
target_link_libraries(hyphy_mp curl ssl crypto) | ||
install(TARGETS hyphy_mp | ||
LIBRARY DESTINATION lib | ||
OPTIONAL | ||
) | ||
add_custom_target(LIB DEPENDS hyphy_mp) | ||
|
||
add_executable(HYPHYMP | ||
EXCLUDE_FROM_ALL | ||
${SRC_COMMON} ${SRC_UNIXMAIN} | ||
) | ||
target_link_libraries(HYPHYMP curl ssl crypto) | ||
install(TARGETS HYPHYMP | ||
RUNTIME DESTINATION bin | ||
OPTIONAL | ||
) | ||
add_custom_target(MP2 DEPENDS HYPHYMP) | ||
|
||
add_executable(HYPHYMPI | ||
EXCLUDE_FROM_ALL | ||
${SRC_COMMON} ${SRC_UNIXMAIN} | ||
) | ||
target_link_libraries(HYPHYMPI curl ssl crypto) | ||
install(TARGETS HYPHYMPI | ||
RUNTIME DESTINATION bin | ||
OPTIONAL | ||
) | ||
add_custom_target(MPI DEPENDS HYPHYMPI) | ||
|
||
add_executable(HYPHYGTEST | ||
EXCLUDE_FROM_ALL | ||
${SRC_COMMON} ${SRC_GTESTS} ${SRC_UNIXMAIN} | ||
) | ||
add_dependencies(HYPHYGTEST gtest) | ||
target_link_libraries(HYPHYGTEST curl ssl crypto gtest) | ||
add_custom_target(GTEST DEPENDS HYPHYGTEST) | ||
|
||
include_directories(src/core/include src/gui/include src/lib/Link src/new/include contrib contrib/gtest-1.6.0/include tests/gtests) | ||
add_definitions(-D_SLKP_LFENGINE_REWRITE_ -DINTPTR_TYPE=long) | ||
|
||
if(UNIX) | ||
add_definitions(-D__UNIX__) | ||
endif(UNIX) | ||
|
||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
add_definitions(-D__HYPHY_64__) | ||
endif(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
|
||
set_property( | ||
TARGET hyphy_mp | ||
APPEND PROPERTY COMPILE_DEFINITIONS __HEADLESS__ | ||
) | ||
|
||
set_property( | ||
TARGET hyphy_mp HYPHYMP | ||
APPEND PROPERTY COMPILE_DEFINITIONS __MP__ __MP2__ | ||
) | ||
|
||
set_property( | ||
TARGET HYPHYMPI | ||
PROPERTY COMPILE_DEFINITIONS __HYPHYMPI__ | ||
) | ||
|
||
set_property( | ||
TARGET HYPHYGTEST | ||
APPEND PROPERTY COMPILE_DEFINITIONS __UNITTEST__ | ||
) | ||
|
||
set_property( | ||
TARGET HYPHYMP HYPHYMPI HYPHYGTEST | ||
APPEND PROPERTY COMPILE_DEFINITIONS _HYPHY_BASEDIRECTORY_="${CMAKE_INSTALL_PREFIX}/lib/hyphy" | ||
) | ||
|
||
set_property( | ||
TARGET hyphy_mp HYPHYMP HYPHYMPI | ||
PROPERTY COMPILE_FLAGS ${DEFAULT_COMPILE_FLAGS} | ||
) | ||
|
||
set_property( | ||
TARGET HYPHYGTEST | ||
PROPERTY COMPILE_FLAGS "${DEFAULT_COMPILE_FLAGS} -g -fprofile-arcs -ftest-coverage" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") | ||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") | ||
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") | ||
|
||
# suppress nauseating output | ||
cmake_policy(SET CMP0007 OLD) | ||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) | ||
string(REGEX REPLACE "\n" ";" files "${files}") | ||
list(REVERSE files) | ||
foreach (file ${files}) | ||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") | ||
if (EXISTS "$ENV{DESTDIR}${file}") | ||
execute_process( | ||
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}" | ||
OUTPUT_VARIABLE rm_out | ||
RESULT_VARIABLE rm_retval | ||
) | ||
if(NOT ${rm_retval} EQUAL 0) | ||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") | ||
endif (NOT ${rm_retval} EQUAL 0) | ||
else (EXISTS "$ENV{DESTDIR}${file}") | ||
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") | ||
endif (EXISTS "$ENV{DESTDIR}${file}") | ||
endforeach(file) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.