diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f606355..10b0cf3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,6 @@ set(CMAKE_BINARY_DIR ${FMILibrary_BINARY_DIR}) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/Config.cmake) # User configuration options and parameters -set(FMILIB_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/../install CACHE PATH "Prefix prepended to install directories") set(FMILIB_THIRDPARTYLIBS ${CMAKE_SOURCE_DIR}/ThirdParty CACHE PATH "Path to the ThirdParty library dir" ) set(FMILIB_FMI_STANDARD_HEADERS ${FMILIB_THIRDPARTYLIBS}/FMI/default CACHE PATH "Path to the FMI standard headers dir" ) @@ -109,8 +108,6 @@ if(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE ${FMILIB_DEFAULT_BUILD_TYPE}) endif() -set(CMAKE_INSTALL_PREFIX ${FMILIB_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories" FORCE) - # debug_message is used to trace the build script function(debug_message) if(FMILIB_PRINT_DEBUG_MESSAGES) @@ -436,8 +433,6 @@ endfunction() if(FMILIB_GENERATE_DOXYGEN_DOC) - file(MAKE_DIRECTORY "${FMILIB_INSTALL_PREFIX}/doc") - set(DOXYFILE_IN ${CMAKE_SOURCE_DIR}/Config.cmake/fmilib_doxydoc.conf CACHE INTERNAL "Doxygen config file") set(DOXYFILE_IMAGE_DIR "${CMAKE_SOURCE_DIR}/images" CACHE INTERNAL "Doxygen images" FORCE) @@ -458,13 +453,14 @@ if(FMILIB_GENERATE_DOXYGEN_DOC) set(DOXYFILE_SOURCE_DIR "${CMAKE_BINARY_DIR}/doc" CACHE INTERNAL "Doxygen default source dir" FORCE) set(DOXYFILE_EXTRA_SOURCES "${DOXYFILE_EXTRA_SOURCES} \"${CMAKE_SOURCE_DIR}/Test\"") - set(DOXYFILE_OUTPUT_DIR "${FMILIB_INSTALL_PREFIX}/doc") + set(DOXYFILE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/doc") set(DOXYFILE_STRIP_FROM_PATH "${CMAKE_SOURCE_DIR}") set(CMAKE_MODULE_PATH ${FMILIB_THIRDPARTYLIBS}/CMakeModules) include(UseDoxygen/UseDoxygen) + endif(FMILIB_GENERATE_DOXYGEN_DOC) # Debug only: prints the final value of all the non-environment variables diff --git a/FMILIB_Readme.txt b/FMILIB_Readme.txt index 19cd7433..9ed5221d 100644 --- a/FMILIB_Readme.txt +++ b/FMILIB_Readme.txt @@ -31,19 +31,19 @@ CMake 3.1.3 or later is required in order to build expat. To build from a terminal command line on Linux or Mac with default settings use: \code mkdir build-fmil; cd build-fmil - cmake -DFMILIB_INSTALL_PREFIX= + cmake -DCMAKE_INSTALL_PREFIX= make install test \endcode To build in MSYS terminal with g++/gcc on Windows: \code mkdir build-fmil; cd build-fmil - cmake -DFMILIB_INSTALL_PREFIX= -G "MSYS Makefiles" + cmake -DCMAKE_INSTALL_PREFIX= -G "MSYS Makefiles" make install test \endcode To build from command line with Microsoft Visual Studio compilers on Windows: \code mkdir build-fmil; cd build-fmil - cmake -DFMILIB_INSTALL_PREFIX= -G "Visual Studio 10" + cmake -DCMAKE_INSTALL_PREFIX= -G "Visual Studio 10" cmake --build . --config MinSizeRel --target install \endcode @@ -62,7 +62,7 @@ The primary targets of the library build script are: the project in Visual Studio. The following build configuration options are provided: -- \b FMILIB_INSTALL_PREFIX - prefix prepended to install directories.\n +- \b CMAKE_INSTALL_PREFIX - prefix prepended to install directories.\n Default: "../install" \n This is the main install directory name. Include files will be located in the "include" subdirectory and library files in the "lib" subdirectory. diff --git a/Makefile b/Makefile index 074cb772..e57267ed 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ documentation: generate generate: mkdir -p $(BUILD_DIR) cd $(BUILD_DIR) && \ - cmake -DFMILIB_INSTALL_PREFIX=../$(INSTALL_DIR) \ + cmake -DCMAKE_INSTALL_PREFIX=../$(INSTALL_DIR) \ -DFMILIB_GENERATE_DOXYGEN_DOC=$(GENERATE_DOXYGEN_DOC) \ -DFMILIB_BUILD_WITH_STATIC_RTLIB=$(BUILD_WITH_STATIC_RTLIB) \ -DFMILIB_BUILD_TESTS=$(BUILD_TESTS) \