set(libgras_version "${release_version}")
set(libsmpi_version "${release_version}")
-if(WIN32)
- message(" Be sure all those variables are correctely set.")
- message(" -- C_COMPILER $ENV{CC}")
- message(" -- CXX_COMPILER $ENV{CXX}")
- message(" -- RC_COMPILER $ENV{RC}")
- message(" -- INCLUDE $ENV{INCLUDE}")
- message(" -- LIB $ENV{LIB}")
- message(" -- MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM}")
- message(" -- CMAKE_BUILD_TOOL ${CMAKE_BUILD_TOOL}")
- message(" -- LINKER ${CMAKE_LINKER}")
- message(" -- CMAKE_GENERATOR ${CMAKE_GENERATOR}\n\n")
- set(__STRICT_ANSI__ 1)
- set(_MSC_VER 1)
-endif(WIN32)
-
### Find programs and paths
find_path(GCOV_PATH NAMES gcov PATHS NO_DEFAULT_PATHS)
find_path(VALGRIND_PATH NAMES valgrind PATHS NO_DEFAULT_PATHS)
SET(PROJECT_DIRECTORY "${CMAKE_HOME_DIRECTORY}")
### Set some variables for Cmake
-#SET(PROJECT_SOURCE_DIRECTORY "${PROJECT_DIRECTORY}/src") #this one is evil since it speaks to CPack instead
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(INCLUDES "-I${PROJECT_DIRECTORY}/include -I${PROJECT_DIRECTORY}/src/include -I${PROJECT_DIRECTORY}/src -I${CMAKE_CURRENT_BINARY_DIR}/src/")
set(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIRECTORY})
endif(EXISTS /usr/include/)
if(WIN32)
- set(INCLUDES "${INCLUDES} -I$ENV{INCLUDE}")
+ set(INCLUDES_MORE $ENV{INCLUDE})
+ string(REPLACE "\\" "/" INCLUDES_MORE "${INCLUDES_MORE}")
+ foreach(include_dir ${INCLUDES_MORE})
+ set(INCLUDES "${INCLUDES} -I\"${include_dir}\"")
+ endforeach(include_dir ${INCLUDES_MORE})
+endif(WIN32)
+
+if(WIN32)
+ message(" Be sure all those variables are correctely set.")
+ message(" -- C_COMPILER $ENV{CC}")
+ message(" -- CXX_COMPILER $ENV{CXX}")
+ message(" -- RC_COMPILER $ENV{RC}")
+ message(" -- INCLUDE $ENV{INCLUDE}")
+ message(" -- LIB $ENV{LIB}")
+ message(" -- MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM}")
+ message(" -- CMAKE_BUILD_TOOL ${CMAKE_BUILD_TOOL}")
+ message(" -- LINKER ${CMAKE_LINKER}")
+ message(" -- CMAKE_GENERATOR ${CMAKE_GENERATOR}\n\n")
+ message(" -- INCLUDES ${INCLUDES}")
+ set(__STRICT_ANSI__ 1)
+ set(_MSC_VER 1)
+ set(_WIN32 1)
endif(WIN32)
if(enable_coverage)
-exec_program("${CMAKE_C_COMPILER} --version" OUTPUT_VARIABLE "COMPILER_C_VERSION")
-exec_program("${CMAKE_CXX_COMPILER} --version" OUTPUT_VARIABLE "COMPILER_CXX_VERSION")
-
-string(REGEX MATCH "[0-9].[0-9].[0-9]" COMPILER_C_VERSION "${COMPILER_C_VERSION}")
-string(REGEX MATCH "[0-9].[0-9].[0-9]" COMPILER_CXX_VERSION "${COMPILER_CXX_VERSION}")
+string(REGEX MATCH "cl.exe" VBC "${CMAKE_C_COMPILER}")
+string(REGEX MATCH "gcc" GCC "${CMAKE_C_COMPILER}")
+if(VBC)
+ exec_program("${CMAKE_C_COMPILER}" OUTPUT_VARIABLE "COMPILER_C_V")
+ string(REPLACE "\n" ";" COMPILER_C_V "${COMPILER_C_V}")
+ foreach(line ${COMPILER_C_V})
+ if(NOT COMPILER_C_VERSION)
+ set(COMPILER_C_VERSION "${line}")
+ set(COMPILER_CXX_VERSION "${line}")
+ endif(NOT COMPILER_C_VERSION)
+ endforeach(line ${COMPILER_C_V})
+endif(VBC)
+if(GCC)
+ exec_program("${CMAKE_C_COMPILER} --version" OUTPUT_VARIABLE "COMPILER_C_VERSION")
+ exec_program("${CMAKE_CXX_COMPILER} --version" OUTPUT_VARIABLE "COMPILER_CXX_VERSION")
+ string(REGEX MATCH "[0-9].[0-9].[0-9]" COMPILER_C_VERSION "${COMPILER_C_VERSION}")
+ string(REGEX MATCH "[0-9].[0-9].[0-9]" COMPILER_CXX_VERSION "${COMPILER_CXX_VERSION}")
+endif(GCC)
if(enable_print_message)
message("")
cmake_minimum_required(VERSION 2.6)
-SET(PROJECT_NAME "Simgrid_doc")
+project(Simgrid_doc NONE)
+
### AUTO DETECT THE PROJECT_DIRECTORY
set(BIBTEX2HTML ${BIBTEX2HTML} CACHE TYPE INTERNAL FORCE)
\li cmake <a href="http://www.cmake.org/cmake/resources/software.html">(download page)</a>
For windows only :
- \li Dev-C++ <a href="http://sourceforge.net/projects/dev-cpp/">(download page)</a>
\li Visual C++ 2010 Express <a href="http://www.microsoft.com/express/Downloads/#2010-Visual-CPP">(download page)</a>
\li cmake <a href="http://www.cmake.org/cmake/resources/software.html">(download page)</a>
\li Set CC, CXX, INCLUDE, LIB and RC to environment variables.
\verbatim
-for example
- CC C:\Dev-Cpp\bin\gcc
- CXX C:\Dev-Cpp\bin\c++
- INCLUDE C:\Dev-Cpp\include
- LIB C:\Dev-Cpp\lib
- RC C:\Program Files\Microsoft SDKs\Windows\v7.OA\bin\RC
-\endverbatim
- \li nmake (embedded with Visual C++)
- \li Add to environment variable "Path" the path where to find nmake executable.
+SET --> CC TO --> C:\MicrosoftVisualStudio10\VC\bin\cl
+ --> CXX --> C:\MicrosoftVisualStudio10\VC\bin\cl
+ --> INCLUDE --> C:\MicrosoftVisualStudio10\VC\include;C:\Program Files\Microsoft SDKs\Windows\v7.OA\Include
+ --> LIB --> C:\MicrosoftVisualStudio10\VC\lib;C:\Program Files\Microsoft SDKs\Windows\v7.OA\Lib
+ --> RC --> C:\Program Files\Microsoft SDKs\Windows\v7.OA\bin\RC
+\endverbatim
+ \li Add to environment variable "Path" the path where to find nmake executable and some needed files.
\verbatim
-for example
- Path ......;C\Microsoft\Visual Studio10\VC\bin
+......
+;C\MicrosoftVisualStudio10\VC\bin
+;C\MicrosoftVisualStudio10\Common7\IDE
+;C:\Program Files\Microsoft SDKs\Windows\v7.OA\bin
+;C:\Program Files\Microsoft SDKs\Windows\v7.OA\Lib
+;C:\Program Files\Microsoft SDKs\Windows\v7.OA\bInclude
\endverbatim
\subsection faq_cmakeoption Cmake options
\subsubsection faq_cmakeoption3 Initialisation
-Those options are initialized the first time you launch \"cmake ./\" whithout specified option.
+Those options are initialized the first time you launch "cmake ." whithout specified option.
\verbatim
enable_gtnets on
\subsubsection faq_cmakeoption4 Option's cache and how to reset?
-When options have been set they are keep into a cache file named \"CMakeCache.txt\". So if you want
+When options have been set they are keep into a cache file named "CMakeCache.txt". So if you want
reset values you just delete this file located to the project directory.
\subsection faq_cmakecompilation Cmake compilation
\subsubsection faq_cmakecompilation2bis Build out of source.
As cmake generate many files used for compilation, we recommand to make a build directory.
-For examples you can make those command :
+For examples you can make :
\verbatim
"navarrop@caraja:~/Developments$ cd simgrid/"
make maintainer-clean clean maintainer files
make all-clean execute the 5 upper clean command
make html Create simgrid documentation
-make maintainer-clean Remove all files generated by mainainer mode
\endverbatim
When the project have been succesfully compiling and build you can make tests.