From 9c72b8821043abf2feb87cce804a97fccdaddc10 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 18 Mar 2010 15:32:06 +0000 Subject: [PATCH] * All Tools: - Change: New structure for the installation & CMake system. * Tools are now grouped in "projects". There are three projects: 1. - IO: Standalones parsers/drivers (IO_USER_TOP, IO_TOP). 2. - Coriolis: Base & digital tools (CORIOLIS_USER_TOP, CORIOLIS_TOP). 3. - Chams: Analogic tools (CHAMS_USER_TOP, CHAMS_TOP). Each *project* has a two "TOP" environement variables, for example: IO_TOP and IO_USER_TOP. Thoses variables are the only ones useds to locate the tool (CMake modules, headers & libraries). The local path always takes precedence over the global one. The localisation process occurs in each tool top CMakeLists.txt where the macro SETUP_PROJECT_PATH is to be defined. There is no way to put it in a shared includes file as it's the macro precisely used to locates the includes... You have to call the macro once for each project you wants to uses: SETUP_PROJECT_PATHS(IO) SETUP_PROJECT_PATHS(CORIOLIS) * In FindTOOL.cmake, supress the _DIR_SEARCH and uses the _DIR_SEARCH instead (example: CORIOLIS_DIR_SEARCH). * buildCoriolis.py modificated according to the new "TOP" scheme. --- vlsisapd/CMakeLists.txt | 2 +- vlsisapd/cmake_modules/FindIO.cmake | 125 ++++++++++++++-------------- 2 files changed, 64 insertions(+), 63 deletions(-) diff --git a/vlsisapd/CMakeLists.txt b/vlsisapd/CMakeLists.txt index be409acb..22771642 100644 --- a/vlsisapd/CMakeLists.txt +++ b/vlsisapd/CMakeLists.txt @@ -2,7 +2,7 @@ PROJECT(IO) CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0) -SET(CMAKE_MODULE_PATH "${IO_SOURCE_DIR}/cmake_modules/") +LIST(INSERT CMAKE_MODULE_PATH 0 "${IO_SOURCE_DIR}/cmake_modules/") FIND_PACKAGE(LibXml2 REQUIRED) diff --git a/vlsisapd/cmake_modules/FindIO.cmake b/vlsisapd/cmake_modules/FindIO.cmake index 1f72f656..47332682 100644 --- a/vlsisapd/cmake_modules/FindIO.cmake +++ b/vlsisapd/cmake_modules/FindIO.cmake @@ -1,72 +1,73 @@ # - Try to find the IO libraries # Once done this will define # -# IO_FOUND - system has the IO library +# IO_FOUND - system has the IO library # IO_INCLUDE_DIR - the IO include directory -# IO_LIBRARIES - The libraries needed to use IO - -SET(IO_DIR_SEARCH $ENV{IO_TOP}) +# IO_LIBRARIES - The libraries needed to use IO SET(IO_FOUND FALSE) -# AGDS -FIND_PATH(AGDS_INCLUDE_DIR - NAMES io/agds/GdsLibrary.h - PATHS ${IO_DIR_SEARCH} - PATH_SUFFIXES include -) -FIND_LIBRARY(AGDS_LIBRARY - NAMES agds - PATHS ${IO_DIR_SEARCH} - PATH_SUFFIXES lib -) -IF(AGDS_INCLUDE_DIR AND AGDS_LIBRARY) - SET(AGDS_FOUND TRUE) - #SET(IO_FOUND TRUE) -# SET(IO_LIBRARIES ${AGDS_LIBRARY}) -ELSE(AGDS_INCLUDE_DIR AND AGDS_LIBRARY) - SET(AGDS_FOUND FALSE) -# SET(IO_LIBRARIES) -ENDIF(AGDS_INCLUDE_DIR AND AGDS_LIBRARY) -# CIF -FIND_PATH(CIF_INCLUDE_DIR - NAMES io/cif/CifCircuit.h - PATHS ${IO_DIR_SEARCH} - PATH_SUFFIXES include -) -FIND_LIBRARY(CIF_LIBRARY - NAMES cif - PATHS ${IO_DIR_SEARCH} - PATH_SUFFIXES lib -) -IF(CIF_INCLUDE_DIR AND CIF_LIBRARY) - SET(CIF_FOUND TRUE) -ELSE(CIF_INCLUDE_DIR AND CIF_LIBRARY) - SET(CIF_FOUND FALSE) -ENDIF(CIF_INCLUDE_DIR AND CIF_LIBRARY) - -# OPENCHAMS -FIND_PATH(OPENCHAMS_INCLUDE_DIR - NAMES io/openChams/Circuit.h - PATHS ${IO_DIR_SEARCH} - PATH_SUFFIXES include -) -FIND_LIBRARY(OPENCHAMS_LIBRARY - NAMES openChams - PATHS ${IO_DIR_SEARCH} - PATH_SUFFIXES lib -) -IF(OPENCHAMS_INCLUDE_DIR AND OPENCHAMS_LIBRARY) - SET(OPENCHAMS_FOUND TRUE) -ELSE(OPENCHAMS_INCLUDE_DIR AND OPENCHAMS_LIBRARY) - SET(OPENCHAMS_FOUND FALSE) -ENDIF(OPENCHAMS_INCLUDE_DIR AND OPENCHAMS_LIBRARY) - -IF(AGDS_FOUND AND CIF_FOUND AND OPENCHAMS_FOUND) - SET(IO_FOUND TRUE) -ELSE(AGDS_FOUND AND CIF_FOUND AND OPENCHAMS_FOUND) - SET(IO_FOUND FALSE) -ENDIF(AGDS_FOUND AND CIF_FOUND AND OPENCHAMS_FOUND) +IF(IO_DIR_SEARCH) + # AGDS + FIND_PATH(AGDS_INCLUDE_DIR + NAMES io/agds/GdsLibrary.h + PATHS ${IO_DIR_SEARCH} + PATH_SUFFIXES include + ) + FIND_LIBRARY(AGDS_LIBRARY + NAMES agds + PATHS ${IO_DIR_SEARCH} + PATH_SUFFIXES lib + ) + IF(AGDS_INCLUDE_DIR AND AGDS_LIBRARY) + SET(AGDS_FOUND TRUE) + #SET(IO_FOUND TRUE) + # SET(IO_LIBRARIES ${AGDS_LIBRARY}) + ELSE(AGDS_INCLUDE_DIR AND AGDS_LIBRARY) + SET(AGDS_FOUND FALSE) + # SET(IO_LIBRARIES) + ENDIF(AGDS_INCLUDE_DIR AND AGDS_LIBRARY) + + # CIF + FIND_PATH(CIF_INCLUDE_DIR + NAMES io/cif/CifCircuit.h + PATHS ${IO_DIR_SEARCH} + PATH_SUFFIXES include + ) + FIND_LIBRARY(CIF_LIBRARY + NAMES cif + PATHS ${IO_DIR_SEARCH} + PATH_SUFFIXES lib + ) + IF(CIF_INCLUDE_DIR AND CIF_LIBRARY) + SET(CIF_FOUND TRUE) + ELSE(CIF_INCLUDE_DIR AND CIF_LIBRARY) + SET(CIF_FOUND FALSE) + ENDIF(CIF_INCLUDE_DIR AND CIF_LIBRARY) + + # OPENCHAMS + FIND_PATH(OPENCHAMS_INCLUDE_DIR + NAMES io/openChams/Circuit.h + PATHS ${IO_DIR_SEARCH} + PATH_SUFFIXES include + ) + FIND_LIBRARY(OPENCHAMS_LIBRARY + NAMES openChams + PATHS ${IO_DIR_SEARCH} + PATH_SUFFIXES lib + ) + IF(OPENCHAMS_INCLUDE_DIR AND OPENCHAMS_LIBRARY) + SET(OPENCHAMS_FOUND TRUE) + ELSE(OPENCHAMS_INCLUDE_DIR AND OPENCHAMS_LIBRARY) + SET(OPENCHAMS_FOUND FALSE) + ENDIF(OPENCHAMS_INCLUDE_DIR AND OPENCHAMS_LIBRARY) + + IF(AGDS_FOUND AND CIF_FOUND AND OPENCHAMS_FOUND) + SET(IO_FOUND TRUE) + ELSE(AGDS_FOUND AND CIF_FOUND AND OPENCHAMS_FOUND) + SET(IO_FOUND FALSE) + ENDIF(AGDS_FOUND AND CIF_FOUND AND OPENCHAMS_FOUND) +ENDIF(IO_DIR_SEARCH) IF (NOT IO_FOUND) SET(IO_MESSAGE