Commit 01da6652 by Maarten L. Hekkelman

test nieuwe CCP4 regels

parent 839385c3
...@@ -28,17 +28,29 @@ endif() ...@@ -28,17 +28,29 @@ endif()
# Build shared libraries by default (not my cup of tea, but hey) # Build shared libraries by default (not my cup of tea, but hey)
option(BUILD_SHARED_LIBS "Build a shared library instead of a static one" OFF) option(BUILD_SHARED_LIBS "Build a shared library instead of a static one" OFF)
# We do not want to write an export file for all our symbols...
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# Only try to recreate SymOpTable_data.hpp if CCP4 is known # Optionally build a version to be installed inside CCP4
option(CCP4 "The location where ccp4 is installed" "") option(BUILD_FOR_CCP4 "Build a version to be installed in CCP4" OFF)
if(DEFINED CCP4 AND EXISTS ${CCP4}) if(BUILD_FOR_CCP4)
set(CLIBD ${CCP4}/lib/data) if("$ENV{CCP4}" STREQUAL "" OR NOT EXISTS $ENV{CCP4})
elseif(EXISTS $ENV{CCP4}) message(FATAL_ERROR "A CCP4 built was requested but CCP4 was not sourced")
else()
list(APPEND CMAKE_MODULE_PATH "$ENV{CCP4}")
list(APPEND CMAKE_PREFIX_PATH "$ENV{CCP4}")
set(CMAKE_INSTALL_PREFIX "$ENV{CCP4}")
endif("$ENV{CCP4}" STREQUAL "" OR NOT EXISTS $ENV{CCP4})
endif()
# Check if CCP4 is available
if(EXISTS "$ENV{CCP4}")
set(CCP4 $ENV{CCP4}) set(CCP4 $ENV{CCP4})
set(CLIBD ${CCP4}/lib/data) set(CLIBD ${CCP4}/lib/data)
endif() endif()
# When CCP4 is sourced in the environment, we can recreate the symmetry operations table
if(EXISTS "${CCP4}") if(EXISTS "${CCP4}")
option(RECREATE_SYMOP_DATA "Recreate SymOp data table in case it is out of date" ON) option(RECREATE_SYMOP_DATA "Recreate SymOp data table in case it is out of date" ON)
...@@ -49,7 +61,7 @@ else() ...@@ -49,7 +61,7 @@ else()
message("Not trying to recreate SymOpTable_data.hpp since CCP4 is not defined") message("Not trying to recreate SymOpTable_data.hpp since CCP4 is not defined")
endif() endif()
# set(CMAKE_DEBUG_POSTFIX d) set(CMAKE_DEBUG_POSTFIX d)
if(MSVC) if(MSVC)
# make msvc standards compliant... # make msvc standards compliant...
...@@ -69,7 +81,7 @@ if(MSVC) ...@@ -69,7 +81,7 @@ if(MSVC)
add_definitions(-D_WIN32_WINNT=${ver}) add_definitions(-D_WIN32_WINNT=${ver})
# On Windows, do not install in the system location # On Windows, do not install in the system location
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT BUILD_FOR_CCP4)
message(WARNING "The library and auxiliary files will be installed in $ENV{LOCALAPPDATA}/${PROJECT_NAME}") message(WARNING "The library and auxiliary files will be installed in $ENV{LOCALAPPDATA}/${PROJECT_NAME}")
set(CMAKE_INSTALL_PREFIX "$ENV{LOCALAPPDATA}/${PROJECT_NAME}" CACHE PATH "..." FORCE) set(CMAKE_INSTALL_PREFIX "$ENV{LOCALAPPDATA}/${PROJECT_NAME}" CACHE PATH "..." FORCE)
endif() endif()
...@@ -88,28 +100,27 @@ if(MSVC) ...@@ -88,28 +100,27 @@ if(MSVC)
set(COFF_SPEC "--coff=${COFF_TYPE}") set(COFF_SPEC "--coff=${COFF_TYPE}")
endif() endif()
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE AND NOT BUILD_FOR_CCP4 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# On Linux, install in the $HOME/.local folder by default # On Linux, install in the $HOME/.local folder by default
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(STATUS "The library and auxiliary files will be installed in $ENV{HOME}/.local")
message(WARNING "The library and auxiliary files will be installed in $ENV{HOME}/.local") set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "..." FORCE)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "..." FORCE)
endif()
endif() endif()
# Optionally use mrc to create resources # Optionally use resources, created with mrc
find_program(MRC mrc HINTS "$ENV{LOCALAPPDATA}/mrc" "$ENV{HOME}/.local/bin" "${CMAKE_INSTALL_PREFIX}/../mrc" "/usr/local/bin")
if(MRC) if(NOT BUILD_FOR_CCP4)
option(USE_RSRC "Use mrc to create resources" ON) find_package(mrc)
else()
message(WARNING "Not using resources since mrc was not found")
endif()
if(USE_RSRC STREQUAL "ON") if(MRC_FOUND)
set(USE_RSRC 1) option(USE_RSRC "Use mrc to create resources" ON)
else()
message(WARNING "Not using resources since mrc was not found")
endif()
message("Using resources compiled with ${MRC}") if(USE_RSRC STREQUAL "ON")
add_compile_definitions(USE_RSRC) set(USE_RSRC 1)
add_compile_definitions(USE_RSRC)
endif()
endif() endif()
# Libraries # Libraries
...@@ -121,8 +132,8 @@ find_package(Threads) ...@@ -121,8 +132,8 @@ find_package(Threads)
set (Boost_DETAILED_FAILURE_MSG ON) set (Boost_DETAILED_FAILURE_MSG ON)
find_package(Boost 1.71.0 REQUIRED COMPONENTS system iostreams regex date_time program_options) find_package(Boost 1.71.0 REQUIRED COMPONENTS system iostreams regex date_time program_options)
find_package(ZLIB) # find_package(ZLIB)
find_package(BZip2) # find_package(BZip2)
include_directories(${Boost_INCLUDE_DIR}) include_directories(${Boost_INCLUDE_DIR})
link_libraries(${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) link_libraries(${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
...@@ -139,7 +150,7 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git") ...@@ -139,7 +150,7 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
else() else()
message(WARNING "Git not found, cannot set version info") message(WARNING "Git not found, cannot set version info")
SET(BUILD_VERSION_STRING "unknown") SET(BUILD_VERSION_STRING ${PROJECT_VERSION})
endif() endif()
# generate version.h # generate version.h
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment