Skip to content
Snippets Groups Projects
Commit fedab470 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

CMake: clean up in ThirdParty, libManhattanStyle now is static library

parent 75f2c3dc
No related branches found
No related tags found
No related merge requests found
...@@ -39,8 +39,6 @@ if(BORNAGAIN_MAN) ...@@ -39,8 +39,6 @@ if(BORNAGAIN_MAN)
add_subdirectory(Doc/UserManual) add_subdirectory(Doc/UserManual)
endif() endif()
#set(CMAKE_MACOSX_RPATH 0)
add_subdirectory(Core) add_subdirectory(Core)
add_subdirectory(ThirdParty/gtest) add_subdirectory(ThirdParty/gtest)
add_subdirectory(Tests/UnitTests/TestCore) add_subdirectory(Tests/UnitTests/TestCore)
......
############################################################################ ############################################################################
# CMakeLists.txt file for building BornAgain/GUI libraries and executable # CMakeLists.txt file for building BornAgain/GUI libraries and executable
############################################################################ ############################################################################
cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR) cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)
if(POLICY CMP0020) if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW) cmake_policy(SET CMP0020 NEW)
endif() endif()
if(POLICY CMP0043) if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW) cmake_policy(SET CMP0043 NEW)
endif() endif()
if(POLICY CMP0042) if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) cmake_policy(SET CMP0042 NEW)
endif() endif()
message(STATUS "Configuring BornAgain GUI") message(STATUS "Configuring BornAgain GUI")
#if(POLICY CMP0020)
#cmake_policy(SET CMP0020 NEW)
#endif()
find_package(Qt5Widgets REQUIRED) find_package(Qt5Widgets REQUIRED)
if(${Qt5Widgets_FOUND}) if(${Qt5Widgets_FOUND})
message(STATUS " Found Qt5 version ${Qt5Widgets_VERSION_STRING}") message(STATUS " Found Qt5 version ${Qt5Widgets_VERSION_STRING}")
get_target_property(Qt5Widgets_location Qt5::Widgets LOCATION_Release) get_target_property(Qt5Widgets_location Qt5::Widgets LOCATION_Release)
...@@ -35,12 +31,13 @@ add_subdirectory(externals/qt-manhattan-style) ...@@ -35,12 +31,13 @@ add_subdirectory(externals/qt-manhattan-style)
add_subdirectory(externals/qcustomplot) add_subdirectory(externals/qcustomplot)
add_subdirectory(externals/qtpropertybrowser) add_subdirectory(externals/qtpropertybrowser)
add_subdirectory(coregui) add_subdirectory(coregui)
if(BORNAGAIN_CRASHHADLER) if(BORNAGAIN_CRASHHADLER)
add_definitions(-DBORNAGAIN_CRASHHANDLER) add_definitions(-DBORNAGAIN_CRASHHANDLER)
add_subdirectory(crashhandler) add_subdirectory(crashhandler)
endif() endif()
add_subdirectory(main)
add_subdirectory(main)
set(BornAgainGUI_INCLUDE_DIRS ${BornAgainGUI_INCLUDE_DIRS} PARENT_SCOPE) set(BornAgainGUI_INCLUDE_DIRS ${BornAgainGUI_INCLUDE_DIRS} PARENT_SCOPE)
set(BornAgainGUI_LIBRARY ${BornAgainGUI_LIBRARY} PARENT_SCOPE) set(BornAgainGUI_LIBRARY ${BornAgainGUI_LIBRARY} PARENT_SCOPE)
############################################################################
# CMakeLists.txt file for building qcustomplot static library
############################################################################
cmake_minimum_required(VERSION 2.8.9) cmake_minimum_required(VERSION 2.8.9)
if(POLICY CMP0020) if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW) cmake_policy(SET CMP0020 NEW)
endif() endif()
if(POLICY CMP0043) if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW) cmake_policy(SET CMP0043 NEW)
endif() endif()
set(library_name qcustomplot) set(library_name qcustomplot)
set(source_files qcustomplot.h qcustomplot.cpp) set(source_files qcustomplot.h qcustomplot.cpp)
......
############################################################################ ############################################################################
# CMakeLists.txt file for building libManhattanStyle # CMakeLists.txt file for building libManhattanStyle
############################################################################ ############################################################################
cmake_minimum_required(VERSION 2.8.9) cmake_minimum_required(VERSION 2.8.9)
if(POLICY CMP0020) if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW) cmake_policy(SET CMP0020 NEW)
endif() endif()
if(POLICY CMP0043) if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW) cmake_policy(SET CMP0043 NEW)
endif() endif()
if(POLICY CMP0042) if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) cmake_policy(SET CMP0042 NEW)
endif() endif()
#project(qt-manhattan-style)
set(library_name ManhattanStyle) set(library_name ManhattanStyle)
set(SRCS set(SRCS
...@@ -72,7 +70,6 @@ set(UI_FILES ...@@ -72,7 +70,6 @@ set(UI_FILES
# Qt5 # Qt5
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
#find_package(Qt5Widgets)
# Run uic on ui files # Run uic on ui files
qt5_wrap_ui(UI_HDRS ${UI_FILES}) qt5_wrap_ui(UI_HDRS ${UI_FILES})
...@@ -86,7 +83,7 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x040900) ...@@ -86,7 +83,7 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x040900)
# Create the target # Create the target
add_definitions(-DQTMANHATTANSTYLE_LIBRARY) add_definitions(-DQTMANHATTANSTYLE_LIBRARY)
add_library(${library_name} SHARED ${SRCS} ${UI_HDRS} ${RC_SRCS}) add_library(${library_name} STATIC ${SRCS} ${UI_HDRS} ${RC_SRCS})
set(${library_name}_INCLUDE_DIRS ${include_dirs} PARENT_SCOPE) set(${library_name}_INCLUDE_DIRS ${include_dirs} PARENT_SCOPE)
set(${library_name}_LIBRARY ${library_name} PARENT_SCOPE) set(${library_name}_LIBRARY ${library_name} PARENT_SCOPE)
...@@ -97,6 +94,3 @@ target_link_libraries(${library_name} ${Qt5Widgets_LIBRARIES}) ...@@ -97,6 +94,3 @@ target_link_libraries(${library_name} ${Qt5Widgets_LIBRARIES})
qt5_use_modules(${library_name} Widgets) qt5_use_modules(${library_name} Widgets)
# --- installation ---
install (TARGETS ${library_name} DESTINATION ${destination_lib} COMPONENT Libraries)
############################################################################
# CMakeLists.txt file for building static qtpropertybrowser library from qtsolutions
############################################################################
cmake_minimum_required(VERSION 2.8.9) cmake_minimum_required(VERSION 2.8.9)
if(POLICY CMP0020) if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW) cmake_policy(SET CMP0020 NEW)
endif() endif()
if(POLICY CMP0043) if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW) cmake_policy(SET CMP0043 NEW)
endif() endif()
set(library_name qtpropertybrowser) set(library_name qtpropertybrowser)
file(GLOB source_files "*.cpp") file(GLOB source_files "*.cpp")
file(GLOB include_files "*.h") file(GLOB include_files "*.h")
......
############################################################################ ############################################################################
# CMakeLists.txt file for building libRootMinimizers package # CMakeLists.txt file for building libRootMinimizers package
############################################################################ ############################################################################
set(library_name RootMinimizers) set(library_name RootMinimizers)
# source and include files # --- source and include files ---------
set(include_dirs set(include_dirs
${CMAKE_CURRENT_SOURCE_DIR}/inc ${CMAKE_CURRENT_SOURCE_DIR}/inc
) )
...@@ -23,39 +22,32 @@ file(GLOB include_files ...@@ -23,39 +22,32 @@ file(GLOB include_files
"src/Math/*.h" "src/Math/*.h"
) )
if(NOT ROOT_FOUND) if(NOT ROOT_FOUND)
list(REMOVE_ITEM source_files "${CMAKE_CURRENT_SOURCE_DIR}/src/Math/GeneticMinimizer.cxx") list(REMOVE_ITEM source_files "${CMAKE_CURRENT_SOURCE_DIR}/src/Math/GeneticMinimizer.cxx")
list(REMOVE_ITEM include_files "${CMAKE_CURRENT_SOURCE_DIR}/inc/Math/GeneticMinimizer.h") list(REMOVE_ITEM include_files "${CMAKE_CURRENT_SOURCE_DIR}/inc/Math/GeneticMinimizer.h")
endif() endif()
# --- definitions ---------
add_definitions(-DWARNINGMSG) add_definitions(-DWARNINGMSG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMATH_NO_PLUGIN_MANAGER -DHAS_MINUIT2 -DR__HAS_MATHMORE") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMATH_NO_PLUGIN_MANAGER -DHAS_MINUIT2 -DR__HAS_MATHMORE")
# --- making library ---
# --- making library ------------
add_library( add_library(
${library_name} ${library_name}
STATIC STATIC
${source_files} ${include_files} ${source_files} ${include_files}
) )
#set_Target_properties(${library_name} PROPERTIES PREFIX ${libprefix} SUFFIX ${libsuffix})
#set(${library_name}_LIBRARY_TYPE SHARED)
# exposing library name and list of include directories outside
set(${library_name}_INCLUDE_DIRS ${include_dirs} PARENT_SCOPE) set(${library_name}_INCLUDE_DIRS ${include_dirs} PARENT_SCOPE)
set(${library_name}_LIBRARY ${library_name} PARENT_SCOPE) set(${library_name}_LIBRARY ${library_name} PARENT_SCOPE)
# --- external dependencies --- # --- external dependencies ---
include_directories(${GSL_INCLUDE_DIR}) include_directories(${GSL_INCLUDE_DIR})
target_link_libraries(${library_name} ${GSL_LIBRARIES}) target_link_libraries(${library_name} ${GSL_LIBRARIES})
if(ROOT_FOUND) if(ROOT_FOUND)
include_directories( include_directories(${ROOT_INCLUDE_DIR})
${ROOT_INCLUDE_DIR}
)
endif() endif()
# --- installation ---
#install (TARGETS ${library_name} DESTINATION ${destination_lib} COMPONENT Libraries)
############################################################################ ############################################################################
# CMakeLists.txt file for building gtest library # CMakeLists.txt file for building gtest library
############################################################################ ############################################################################
if(POLICY CMP0042) if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) cmake_policy(SET CMP0042 NEW)
endif() endif()
if(MSVC) if(MSVC)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment