From 9ba2c5c0bc3021d79b501e567ff64233f9ee31c2 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 15 Jul 2010 14:00:28 +0000 Subject: [PATCH] * All Tools: - Change: Using more Bootstrap macros. Simpler way of setting the CMAKE_MODULE_PATH. --- crlcore/CMakeLists.txt | 102 +++++++++++++---------------------------- 1 file changed, 31 insertions(+), 71 deletions(-) diff --git a/crlcore/CMakeLists.txt b/crlcore/CMakeLists.txt index b5c04db7..6c7322f1 100644 --- a/crlcore/CMakeLists.txt +++ b/crlcore/CMakeLists.txt @@ -1,76 +1,36 @@ -PROJECT(CRLCORE) -CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0) + project(CRLCORE) -#IF(COMMAND CMAKE_POLICY) -# CMAKE_POLICY(SET CMP0003 NEW) -# CMAKE_POLICY(SET CMP0005 NEW) -# IF(NOT (CMAKE_VERSION VERSION_LESS 2.8.0)) -# CMAKE_POLICY(SET CMP0014 OLD) -# ENDIF(NOT (CMAKE_VERSION VERSION_LESS 2.8.0)) -#ENDIF(COMMAND CMAKE_POLICY) + cmake_minimum_required(VERSION 2.4.0) -# This macro has to be included in all the tools CMakeLists.txt as it's -# the sole means of localizing other tools/projects. -MACRO(SETUP_PROJECT_PATHS project) - IF( NOT("$ENV{${project}_TOP}" STREQUAL "") ) - MESSAGE("-- ${project}_TOP is set to $ENV{${project}_TOP}") - SET(PROJECT_MODULE_PATH "${DESTDIR}$ENV{${project}_TOP}/share/cmake/Modules/") - LIST(INSERT CMAKE_MODULE_PATH 0 "${PROJECT_MODULE_PATH}") - ENDIF( NOT("$ENV{${project}_TOP}" STREQUAL "") ) + list(INSERT CMAKE_MODULE_PATH 0 "$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + find_package(Bootstrap REQUIRED) + setup_project_paths(VLSISAPD) + setup_project_paths(CORIOLIS) + list(INSERT CMAKE_MODULE_PATH 0 "${CRLCORE_SOURCE_DIR}/cmake_modules/") + print_cmake_module_path() - IF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") ) - MESSAGE("-- ${project}_USER_TOP is set to $ENV{${project}_USER_TOP}") - SET(PROJECT_MODULE_PATH "${DESTDIR}$ENV{${project}_USER_TOP}/share/cmake/Modules/") - LIST(INSERT CMAKE_MODULE_PATH 0 "${PROJECT_MODULE_PATH}") - ENDIF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") ) + setup_sysconfdir("$ENV{CORIOLIS_TOP}") + set_cmake_policies() + set_lib_link_mode() + setup_boost(program_options filesystem python regex) - LIST(REMOVE_DUPLICATES CMAKE_MODULE_PATH) -ENDMACRO(SETUP_PROJECT_PATHS project) - -SETUP_PROJECT_PATHS(BOOTSTRAP) -SETUP_PROJECT_PATHS(VLSISAPD) -SETUP_PROJECT_PATHS(CORIOLIS) - -LIST(INSERT CMAKE_MODULE_PATH 0 "${CRLCORE_SOURCE_DIR}/cmake_modules/") - -MESSAGE("-- Components of CMAKE_MODULE_PATH:") -FOREACH(PATH IN LISTS CMAKE_MODULE_PATH) - MESSAGE("-- ${PATH}") -ENDFOREACH(PATH) - -STRING(REGEX MATCH "^/usr" IS_USR "$ENV{CORIOLIS_TOP}") -STRING(REGEX MATCH "^/opt" IS_OPT "$ENV{CORIOLIS_TOP}") -IF(IS_USR OR IS_OPT) - MESSAGE("-- Using system-wide /etc.") - SET(SYS_CONF_DIR "/etc" CACHE STRING "System configuration directory (/etc)" FORCE) -ELSE(IS_USR OR IS_OPT) - MESSAGE("-- Using install tree /etc.") - SET(SYS_CONF_DIR "etc" CACHE STRING "System configuration directory (/etc)" FORCE) -ENDIF(IS_USR OR IS_OPT) - -SET(QT_USE_QTXML "true") - -FIND_PACKAGE(Bootstrap REQUIRED) -set_cmake_policies() -set_lib_link_mode() -setup_boost(program_options filesystem python regex) - -FIND_PACKAGE(LibXml2 REQUIRED) -FIND_PACKAGE(PythonLibs REQUIRED) -FIND_PACKAGE(PythonSitePackages REQUIRED) -FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project -FIND_PACKAGE(BISON REQUIRED) -FIND_PACKAGE(FLEX REQUIRED) -FIND_PACKAGE(LEFDEF) -FIND_PACKAGE(OPENACCESS) -FIND_PACKAGE(VLSISAPD REQUIRED) -FIND_PACKAGE(HURRICANE REQUIRED) -INCLUDE(UseLATEX) - -ADD_SUBDIRECTORY(src) -ADD_SUBDIRECTORY(etc) -ADD_SUBDIRECTORY(cmake_modules) -IF(BUILD_DOC) - ADD_SUBDIRECTORY(doc) -ENDIF(BUILD_DOC) + find_package(LibXml2 REQUIRED) + find_package(PythonLibs REQUIRED) + find_package(PythonSitePackages REQUIRED) + set(QT_USE_QTXML "true") + find_package(Qt4 REQUIRED) # find and setup Qt4 for this project + find_package(BISON REQUIRED) + find_package(FLEX REQUIRED) + find_package(LEFDEF) + find_package(OPENACCESS) + find_package(VLSISAPD REQUIRED) + find_package(HURRICANE REQUIRED) + include(UseLATEX) + + add_subdirectory(src) + add_subdirectory(etc) + add_subdirectory(cmake_modules) + if(BUILD_DOC) + add_subdirectory(doc) + endif(BUILD_DOC)